
This DatoCMS plugin adds custom styles and marks to the editor of Structured Text fields. You define them with CSS in the plugin settings, and editors pick them from the toolbar.

Add your own Custom Styles. You can set the following attributes:
SlugSet this slug to what you want your final css class to be. Please Note: Upon changing this property, you will have to update all Structured Text Fields already used in DatoCMS.
TitleThis title will be shown in the DatoCMS Structured Text editor.
NodeFor now, you can choose between heading and paragraph
CSSThis is the CSS shown in the DatoCMS Structured Text editor

Add your own Custom Marks (inline styles). You can set the following attributes:
SlugSet this slug to what you want your final css class to be. Please Note: Upon changing this property, you will have to update all Structured Text Fields already used in DatoCMS.
TitleThis title will be shown in the DatoCMS Structured Text editor.
IconYou can set an icon name based on the icons available from fontawesome free icons
Keyboard ShortcutYou can set a keyboard shortcut you can use inside the DatoCMS Structured Text editor.
CSSThis is the CSS shown in the DatoCMS Structured Text editor

By default all styles and marks are available in every Structured Text field. With the Custom Text Styles field add-on you pick which ones each field gets.

See Per-field settings for the steps, an example and how the add-on works.
Custom styles are stored as the style property of a paragraph or heading node. Custom marks are stored in the marks array of a span node. Both hold the slug from the plugin settings.
{ "type": "paragraph", "style": "centered", "children": [ { "type": "span", "value": "This text is centered, and " }, { "type": "span", "marks": ["shout"], "value": "this part shouts" } ]}Your front end has to turn those slugs into CSS classes. Pick your framework for a complete example:
Both examples render the JSON above as:
<p>This text is centered, and <strong>this part shouts</strong></p>For other frameworks, see the DatoCMS docs on custom styles and custom marks.
See contributing.md.