10 ms·
What's with all these CSS frameworks which serve one css file for everybody? Toolkits like GWT have had the sense to serve only what each environment needs, sin
by EGreg 13y ago
What's with all these CSS frameworks which serve one css file for everybody? Toolkits like GWT have had the sense to serve only what each environment needs, since 2004. If you are worried about mobile devices being able to handle things, how about NOT downloading things that they don't need?
Your CSS framework should include a precompiler that generates files for each platform. Then either the client or the server can decide the right file(s) to load.
- deleted 13y ago[deleted]
- cheald 13y agoLetting the server pick means you're serving the user agent, rather than the device capabilities. Letting the client pick means perceptual performance degradation, as the client has to synchronously download and run Javascript before it can figure out what to request from the server (that is, the render/layout thread can't be chewing on the CSS while your Javascript is doing its thing). Given how well text compresses and the cost of a HTTP connection, I'm not sure that separating things out is going to get you much of a win. The comparison to GWT is hilarious, since GWT is a massive mess of dependency hell that ends up requiring an insane amount of support code for any particular small feature.
- modarts 13y agoThe GWT thing threw me off as well. How maintaining a separate stylesheet per user agent could possibly be seen as an optimal approach is beyond me.
- EGreg 13y agoIf you have an iPhone, would you rather have a stylesheet that has everything and the kitchen sink in it (for tablets and desktop environments, all the -firefox- stuff and IE hacks) or would you rather have a stylesheet just for the iPhone? Similarly, would you serve the full jQuery to an iPhone or would you serve the new jQuery without IE dependency which is much lighter? Heck, you might even be able to serve Zepto!