DEV Community


Discussion on: CSS Variables Cheat Sheet

horus_sky profile image
Cedric W

This is a great to-the-point post. My only problem with CSS variables (custom properties) is the fallback (specifically for IE 11 usage). If you have to apply a second parameter, it defeats the purpose of the variable itself. For instance, if you ever have to update the value of the variable, you have to update every instance of the var function throughout your code -- its not so automagic. Yes, you can find and replace, but still a hassle if your are updating more than one css variable. This is the only reason I'm sticking with sass vars. I wish there was a way to add a fallback in the declaration rather than the var function. I know it sounds silly since the value is basically there, but declaring the value within the function seems just as silly.

proticm profile image
Milos Protic Author

Thank you. I agree with the point you made here. Definitely it has more sense to define the fallback value next to the variable itself. It is easier to maintain as you pointed out.

nuxodin profile image
Tobias Buschor

You can try this polyfill, it just works:

Forem Open with the Forem app