DEV Community

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

Collapse
 
rhymes profile image
rhymes

No, as far as I know CSS variables are meant to store simple values, not functions.

You need mixins for something that advanced: sass-lang.com/documentation/file.S...

SASS/SCSS mixins can have arguments with default values, and you can easily accomplish what you're asking.

You need the SCSS preprocessor though.