Skip to content

Migrate Stratos color tokens from RGB/hex to OKLCH (Tailwind v4) #5515

Description

@nabramovitz

Summary

Move the Stratos color token values from RGB/hex to OKLCH. Tailwind v4 (^4.3.1, already in use) defines its default palette in OKLCH, so this aligns Stratos with Tailwind's own direction rather than fighting it.

Why

  • Perceptually-uniform light/dark math. Dark mode done right is perceptual lightness inversion, not per-channel RGB inversion (255-r produces garish results). In OKLCH that's simply L → 1−L (keep chroma/hue), plus optional C×0.5 and a small hue shift for an atmospheric dark palette. This makes paired light/dark token generation a known, small transform.
  • Consistency with Tailwind v4, whose palette is already OKLCH.
  • Unblocks the stb theming tool's OKLCH picker, which currently ships its oklch format option disabled ("oklch (planned)") because there was no rgb→oklch conversion on the token path.

Scope

Notes

  • hex→OKLCH→hex is mildly lossy at gamut edges — acceptable here (we're standardizing token values, and generating dark variants, not pixel-preserving a single color).
  • Light/dark derivation math reference: standard OKLCH invertLightness(l,c,h) = {l: 1−l, c, h} + chroma/hue adjustment.

Related: #5494 (semantic theme tokens), FWT-866/FWT-868 (token classes / dark-mode templates), theming/branding (stb) workstream.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions