StealThis .dev

color-mix() Theme Generator

Pick one base hue and watch an entire dark-UI palette derive itself live from CSS color-mix() in oklch — tints, shades, hover, active and border tokens — previewed on a real sample interface with copy-ready CSS and a relative-color-syntax variant.

Open in Lab
css vanilla-js
Targets: JS HTML

Code

A live theming playground built almost entirely in CSS. You choose a single base color, and every other palette token — subtle surface tints, deep shades, hover and active states, borders and focus rings — is computed on the fly with color-mix() interpolated in the oklch color space. Because the mixing happens in CSS from one custom property, the whole sample UI (buttons, cards, badges, an input, a progress bar) re-themes instantly the moment the base hue changes, with no per-token JavaScript math.

Interact by dragging the native color picker, nudging the hue with the wheel or arrow keys, tweaking the tint/shade intensity slider, or clicking a preset swatch. A toggle flips the whole engine between color-mix() and the newer relative color syntax (oklch(from …)), and the generated CSS panel updates so you can copy the exact tokens into your own stylesheet.

The demo showcases the CSS color-mix() function and relative color syntax in oklch, plus @supports feature detection that gracefully falls back to srgb mixing when a browser lacks oklch interpolation.