Quick and Easy Tools For Optimizing Your CSS

May 18th, 07 | 2 remarks

If you read my article on tips for optimizing your stylesheets, you may already be putting some of those things into practice. Here then, are a few nifty (and free) web tools to help you out a bit more.

  • CSS Tweak - lets you check parameters for how much optimizing you want done. It has an upload or copy/paste feature, and it’s beautifully simple. Once optimized, you can either download the tweaked CSS, or copy/paste the new code from the box. I’m really picky about how my CSS is laid out with respect to spacing, but even without touching the line breaks, it optimizes nicely. I was able to see a difference of 13%. Removing the breaks it jumped to 23%.
  • CSS Optimizer - does exactly what it says, and very well. You can optimize by URI, direct input or upload, but you have only one option - to keep line breaks or not. The output shows you before and after optimization amounts in KB and percentage. I was able to optimize by 14.61%, keeping my spacing intact. If I removed the line breaks it was 26.41%!

Keep in mind if you opt to have spacing removed by either of these tools - they REALLY crunch your code. Everything is tightened up to the point where it looks like one giant paragraph! Yikes. Too much for me, but if you don’t care go for it. :) I suggest keeping a backup with all your line breaks in place, so making edits later won’t be such a headache, then re-optimize when you’re ready to upload the changes.

  • Speed Analyzer - is a favelet you can toss into your bookmarks, and use for testing an entire page. It includes analysis on CSS, images, scripts, objects and HTML, and gives you color-coded indicators about the results, each with additional info about page load time and external file sizes, and what to do about it. Very useful. If you’re running Wordpress with any plugins, however, it’s bound to throw out some script warnings. Even if you’re just running a couple of simple stat scripts, it’s going to flag them. Good tool overall though.

As an alternative to the first two utilities listed, you can compress your CSS using Gzip. Granted, this isn’t available as an online tool, but if you thought 26% was good (I did), you might be surprised to learn you can reduce your file size up to 80% by compressing and serving your CSS as PHP. If you’re raising an eyebrow right now, Fiftyfoureleven.com explains it much better than I ever could.


  1. WebStractions

    That was a good suggestion to keep a backup copy of the original on hand. May want to highlight that point. :)

    The ‘favelet’ that runs the page through speed analysis is the same tool on the Web Developer Toolbar for Firefox. I think most developers use Firefox, but if there are any that are still stuck in the past — that would be a definite add to their Favorites.


  2. Charity

    Good call. I always forget about that feature on the WD toolbar. :)

Post your remark

Other Recent Articles

In Reviews »

Clever Development With Coda

07/15/08
If you follow design related blogs, it seems you can't click a mouse anymore without Coda's icon making an appearance. I heard about this software long before buying my Mac, but because it's exclusive to that platform, I was never able to give it a test run. Now eight ... [ » ]

In Inspiration »

Have You Ever?

06/25/08
If you know me very well, you know how important music is in my life. It's playing at all times in my house, and I embrace all kinds of genres. I don't talk about it much on this blog, but I should. Music and creativity, in my opinion, are inextricably ... [ » ]

In Design »

The Evolution of a Logo (I Can Live With)

06/19/08
One of the most frustrating things for me since I started writing on this blog was the lack of a logo I really loved. That's not to say I haven't tried. But logo design, to me, is kind of a thing all it's own and I'm just not very good ... [ » ]