Specifying Editing Default Style
By specifying a default style for each editing element, it is rendered as inline-style. Used to define the default style needed for editing or to reset the influence of parent CSS.
Style Specification Method
'editor.defaultStyle': You can specify a default style for the Model Element Type you want to designate.
- Styles can only be specified for designated Model Element Types.
- Styles can be specified in
cssTextstring format.
Default Style Specification Example
// synapeditor.config.js
'editor.defaultStyle': {
'Body': 'font-family: Arial, Helvetica, sans-serif; font-size: 11pt; line-height: 1.2;',
'Paragraph': 'line-height: 1.4'
},
Default Style Specification Result
<div class="se-contents" style="font-family: Arial, Helvetica, sans-serif; font-size: 11pt; line-height: 1.2; padding: 25px;">
<p style="margin-right: 0px; margin-bottom: 16px; margin-left: 0px; display: block;">
<span>Default style specification</span>
</p>
<p style="margin-right: 0px; margin-bottom: 16px; margin-left: 0px; display: block;">
<span>Default style specification</span>
</p>
</div>
Supported Model Element Types
| Model Element Type | Description |
|---|---|
Body | Refers to the editing area (div.se-contents). |
Paragraph | Refers to the <p> tag. |
TextRun | Refers to the <span> tag. |
Div | Refers to the <div> tag. |
Image | Refers to the <img> tag. |
Video | Refers to the <video> tag. |
List | Refers to the <ul> tag. |
ListItem | Refers to the <li> tag. |
Quote | Refers to the <blockquote> tag. |
Table | Refers to the <table> tag. |
TableRow | Refers to the <tr> tag. |
TableCell | Refers to the <td> tag. |
HorizontalLine | Refers to the <hr> tag. |
Iframe | Refers to the <iframe> tag. |