CSS Variables: Access Custom Properties with JavaScript
The recent release of Firefox 31 brought an implementation of CSS Variables. Based on that, Daniel Imms wrote an interesting post, What CSS Variables Can Do That Preprocessors Can’t, where he investigates a few use cases for native variables over those provided by pre-processors like Sass and LESS (there’s a common argument that CSS variables are unnecesary as we already have them, and more flexibly, in pre-processors).
In this article I’m going to expand on Daniel’s article a little, showing an advantage of CSS Variables that he doesn’t talk about in detail: interacting with them using JavaScript.