OKLCH
OKLCH writes a colour as three numbers in the Oklab colour space: perceived lightness L from 0 to 1, chroma C for how colourful it is, and hue H as an angle. It comes from CSS Color Module Level 4 and works in every current browser. Because L follows how light a colour looks, Meadowstack generates its whole palette in OKLCH and measures contrast from the same numbers.
By Bohuslav PoláčekChecked
:root {
--frame: oklch(0.975 0 0);
--canvas: oklch(0.983 0 0);
--surface: oklch(1 0 0);
--surface-subtle: oklch(0.985 0 0);
--surface-hover: oklch(0.97 0 0);
--surface-active: oklch(0.94 0 0);
--surface-inverse: oklch(0.22 0 0);
--surface-raised: oklch(1 0 0);
--fg: oklch(0.235 0 0);
--fg-muted: oklch(0.44 0 0);
--fg-subtle: oklch(0.52 0 0);
--fg-disabled: oklch(0.72 0 0);
--fg-inverse: oklch(0.985 0 0);
--border: oklch(0.91 0 0);
--border-strong: oklch(0.86 0 0);
--border-control: oklch(0.65 0 0);
--border-hover: oklch(0.585 0 0);
--primary: oklch(0.235 0 0);
--primary-hover: oklch(0.32 0 0);
--primary-fg: oklch(0.99 0 0);
--ring: oklch(0.4 0 0);Why it matters in a business app
A business app is mostly greys: the page, a card, the hovered row of a table, the selected row, three levels of text. In OKLCH those steps are a single number. The kit's page is oklch(1 0 0), a hovered row 0.97, a selected one 0.94, muted text 0.45: you can read the hierarchy off the file.
Status colours gain the most. A warning and an info chip at the same L look equally light, so neither shouts louder than the other because of its hue. With HSL the same lightness value gives a bright yellow and a dark blue, and every pair is tuned by eye.
How Meadowstack handles it
- Two inputs.
packages/kit/src/tokens/inputs.tssets the page colour per theme (oklch(1 0 0)light,oklch(0.155 0 0)dark) and one contrast value.palette.tsderives every neutral as an offset from the page. - Chroma 0. The house look is pure grey (decision 0012,
docs/decisions/0012-greyscale.md): a client theme can tint the neutrals by giving the page a hue and some chroma. - One maths.
oklch.tsconverts OKLCH to sRGB with Björn Ottosson's matrices to measure WCAG contrast, the same code path asscripts/check-contrast.mjs, so the generator and the guard cannot disagree. - Never by hand.
npm run tokenswritespalette.css;npm run check:tokensfails when a component writesoklch(), hex, rgb or hsl itself.
Common mistakes
- Reading the hue like HSL. Hue angles differ between the spaces: 0deg is red in
hsl()and magenta inoklch(). - Pushing chroma too far. Not every OKLCH value fits in sRGB. The kit's converter clamps each channel to the screen's range, so a token that asks for more colour than the screen has quietly loses it.
- Writing literals in components. A colour typed into a class or a style skips the dark theme and every client theme. Use the semantic tokens.
Sources
Questions
Do browsers support OKLCH?
Yes. MDN lists oklch() as Baseline, widely available across browsers since May 2023.
What does a chroma of 0 mean?
No colour at all: the value is a grey whose lightness is L. The kit's neutrals are written this way, so the page, the surfaces and the text differ only in lightness.
Is OKLCH the same as LCH?
No. Both are lightness, chroma and hue, but OKLCH is built on Oklab and LCH on CIELAB, so the same numbers give different colours and the hue angles do not match.
Can I bring my brand colour into Meadowstack's palette?
Yes, through a client theme: it overrides the tokens for light and dark, and the contrast guard can check the theme file before it ships.
Two ways
Build it yourself, or have it built
Build it yourself
Build your app on the framework
Get the codebase these apps stand on and build yours with Claude Code, Cursor or Codex.
One payment, lifetime updates
Get the frameworkHave it built
Have us build your app
Tell us how your team works. We plan the app with you and build it on the same framework at a fixed price.
After launch, Care keeps it improving, from €99 a month.
from €1,990
Describe your app