Theming
A theme is a named set of role colors you select with data-theme. Components keep using the same token classes while the active theme changes the values underneath; light and dark are a separate scheme axis.
How themes work
A theme gives each semantic role — primary, secondary, accent, surface, danger, success — a color or anchors.
Switching data-theme swaps the whole role set. Component and utility classes never change.
Light and dark are a separate axis controlled by scheme-* classes, so one theme serves both.
Semantic roles
Primary actions, selected states, and the main brand direction.
--theme-primarySupporting actions and secondary moments that still need color.
--theme-secondaryHighlights, emphasis, and moments that should stand apart.
--theme-accentPage backgrounds, containers, borders, and neutral text.
--theme-surfacePositive outcomes, confirmations, and valid states.
--theme-successDestructive actions, errors, and blocking states.
--theme-dangerUnavailable controls, subdued text, and inactive surfaces.
--theme-disabledTheme identity
:root[data-theme="citrine-reef"] {
--theme-primary: #087f8c;
--theme-secondary: #f59e0b;
--theme-accent: #ef476f;
--theme-surface-50: #f4fbf7;
--theme-surface-500: #678f82;
--theme-surface-950: #071c18;
--theme-danger: #c2415d;
--theme-success: #26966f;
}Classes like btn-solid/primary and card-soft/surface stay the same when the selected theme changes.
Anchoring role colors
:root[data-theme="custom"] {
/* A single color per role is enough… */
--theme-primary: #087f8c;
/* …or pin any shade 50-950 for a role, using the
same anchor model palettes use. */
--theme-primary-300: #4aa3c7;
--theme-surface-50: #f4fbf7;
--theme-surface-500: #678f82;
--theme-surface-950: #071c18;
}Light and dark
<html class="scheme-light-dark" data-theme="citrine-reef">
<body>
<button class="btn-solid/primary">
Create project
</button>
</body>
</html>
Always resolves adaptive tokens to the light color ramp.
Always resolves adaptive tokens to the dark color ramp.
Lets the browser resolve light-dark tokens from the user's color scheme.