StyleConfig
interface
The configuration of the style feature.
ClassicEditor
.create( {
style: ... // Style feature config.
} )
.then( ... )
.catch( ... );
Copy code
See all editor options.
Properties
definitions : Array<StyleDefinition> | undefinedmodule:style/styleconfig~StyleConfig#definitionsThe available style definitions.
Style definitions are displayed in the
'style'UI dropdown and get applied by the style command to the content of the document.In the
'style'UI dropdown, definitions are automatically grouped into two categories based on the of theelementproperty:- Block styles: Can be applied to entire block elements only (e.g. headings, paragraphs, divs).
- Text styles: Can by applied to any text in any element in the document.
An example configuration:
[ // Definitions of block styles. { name: 'Red heading', element: 'h2', classes: [ 'red-heading' ] }, { name: 'Vibrant code', element: 'pre', classes: [ 'vibrant-code' ] }, // Definitions of text (inline) styles. { name: 'Marker', element: 'span', classes: [ 'marker' ] }, // ... ]Copy codeNote: Configuring style definitions will automatically configure the General HTML Support feature. You do not need to repeat the configuration in
GeneralHtmlSupportConfig.