Your own brand and themes
An accent, the kit's brand and your own brand in one CSS block — the Editor and the Paper recolor without touching components.
The Editor's colors are kit tokens. Theme, accent and brand are attributes on <html>, so a
product recolors everything at once without touching a single component.
Try it
Switch the variants — this whole site recolors along with the Editor: it sits on kit tokens too. The light and dark themes switch with the button at the bottom of the left menu.
How it works
Three axes on <html>
data-theme (dark, light, dim), data-accent (blue, violet) and data-brand. A brand
cancels the accent axis entirely.
A brand is one CSS block
Declare your own primitives --od-acme-* and assign them to roles (--accent, --accent-soft,
--focus-ring, --selection). Don't override the kit's --od-* primitives.
The light theme gets its own block
--accent-strong is read on a surface, and in the light theme it needs a dark step, while
--accent-on-inverse needs the opposite, a light one.
Brand blocks come after the kit's styles
:root[data-brand] and :root[data-accent] have the same specificity, so the lower one wins.
The Paper (paper)
The Paper (surface="paper") stays light in any theme, and the accent on it is the app theme's fill: it keeps
the contrast on white for any brand.
A brand that fails the contrast check is a brand that doesn't exist. In the kit it's
npm run contrast; check your colors the same way before shipping.