Style Selector

How to add an item to the style selector

The style appears in the style selector if you define a format for the block element and specify the <select/> for its representation in Visual Editor.

  1. In a style sheet listed in common.xml (e.g.\Styles\common.css), create a style for an element, e.g.:
    h3{
    	color: red;
    }
  2. In common.xml, create a <radiogroup> or use the existing one for the style selector.
  3. Add a <format> element to the radio group.
  4. Add the following attributes to the format and specify their values, e.g.:
    • id="h3"
    • label="Heading 3"
    • notes="Heading 3"
    • block="h3"
  5. Add the <select/> element to the <format> element.

In common.xml you should have something like this:

<radiogroup> 
  <format id="h3" label="Heading 3" notes="Heading H3" block="h3"> 
    <select /> 
  </format> 
</radiogroup>

If you want a button on the toolbar, too, add the <button/> element within <format> (right under <select/>) and specify its label or its image attribute:

<button label="H3"/>