Theming
Every visual aspect of the editor is driven by CSS custom properties. To restyle the editor, override any of the tokens below in your own stylesheet — no theme provider, no extra deps.
Light, Dark, Auto
<RichTextEditor theme="light" />
<RichTextEditor theme="dark" />
<RichTextEditor theme="auto" /> // follows prefers-color-schemeBrand override example
/* your-styles.css */
.my-editor {
--rte-accent: #ff6b9d;
--rte-btn-active-bg: #ff6b9d;
--rte-bg: #fff8fb;
--rte-radius: 12px;
}<RichTextEditor className="my-editor" />Per-instance via inline style
<RichTextEditor
style={{
"--rte-accent": "#10b981",
"--rte-btn-active-bg": "#10b981",
} as React.CSSProperties}
/>Token reference
All variables read from :root, [data-rte-theme], or any ancestor selector.
| Variable | Purpose |
|---|---|
--rte-bg | Root background |
--rte-fg | Root foreground |
--rte-muted-fg | Muted text |
--rte-placeholder-fg | Placeholder text |
--rte-border | Default border |
--rte-border-strong | Stronger borders |
--rte-surface | Editor surface |
--rte-surface-elevated | Popover / dropdown surface |
--rte-toolbar-bg | Toolbar background |
--rte-toolbar-fg | Toolbar foreground |
--rte-toolbar-separator | Vertical separator color |
--rte-btn-fg | Toolbar button text |
--rte-btn-hover-bg | Toolbar button hover |
--rte-btn-active-bg | Toolbar button active |
--rte-btn-active-fg | Toolbar button active text |
--rte-accent | Primary accent (links, focus rings) |
--rte-accent-hover | Accent on hover |
--rte-accent-fg | Foreground on accent surfaces |
--rte-input-bg | Input fields in popovers |
--rte-input-fg | Input text |
--rte-input-border | Input border |
--rte-input-focus | Input focus ring |
--rte-dropdown-bg | Dropdown background |
--rte-dropdown-border | Dropdown border |
--rte-dropdown-shadow | Dropdown shadow |
--rte-code-bg | <code> / <pre> background |
--rte-code-fg | <code> / <pre> text |
--rte-quote-border | Blockquote left border |
--rte-quote-fg | Blockquote text |
--rte-table-border | Table border |
--rte-table-header-bg | Table header background |
--rte-image-outline | Image hover outline |
--rte-radius | Corner radius (default) |
--rte-radius-sm | Small corner radius |
--rte-radius-md | Medium corner radius |
--rte-font-family | Body font family |
--rte-font-mono | Monospace font family |
--rte-min-height | Editor surface min height |
--rte-toolbar-gap | Toolbar gap |
--rte-toolbar-padding | Toolbar padding |