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.
Color
Brand
The Cardano blue and its ramp live on Infima's primary variables. The ramp is a proper mono-hue ladder: darker variants for hover and active states, lighter variants for soft fills.
| Token | Light | Use |
|---|---|---|
--ifm-color-primary | #0033AD | Brand blue, default |
--ifm-color-primary-dark | #002a8e | Hover on filled buttons/links |
--ifm-color-primary-darker | #00257d | Active / pressed |
--ifm-color-primary-darkest | #001f68 | Strongest accent |
--ifm-color-primary-light … -lightest | #0038be … #0042e1 | Lighter accents |
For rgba() use the RGB triple: rgba(var(--ifm-color-primary-rgb), 0.5).
In dark mode the whole ramp shifts to a lighter blue automatically; you do not need to handle it per component.
Semantic status
One canonical value each, with dark-mode variants already defined:
| Token | Light | Meaning |
|---|---|---|
--site-success | #2da06a | Success, positive |
--site-warning | #d97706 | Warning, caution |
--site-danger | #dc3545 | Error, destructive |
--site-info | brand blue | Informational |
Brand tints
Translucent primary, for soft fills and hover backgrounds (prefer these over a hardcoded rgba(0,51,173,…)):
--site-tint-weak:rgba(var(--ifm-color-primary-rgb), 0.06)--site-tint-strong:rgba(var(--ifm-color-primary-rgb), 0.12)
Quiz result tiers
Badge colors for the bronze/silver/gold results on the quiz hub. Both theme values are listed here, unlike the semantic status tokens above, because --site-tier-ink is deliberately not inverted: the tier fills stay light in both themes, so the text and icon color sitting on top of them stays the same dark value in light and dark mode instead of flipping with the rest of the palette.
| Token | Light | Dark | Use |
|---|---|---|---|
--site-tier-gold | #c9a227 | #d9b345 | Gold tier badge fill, perfect score |
--site-tier-silver | #8e9aab | #a3aebf | Silver tier badge fill |
--site-tier-bronze | #c98b5e | #c98b5e | Bronze tier badge fill |
--site-tier-ink | #1b2333 | #1b2333 | Text and icon color on top of the tier fills, fixed across themes on purpose |