rich-text@tolipovjs

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-scheme

Brand 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.

VariablePurpose
--rte-bgRoot background
--rte-fgRoot foreground
--rte-muted-fgMuted text
--rte-placeholder-fgPlaceholder text
--rte-borderDefault border
--rte-border-strongStronger borders
--rte-surfaceEditor surface
--rte-surface-elevatedPopover / dropdown surface
--rte-toolbar-bgToolbar background
--rte-toolbar-fgToolbar foreground
--rte-toolbar-separatorVertical separator color
--rte-btn-fgToolbar button text
--rte-btn-hover-bgToolbar button hover
--rte-btn-active-bgToolbar button active
--rte-btn-active-fgToolbar button active text
--rte-accentPrimary accent (links, focus rings)
--rte-accent-hoverAccent on hover
--rte-accent-fgForeground on accent surfaces
--rte-input-bgInput fields in popovers
--rte-input-fgInput text
--rte-input-borderInput border
--rte-input-focusInput focus ring
--rte-dropdown-bgDropdown background
--rte-dropdown-borderDropdown border
--rte-dropdown-shadowDropdown shadow
--rte-code-bg<code> / <pre> background
--rte-code-fg<code> / <pre> text
--rte-quote-borderBlockquote left border
--rte-quote-fgBlockquote text
--rte-table-borderTable border
--rte-table-header-bgTable header background
--rte-image-outlineImage hover outline
--rte-radiusCorner radius (default)
--rte-radius-smSmall corner radius
--rte-radius-mdMedium corner radius
--rte-font-familyBody font family
--rte-font-monoMonospace font family
--rte-min-heightEditor surface min height
--rte-toolbar-gapToolbar gap
--rte-toolbar-paddingToolbar padding