Making "this color, but 20% brighter" used to require knowing whether the source was hex, hsl, or rgb — awkward in a component library that doesn't control what format a design token arrives in. Parsing, transforming, and reassembling with a JS color library was the usual detour.
Relative color syntax pulls in an existing color with `from` and exposes its channels as variables — `hsl(from var(--accent) h s calc(l + 20))` reads hue, saturation, and lightness directly. `color(from var(--accent) srgb r g b / 0.4)` can change just the alpha channel. Either way, a derived color comes straight out of CSS regardless of the source format.
Check caniuse/MDN baseline for support. Without it, parsing the source color in JS, adjusting a channel, and reassembling the string is the fallback.
When to use
Deriving a lighter, more saturated, or more transparent variant of a token color without knowing its format.