Colour

color-mix()

Widely availablesince Nov 2025

Replaces: A Sass function, or a hand-picked hex for every hover state. Two colours are mixed in the browser, in the colour space you choose.

See it working

The syntax

.btn:hover {
  background: color-mix(in oklch, var(--brand), black 15%);
}
Edit the demo’s CSS

This is the stylesheet running the demo above. Change a value and watch it. Break it on purpose: delete the modern line and you are looking at the fallback.

For browsers without it

A browser without it ignores the hover declaration and the button keeps its resting colour, so the fallback is already written.