Skip to content

OKLCH Theming

OKLCH is a perceptually uniform color space with three channels:

  • L — lightness (0% black, 100% white)
  • C — chroma / saturation (0 = gray, ~0.25 = vivid)
  • H — hue angle in degrees (0° red, 120° green, 240° blue, 270° indigo)

Browser support: All modern browsers (Chrome 111+, Firefox 113+, Safari 15.4+).

--color-primary: oklch(55% 0.22 270);
/* ↑ ↑ ↑
L C H
lightness chroma hue (indigo)
*/

The semantic state roles each live at a fixed hue angle, chosen for perceptual distinctness regardless of the project’s brand hue:

--color-danger
--color-warning
--color-info
--color-success
RolePerception
--color-danger27°Red-orange — error, destructive
--color-warning80°Amber — caution
--color-info240°Blue — neutral information
--color-success155°Green — positive outcome

The brand roles adapt to any seed hue. The defaults shown here use indigo (270°):

--color-primary
--color-primary-hover
--color-accent
--color-focus-ring
TokenValue
--color-primary
--color-primary-hover
--color-accent
--color-focus-ring

Chrome and Firefox DevTools display OKLCH values in the color picker. Click the color swatch next to an oklch() value to open the picker and adjust L, C, H interactively.

To see how your theme colors map visually, inspect <html> in DevTools → Computed → filter by --color-.