Design Tokens
Design tokens are the shared styling vocabulary for cardano.org. When you write CSS, reach for a token instead of a raw value. This keeps spacing, color, and motion consistent across pages built by different contributors, and it means a change to the palette or scale happens in one place.
All tokens are CSS custom properties defined in src/css/custom.css. They are global, so any *.module.css file can use them without an import.
yarn test:css fails the build if a --site-* or other project variable is used without being defined. Do not invent new hardcoded hex colors or one-off spacing values; use or extend the tokens below.
How tokens are organized
Two namespaces, by design:
--ifm-*are Infima (Docusaurus) variables. Use these for anything the framework already owns: the brand color and its ramp, neutral greys, and surfaces. Docusaurus's own components (navbar, buttons, admonitions) read them too.--site-*are this project's own tokens for everything Infima does not provide: semantic status colors, spacing, radius, elevation, motion, and focus.
Neutrals have no --site-* tokens on purpose. Use Infima's theme-aware emphasis scale rather than a second grey palette:
| Use | Token |
|---|---|
| Body text | var(--ifm-font-color-base) |
| Strong text | var(--ifm-color-emphasis-900) |
| Muted / secondary text | var(--ifm-color-emphasis-600) |
| Borders, dividers | var(--ifm-color-emphasis-200) / -300 |
| Card / panel background | var(--ifm-background-surface-color) |
| Page background | var(--ifm-background-color) |
These already invert correctly in dark mode, which is why you should not reach for a hardcoded grey.