Skip to content

Commit f4c6da4

Browse files
committed
RTE: Custom CSS properties
1 parent 26d87ce commit f4c6da4

File tree

2 files changed

+39
-0
lines changed
  • 16/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor

2 files changed

+39
-0
lines changed

16/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ Use Blocks to define specific parts that can be added as part of the markup of t
2828

2929
Extend the functionality of the Rich Text Editor with extensions.
3030

31+
## [Custom CSS properties](css-properties.md)
32+
33+
Customize the appearance of the Rich Text Editor with custom CSS properties.
34+
3135
## Data Type Definition Example
3236

3337
![Rich Text Editor - Data Type](images/rte-tiptap-datatypedefinition.png)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Custom CSS properties
2+
3+
Customize the appearance of the Rich Text Editor with custom CSS properties.
4+
5+
You can customize appearance of the Rich Text Editor using CSS properties by defining them in your CSS files.
6+
7+
For example, to set minimum height of all Rich Text Editors throughout the backoffice. You could use the following CSS rule:
8+
9+
```css
10+
:root {
11+
--umb-rte-min-height: 300px;
12+
}
13+
```
14+
15+
For general information on working with stylesheets and JavaScript in Umbraco, check [Stylesheets and JavaScript](https://docs.umbraco.com/umbraco-cms/fundamentals/design/stylesheets-javascript).
16+
17+
If you wanted to target a specific Rich Text Editor, you can set the [stylesheet directly in the configuration](../configuration#stylesheets).
18+
19+
20+
## Custom CSS properties reference
21+
22+
The following CSS properties are available for customization:
23+
24+
| CSS Property | Description | Default Value |
25+
| ---------------------- | ------------------------------------------ | ------------- |
26+
| `--umb-rte-width` | The width of the rich-text-editor | `unset` |
27+
| `--umb-rte-min-width` | The minimum width of the rich-text-editor | `unset` |
28+
| `--umb-rte-max-width` | The maximum width of the rich-text-editor | `100%` |
29+
| `--umb-rte-height` | The height of the rich-text-editor | `100%` |
30+
| `--umb-rte-min-height` | The minimum height of the rich-text-editor | `100%` |
31+
| `--umb-rte-max-height` | The maximum height of the rich-text-editor | `100%` |
32+
33+
34+
The CSS custom properties may change in future versions of Umbraco. You can always find the latest values in the [RTE component base class](https://github.com/umbraco/Umbraco-CMS/blob/release-16.2.0/src/Umbraco.Web.UI.Client/src/packages/rte/components/rte-base.element.ts) in the Umbraco CMS GitHub repository.
35+

0 commit comments

Comments
 (0)