Defining Custom At-Rules in CSS (extending CSS with JavaScript)

preview_player
Показать описание
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
Рекомендации по теме
Комментарии
Автор

really cool stuff, i wonder how could i use this to use as a fix for vh in mobile browsers that create and goes away extra bars on scroll screwing the layout sections set in 100vh

diegognoatto
visit shbcf.ru