Skip to content

Commit 8c87db3

Browse files
authored
Merge pull request #7345 from umbraco/v16/cms/rte-css-props
RTE: Custom CSS properties
2 parents cfce0c3 + 38da1a3 commit 8c87db3

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

16/umbraco-cms/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
* [Dropdown](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/dropdown/README.md)
8484
* [Rich Text Editor](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/README.md)
8585
* [Configuration](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/configuration.md)
86+
* [Custom CSS properties](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/css-properties.md)
8687
* [Extensions](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/extensions.md)
8788
* [Style Menu](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/style-menu.md)
8889
* [Login](fundamentals/backoffice/login.md)

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 the appearance of the Rich Text Editor using CSS properties by defining them in your CSS files.
6+
7+
For example, to set the 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](../../../../design/stylesheets-javascript.md).
16+
17+
If you wanted to target a specific Rich Text Editor, you can set the [stylesheet directly in the configuration](configuration.md#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 [Rich Text Editor component base class](https://github.com/umbraco/Umbraco-CMS/blob/main/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)