color-mix()

The CSS function that blends two colours in a chosen colour space, often used to make a semi-transparent version of a theme colour.

In more detail

color-mix(in oklab, var(--color-brand) 50%, transparent) gives the brand colour at half opacity while still following theme changes. Tailwind version 4 uses it for opacity modifiers such as bg-brand/50, instead of needing a separate hex value with alpha.

Related terms

Taught in

References