DEV Community

Cover image for How using CSS variables helped me cut down on JavaScript

How using CSS variables helped me cut down on JavaScript

Ben Holmes on May 31, 2019

Note: My post is inspired by this article from the brilliant Chris Coyier about the power of CSS calc(). Definitely worth a read! If you’ve been k...
Collapse
 
bbarbour profile image
Brian Barbour

I just used these for my portfolio. Love em. But, I don't think IE11 has them. I think that's why SASS is still so widely used. That and nesting.

Collapse
 
jnschrag profile image
Jacque Schrag

Late, but I wanted to share that there is a ponyfill for CSS variables that allow them to work in older browsers, with a few caveats. They serve a different function than SASS variables do, so it's definitely worth looking at the ponyfill if you'd like to start using CSS variables & need to support older browsers.

Collapse
 
bbarbour profile image
Brian Barbour

Thanks Jacque!

Collapse
 
nuxodin profile image
Tobias Buschor

Or this (my) polyfill which gives IE11 almost complete support for CSS variables:
github.com/nuxodin/ie11CustomPrope...