3 ms·
Descartes is just over 30KB when minified and just over 300 lines of code. For comparison, there's 12KB of text on the page. There's something about writing 3
by userbinator 11y ago
Descartes is just over 30KB when minified and just over 300 lines of code.
For comparison, there's 12KB of text on the page.
There's something about writing 30KB+ of code, plus chunk of CSS-in-JS-syntax, and then using the energy of every single visitor's machines to duplicate the work at a massive scale to generate another chunk of CSS that the browser then has to parse, after executing that JS, which you could've just generated once on the server, that feels fundamentally wrong. IMHO this flagrant disregard for resource consumption is one of the reasons why the "Modern Web(tm)" is as unpleasant as it is.
- JoeAltmaier 11y agoIts called 'scaling'. There are 1B personal devices and only 1 server. So anything that unloads the server is a good thing?
- userbinator 11y agoHow about just serving the CSS directly? It could even be generated from JS with a tool like this one. Now you don't even have to serve the JS that generates it.
- err4nt 11y agoIt would seem that Descartes allows you to change the values of the CSS _after_ page load, which no amount of precompiling can do! This is what plugins like Descartes are trying to solve - how do we inform CSS of values on the page which may be different between different browsers or users, or may change on the page after it loads as users interact with it. http://elementqueries.com/demos/variables.html http://elementqueries.com/demos/variables.html Here's an example using EQCSS of accessing JavaScript Variables from CSS - I'd ~LOVE~ to see what CSS you could prepare and send in advance that would produce the same thing. It can't be done :)
- herbst 11y agoThats not was CSS is supposed to do. I am happy its not possible, else even more people would exploit it.
- Tobold 11y agoHow is delivering 30kb javascript file instead of 1kb CSS file reducing load? CSS is static, just put it in a static file! Bam! Load reduced!
- na85 11y agoThis is why I give thanks for noscript. The web is so much more pleasant without.