Re:JSON stylesheets - screw CSS frameworks, use JavaScript -...
by IgorPartola on Monday December 21, 2009 @07:49PM
(#1009058)
1,000,000 CSS classes? What web project possibly uses that many right now? Do you have a real use case in mind? Why not let the browser store and parse the CSS? That's what it is designed to do. And when the browser stores a CSS rule, it can optimise it much more than it can optimise a generic JavaScript literal.
IMHO, this is educational, but useless. CSS already does the job better and by separating your CSS files you could squeeze all the performance you need.
Of course if you can demonstrate how this could possibly be fast on modern browsers on a page with 1,000,000 CSS classes I would be very impressed.
Last: note on terminology. What you are calling JSON is actually just a JavaScript object. Try running it through JSONLint and you'll see that you need to add extra quotes around the "keys", for example.
IMHO, this is educational, but useless. CSS already does the job better and by separating your CSS files you could squeeze all the performance you need.
Of course if you can demonstrate how this could possibly be fast on modern browsers on a page with 1,000,000 CSS classes I would be very impressed.
Last: note on terminology. What you are calling JSON is actually just a JavaScript object. Try running it through JSONLint and you'll see that you need to add extra quotes around the "keys", for example.