Rich Text Editor Styling
Style Variants
The following variants are supported:
| Variant | Description | Supported by |
|---|---|---|
| Makes the toolbar more compact | Lumo |
| Removes the border around the editor | Lumo |
Compact
Apply the compact style variant to make the toolbar more compact.
Source code
RichTextEditorThemeCompact.java
rich-text-editor-theme-compact.tsx
rich-text-editor-theme-compact.ts
Style Properties
The following style properties can be used in CSS stylesheets to customize the appearance of this component.
To apply values to these properties globally in your application UI, place them in a CSS block using the html {…} selector.
See Component Style Properties for more information on style properties.
Common Properties
| Property | Supported by |
|---|---|
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
| Aura, Lumo |
Overlay Properties
| CSS Property | Supported by |
|---|---|
| Aura |
| Aura |
| Aura |
| Aura |
| Aura |
| Aura |
| Aura |
Animation
The overlay has a built-in opening and closing animation, which is disabled until an animation
duration is set. The closed properties define the state that the overlay animates from when it
opens, and to when it closes. The Aura theme sets these properties for some components. Lumo has its
own overlay animations, which these properties don’t affect.
While an animation runs, the component has the opening or closing state attribute, so separate
values can be applied to each direction. The backdrop always fades, and only the opacity is animated
when the user prefers reduced motion.
| Property | Value syntax | Initial value |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Note
|
These properties are set on the toolbar popup element, vaadin-rich-text-editor-popup, not on the
vaadin-rich-text-editor root element.
|
CSS Selectors
The following CSS selectors can be used in stylesheets to target the various parts and states of the component. See the Styling documentation for more details on how to style components.
|
Important
|
Not for Shadow DOM
These selectors should be used in styles.css or another stylesheet loaded with the @StyleSheet annotation or the @import CSS rule.
They do not work in the shadow DOM of Vaadin components, such as in stylesheets in the components sub-folder or loaded with the @CssImport annotation’s themeFor property.
|
- Root element
-
vaadin-rich-text-editor
States
- Read-only
-
vaadin-rich-text-editor[readonly] - Disabled
-
vaadin-rich-text-editor[disabled] - Hovered
-
vaadin-rich-text-editor:hover
Toolbar
- Toolbar
-
vaadin-rich-text-editor::part(toolbar) - Toolbar button groups
-
vaadin-rich-text-editor::part(toolbar-group) - History button group
-
vaadin-rich-text-editor::part(toolbar-group-history) - Toolbar buttons
-
vaadin-rich-text-editor::part(toolbar-button) - Toolbar button toggled on
-
vaadin-rich-text-editor::part(toolbar-button-pressed) - Undo button
-
vaadin-rich-text-editor::part(toolbar-button-undo) - Redo button
-
vaadin-rich-text-editor::part(toolbar-button-redo) - Emphasis button group
-
vaadin-rich-text-editor::part(toolbar-group-emphasis) - Bold button
-
vaadin-rich-text-editor::part(toolbar-button-bold) - Italic button
-
vaadin-rich-text-editor::part(toolbar-button-italic) - Underline button
-
vaadin-rich-text-editor::part(toolbar-button-underline) - Strikeout button
-
vaadin-rich-text-editor::part(toolbar-button-strike) - Style button group
-
vaadin-rich-text-editor::part(toolbar-group-style) - Text color button
-
vaadin-rich-text-editor::part(toolbar-button-color) - Background button
-
vaadin-rich-text-editor::part(toolbar-button-background) - Heading button group
-
vaadin-rich-text-editor::part(toolbar-group-heading) - H1 button
-
vaadin-rich-text-editor::part(toolbar-button-h1) - H2 button
-
vaadin-rich-text-editor::part(toolbar-button-h2) - H3 button
-
vaadin-rich-text-editor::part(toolbar-button-h3) - Glyph transformation button group
-
vaadin-rich-text-editor::part(toolbar-group-glyph-transformation) - Subscript button
-
vaadin-rich-text-editor::part(toolbar-button-subscript) - Superscript button
-
vaadin-rich-text-editor::part(toolbar-button-superscript) - List button group
-
vaadin-rich-text-editor::part(toolbar-group-list) - Ordered list button
-
vaadin-rich-text-editor::part(toolbar-button-list-ordered) - Bullet list button
-
vaadin-rich-text-editor::part(toolbar-button-list-bullet) - Indentation button group
-
vaadin-rich-text-editor::part(toolbar-group-indent) - Decrease indentation button
-
vaadin-rich-text-editor::part(toolbar-button-outdent) - Increase indentation button
-
vaadin-rich-text-editor::part(toolbar-button-indent) - Alignment button group
-
vaadin-rich-text-editor::part(toolbar-group-alignment) - Align left button
-
vaadin-rich-text-editor::part(toolbar-button-align-left) - Align center button
-
vaadin-rich-text-editor::part(toolbar-button-align-center) - Align right button
-
vaadin-rich-text-editor::part(toolbar-button-align-right) - Rich content button group
-
vaadin-rich-text-editor::part(toolbar-group-rich-text) - Image button
-
vaadin-rich-text-editor::part(toolbar-button-image) - Link button
-
vaadin-rich-text-editor::part(toolbar-button-link) - Text block button group
-
vaadin-rich-text-editor::part(toolbar-group-block) - Block quote button
-
vaadin-rich-text-editor::part(toolbar-button-blockquote) - Code block button
-
vaadin-rich-text-editor::part(toolbar-button-code-block) - Format button group
-
vaadin-rich-text-editor::part(toolbar-group-format) - Clean formatting button
-
vaadin-rich-text-editor::part(toolbar-button-clean)