More CSS Optimization

Readers responded to last week’s post about CSS Tweak by sending us some more robust CSS compression tools. Though these don’t have the fancy Ruby interface of CSS Tweak, they do offer some additional compression and optimization functionality. The first is from Sweden, and it has the totally uninteresting name, “CSS Formatter and Optimiser.” It […]

Readers responded to last week's post about CSS Tweak by sending us some more robust CSS compression tools. Though these don't have the fancy Ruby interface of CSS Tweak, they do offer some additional compression and optimization functionality.

The first is from Sweden, and it has the totally uninteresting name, "CSS Formatter and Optimiser." It does, however, have extensive controls, and it comes in English, German, and French. It doesn't validate CSS (rightly so) but it does an excellent job of optimizing your declarations, decreasing your file size, and making your CSS more uniform. You also get a compact block of color-coded output.

The other tool that readers sent in is (coincidentally) the tool that the "Optimiser" is based upon. CSSTidy is an open source parser and optimizer that you can run either from the command line or via a PHP script. It does what most compressors do — whitespace reduction, value optimization, comment removal, and so on. The result is a lower filesize, lowered bandwidth for serving pages, and more readable CSS. So, it's up to you whether you want a web-based GUI or a command line tool with more controls.

And of course, before you run any stylesheets through these tools, you should make sure they are valid and well-formed.