Theming and brand colors
One brand color, button tokens, and recipes for shadcn/ui and your own dashboard.
On this page
Set one color and the whole editor follows it, in light and dark: pressed toolbar buttons, dialog buttons, links, the focus ring, the caret, the text selection and the gradient edge of the card. Try it with the brand color in the playground on the home page.
One color
ui.brand takes any CSS color and picks black or white for the text on brand buttons by contrast. The brand attribute does the same on <owe-editor>. In plain CSS, set --owe-brand (and --owe-on-brand if white does not read well) on .owe, on a wrapper or on :root.
Derived tokens
Everything else comes from the brand with color-mix(). Set any of these yourself and yours wins.
| Token | Derived as |
|---|---|
--owe-primary | The brand. Pressed toolbar buttons and primary dialog buttons. |
--owe-primary-hover | The primary color mixed 15% toward black. |
--owe-accent | Link and text color: the brand mixed 30% toward black in light, 40% toward white in dark. |
--owe-focus, --owe-caret | The accent color. |
--owe-selection | The brand at 22% opacity in light, 45% in dark. |
--owe-gradient | From --owe-brand to --owe-brand-2. ui.brand sets a lighter tint as the second color. |
Button tokens
These restyle the buttons, the toolbar and the card without touching a selector. Set them on .owe or on any element around it, such as your dashboard wrapper. Unset, they use the default shown.
| Token | Default | Styles |
|---|---|---|
--owe-btn-color | --owe-icon | Toolbar button icon and text. |
--owe-btn-bg | transparent | Toolbar button background. |
--owe-btn-hover-color, --owe-btn-hover-bg | --owe-text, --owe-surface-2 | Button on hover. |
--owe-btn-active-color, --owe-btn-active-bg | --owe-on-accent, --owe-primary | A pressed or toggled button. |
--owe-btn-primary-bg, --owe-btn-primary-color | --owe-primary, --owe-on-accent | The primary button in dialogs (Insert, Apply). |
--owe-btn-radius | --owe-radius-sm | Corners of buttons and menu items. |
--owe-toolbar-bg, --owe-toolbar-border | --owe-chrome, --owe-border-subtle | Toolbar, find bar and status bar. |
--owe-editor-border, --owe-editor-radius | --owe-border-subtle, --owe-radius | Border and corners of the card. |
A dark toolbar over a light editing area, with smaller corners:
Match your dashboard
Point the tokens at the variables your design system already defines, for example shadcn/ui as below. The editor never declares a token itself, so yours wins wherever you set it, and the tokens read your variables when they are used, so the editor follows your light and dark themes without a script. Also set theme to dark when your dashboard is dark, so links, selection and native controls match.
Changing the theme later
<owe-editor> follows changes to its theme and brand attributes. For createEditor(), call setTheme() on its UI. It replaces the whole theme, so pass everything you want to keep. The playground on the home page does exactly this.
Check the contrast
--owe-accent keeps 4.5:1 on white for typical brands, but a very pale brand needs an explicit --owe-accent, and pressed buttons need 3:1 against the toolbar.