use from syntax to generate a new color from an existing color #

Last updated March 11, 2026
css

Use the from syntax to generate a new color from an existing color.

button {
    --red: #ff0000;
    /* keep hue and saturation, multiply l times 1.5 */
    --light-red: hsl(from var(--red) h s calc(l*1.5));
}