1 karma · joined Jan 9, 2014 (12y ago) · 1 submissions
comment 10y ago · link · parent
That said, the main advantage for writing CSS in JS is being able to rewrite styles in runtime, where changing values in Javascript automatically reflects in style changes. The most direct way to do this today is setting variables as data-attributes in a DOM node and targeting specific true/false values for that attribute in your stylesheet.
Native CSS Variables will make life much easier in this respect, but it will still take a couple of years before all major browsers implement it.