DEV Community

Discussion on: What are CSS variables?

Collapse
 
gsarig profile image
Giorgos Sarigiannidis • Edited

CSS Variables are absolutely great and much better than the variables functionality of preprocessors like SASS!

That's because a great benefit of CSS variables is that they can be manipulated from JavaScript.
Also, they make the responsive design much easier, as changing the variable on a breakpoint is enough to apply the color change, instead of changing all the instances where it is being used.

As an example, here's a pen I've made some time ago, using those two features: codepen.io/gsarig/pen/xxVzzmY

Collapse
 
nazanin_ashrafi profile image
Nazanin Ashrafi

Thank you for extra info + sharing pen 🙏🌹