4 ms·
I checked the lanyrd.com stylesheet. I'm sorry to say but if your stylesheet is this big you are doing it wrong. 100K for a compressed stylesheet! So I'm not so
by tintin 16y ago
I checked the lanyrd.com stylesheet. I'm sorry to say but if your stylesheet is this big you are doing it wrong. 100K for a compressed stylesheet! So I'm not so sure her technique is a winner.
- Pewpewarrows 16y agoOh really? Because every medium-to-large website I've ever looked at or developed has had a stylesheet that large. Facebook? Twitter? GitHub? 100k+ compressed stylesheets. Hell, even if your site is small-to-medium sized but very design-intensive, I could see you reaching that mark. Don't worry, I'm sure all those developers are "doing it wrong" too.
- tintin 16y agoWell did you check the stylesheet of Twitter for instance? Only 40K but even then.. why even that big for a simple Twitter homepage!? So I'm sorry you did not convince me. And maybe, I know it's a bold statement, they are doing it wrong. I think it also has to do with frameworks. Sometimes frameworks spit out a lot of HTML you won't ever need. So the HTML is bloated in the first place. Then it's a hell of a job to style the mess. When you are fortunate to control the HTML you should first start to optimize your HTML before you even start with CSS.
- simonw 16y agoLanyrd is a complex site - we have over 50 different page templates, all of which are styled using that one stylesheet. We get a lot of functionality out of that 100K. Not to mention that CSS compresses extremely well - served with gzip, the entire stylesheet is actually just 19745 bytes. We use a far-future expires header (and serve from Amazon CloudFront), so browsers should only ever fetch the file once no matter how many pages on the site the user visits.