|
1 |
| -# Style Menu |
| 1 | +# Style Select Menu |
2 | 2 |
|
3 |
| -A Style Menu is a configurable extension that adds a cascading menu to the toolbar for applying text styles and formatting. |
| 3 | +A Style Select Menu is a configurable extension that adds a cascading menu to the toolbar for applying text styles and formatting. |
4 | 4 |
|
5 | 5 | 
|
6 | 6 |
|
7 | 7 | {% hint style="info" %}
|
8 |
| -Any custom stylesheets associated with the Rich Text Editor will not auto generate a style menu in the toolbar. |
| 8 | +Any custom stylesheets associated with the Rich Text Editor will not auto generate a style select menu in the toolbar. |
9 | 9 | {% endhint %}
|
10 | 10 |
|
11 |
| -### Creating a Style Menu |
| 11 | +## Adding Style Select to Rich Text Editor |
12 | 12 |
|
13 |
| -In this article, you can find an example of how to set up a Style Menu using the package manifest file. |
| 13 | +To add Style Select to the Rich Text Editor: |
| 14 | + |
| 15 | +1. Go to **Settings**. |
| 16 | +2. Navigate to **Data Types**. |
| 17 | +3. Select the relevant Data Type. |
| 18 | +4. Drag **Style Select** from **Available Actions** into the **Toolbar** section. |
| 19 | +5. Click **Save**. |
| 20 | + |
| 21 | +Alternatively, while configuring an editor on a Document Type, you can drag **Style Select** from **Available Actions** into the **Toolbar** section. |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | +## Creating a Style Select Menu |
| 26 | + |
| 27 | +In this article, you can find an example of how to set up a Style Select Menu using the package manifest file. |
14 | 28 |
|
15 | 29 | {% code title="umbraco-package.json" %}
|
16 | 30 | ```json
|
@@ -72,35 +86,32 @@ In this article, you can find an example of how to set up a Style Menu using the
|
72 | 86 | ```
|
73 | 87 | {% endcode %}
|
74 | 88 |
|
75 |
| - |
76 |
| -The `items` property defines the structure of the style menu. Each menu item has the following options: |
| 89 | +The `items` property defines the structure of the style select menu. Each menu item has the following options: |
77 | 90 |
|
78 | 91 | - `label`: _(required)_ The label of the menu item. This supports localization keys.
|
79 | 92 | - `appearance`: This defines the appearance of the menu item. The value has 2 optional properties:
|
80 | 93 | - `icon`: To prefix an icon to the menu item.
|
81 | 94 | - `style`: To apply CSS rules to the menu item.
|
82 |
| -- `data`: To configure the function of the style menu item. The value has 3 optional properties: |
| 95 | +- `data`: To configure the function of the style select menu item. The value has 3 optional properties: |
83 | 96 | - `tag`: A [supported HTML tag](#supported-html-tags) name. This will be applied to the selected text.
|
84 | 97 | - `class`: Applies a class attribute with the defined class name to the containing tag of the selected text.
|
85 | 98 | - `id`: Applies an ID attribute with the defined ID value to the containing tag of the selected text.
|
86 | 99 | - `separatorAfter`: When `true`, it will add a line separator after the menu item.
|
87 | 100 | - `items`: To enable a cascading menu, an array of nested menu items may be added.
|
88 | 101 |
|
| 102 | +Once configured, all custom style select menus will appear in the Rich Text Editor toolbar options, as described in the [Rich Text Editor Configuration](configuration.md) article. |
89 | 103 |
|
90 |
| -Once configured, all custom style menus will appear in the Rich Text Editor toolbar options, as described in the [Rich Text Editor Configuration](configuration.md) article. |
91 |
| - |
92 |
| - |
93 |
| -#### Supported HTML tags |
| 104 | +### Supported HTML tags |
94 | 105 |
|
95 |
| -Since the Tiptap has a strict rich-text schema, only supported HTML tags can be used in the style menu, _(arbitrary markup will be excluded)._ The following HTML tag names are supported: |
| 106 | +Due to Tiptap’s strict rich-text schema, only supported HTML tags are allowed in the style select menu, _(arbitrary markup will be excluded)._ The following HTML tag names are supported: |
96 | 107 |
|
97 | 108 | - `h1`
|
98 | 109 | - `h2`
|
99 | 110 | - `h3`
|
100 | 111 | - `h4`
|
101 | 112 | - `h5`
|
102 | 113 | - `h6`
|
103 |
| -- `p` |
| 114 | +- `p` |
104 | 115 | - `blockquote`
|
105 | 116 | - `code`
|
106 | 117 | - `codeBlock`
|
|
0 commit comments