Defining Custom At-Rules in CSS (extending CSS with JavaScript)
Channel: innovati
Date: 2018-07-31

In this video I'll show you one way you can write 100% valid CSS that contains custom at-rules you can read and work with using JavaScript.

Don't worry about the new Function() in the demo, this is a client-side demo to illustrate how the technique can work, ideally you would preprocess the CSS stylesheet containing a JS-powered rule serverside and extract the JS-powered rules from the stylesheet, then output CSS and JS with clean functions