Color
Two seeds produce every colour in the system. Each generates an eleven-step ramp, and every token is a step of that ramp — so changing a seed recolours the whole theme without touching anything else.
The ramps
These follow the theme and appearance pickers in the header. Hover a swatch to see which tokens land on that step.
Color scales
Base
Primary
How a ramp is built
A ramp is eleven color-mix() expressions over one seed variable, evaluated by the browser at paint time. Steps lighter than the seed mix it toward white, darker ones toward black, and the seed itself appears unchanged at its own step.
--mtx-primary-400: color-mix(in oklab, var(--seed) 76%, #ffffff);
--mtx-primary-500: var(--seed);
--mtx-primary-600: color-mix(in oklab, var(--seed) 88%, #000000);Mixing happens in OKLab, never OKLCH. OKLCH interpolates the hue channel, so an anchor with any chroma at all drags the seed’s hue toward its own — a lime seed mixed into zinc-950 lands on teal. OKLab scales the a/b pair instead, preserving hue exactly.
Where the seed sits
A ramp only spreads evenly if the seed is mid-toned. Anchoring a near-black seed at step 500 would leave everything below it bunched into near-identical shades — half the scale wasted. So the seed anchors at the end it already occupies.
| Seed | Anchors at | Ramp runs |
|---|---|---|
| Mid-tone | 500 | Both ways from the seed |
| Near-black (L < 0.3) | 950 | Lightens away from the seed |
| Near-white (L > 0.9, low chroma) | 50 | Darkens away from the seed |
Chroma gates the light end deliberately. A vivid yellow sits around L 0.90 but is nowhere near neutral, so it stays mid-toned rather than being treated as an off-white.
Which step each token uses
The colour you pick is the brand value. The button is the step next to it, which is both deeper and more reliable to put text on. Interactive states continue along the ramp.
| Token | Light | Dark | Painted by |
|---|---|---|---|
primary | 600 | 400 | Solid button and badge fill, checked control, focus ring |
primaryHover | 700 | 300 | Solid button on hover |
primaryActive | 800 | 200 | Solid button while pressed |
In dark appearance the button sits lighter than the seed rather than darker, because that is the direction with room against a dark page. A seed anchored at an end uses the ramp’s extremes instead — 950 in light and 50 in dark — which is how a near-black primary keeps a near-black button in light and a near-white one in dark off a single ramp.
The on-colour
onPrimary is the text that sits on the fill. It is derived too, so a seed override cannot leave pale text on a pale fill. The browser reads the fill’s own lightness and collapses to near-white or near-black around it.
oklch(from var(--fill) calc(0.145 + clamp(0, (0.58 - l) * infinity, 1) * 0.84) 0 h)The clamp resolves to exactly 1 or 0, and the calc maps that onto zinc-50 or zinc-950 — the values the palette was designed around, since pure white on a dark fill glares. The threshold is 0.58 rather than the more obvious 0.65: measured across 60 Tailwind seeds, 0.65 hands 13 of them the worse of the two text colours and 0.58 only 3.
Using the ramp yourself
Every step ships as a custom property, so app code can reach the primary at a specific tint. No component reads these — they exist as an escape hatch.
.callout {
background: var(--mtx-primary-50);
border-left: 3px solid var(--mtx-primary-500);
color: var(--mtx-primary-900);
}To recolour a theme, override the seed rather than the derived tokens — see Theming. Derived colours need color-mix() and relative colour syntax: Chrome 119, Safari 16.4, Firefox 128 and up.