Optimizing CSS - the Good and the Bad

So we all know optimization is a good thing. Whether it’s optimizing your images for the smallest file size or creating your html so that it renders correctly and cleanly - optimization is good.

But what about optimizing your CSS? There have been a few sites popping up lately that offer these services for you. Upload your CSS file and it strips out all the white space, line breaks, combines repeated elements and much more.

I personally have never worked on a site where the CSS got out of hand but I know a few developers who have created some extensive CSS for their sites and they would be the ones that this service would be optimal for.

In the grand scheme of things the optimization of a small CSS file for a standard site won’t make that much of a difference (unless it’s a high traffic site, then the bandwidth savings might be in your best interest).

The downside? Once your CSS is optimized it’s practically illegible so make sure you keep a backup for making changes in the future. I suggest that optimizing your CSS be the last step once you have everything else working and displaying correctly in your site.

For the beginners out there, it’s absolutely crucial that your CSS validates before you compress it because if it doesn’t some pretty unexpected results can occur.

Here’s the CSS optimizer I recommend - Icey - it creates the smallest file size out of any of them and usually has the fewest mistakes after compression.

Happy Compressing!

Leave a Reply


Close
E-mail It