Can CSS color variables depend on each other? Help me fight off CSS preprocessors.

itsarnavb

Arnav Bansal

Posted on November 23, 2018

Can CSS color variables depend on each other? Help me fight off CSS preprocessors.

Here, --dark-highlight is a brighter version of --dark. Is there a way I can set --dark-highlight to be dependent on --dark, where it automatically uses the same hue, saturation, and alpha values, but increases the lightness by 5%

:root {
  --dark: hsla(209, 28%, 6%, 1);
  --dark-highlight: hsla(209, 28%, 11%, 1);
}

Also, what's a good guide to the new CSS features?

💖 💪 🙅 🚩
itsarnavb
Arnav Bansal

Posted on November 23, 2018

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related