Core Tokens
Tokens are the CSS custom properties Natcore provides. Components and utilities read them, themes set their values, and palettes expand them into full shade ramps.
Anatomy of a token
The semantic slot a token belongs to: primary, surface, danger, success, and the rest of the theme's roles.
A step on the 50-950 scale. Lower numbers are softer, higher numbers carry stronger contrast.
Each base token (--color-{role}-{shade}) is paired with a readable foreground token (--color-on-{role}-{shade}).
Color token families
--color-{role}-{shade}The adaptive base color for a role and shade. Resolves to the light or dark value for the active scheme via light-dark().
--color-on-{role}-{shade}A readable foreground paired with the matching base token, generated for contrast against it.
--color-{shade}A current-tone alias that resolves to whatever palette is active on the element, so the same markup re-tones with the palette.
--color-on-{shade}The current-tone foreground alias, pairing with --color-{shade} against the active palette.
--color-light-{role}-{shade}The explicit light-scheme side of a base token, useful when you need to pin the light value regardless of scheme.
--color-dark-{role}-{shade}The explicit dark-scheme side of a base token, the counterpart to the light family.
/* Adaptive base + readable foreground, per role and shade */
--color-primary-500; /* light-dark() base color */
--color-on-primary-500; /* contrast foreground for that base */
/* The current-tone aliases resolve to the active palette */
--color-500; /* = --color-{active}-500 */
--color-on-500; /* = --color-on-{active}-500 */
/* Explicit scheme sides, when you need to pin light or dark */
--color-light-primary-500;
--color-dark-primary-500;Theme override tokens
:root[data-theme="citrine-reef"] {
/* Seed a role with one color… */
--theme-primary: #087f8c;
/* …or pin any shade 50-950 */
--theme-surface-50: #f4fbf7;
--theme-surface-500: #678f82;
--theme-surface-950: #071c18;
}