Optimize your Cascading Stylesheets

Posted on 2008.03.09
Categories: Geekie.org; Tagged with: , , , ,

Geekie.org is making available a clone of Robson’s CSS Compressor using the GPL-licensed source code available at http://iceyboard.no-ip.org/showcode/code/css_compressor.php.

Just so that I didn’t have to go and search the Internet for this excellent CSS compressor every time I wanted to use it, I decided to host the code and frontend on our site. You can find it at http://www.geekie.org/tools/css.compressor. Bookmark it for future use! There are no advertisements on the frontend and the backend works exactly as it was intended to work at the original site.

Previously I talked about a long method of compressing JS or CSS on-the-fly with PHP’s zlib.output_compression. What this tool does isn’t “compress” in the sense of changing the output between the server and your browser, but rather optimize Cascading Stylesheets by changing the way that colours are defined to the shortest form possible, combining different declarations that are similar or identical, and removing useless measurements like 7.00 em. The result can be compressed to as little as 30% of the original code, depending on how it was written.

We recommend that you try this tool, and speed up your site. It’s easy; just copy and paste your CSS into the box and press submit. The default settings work fine for most stylesheets, and help you reduce your filesize significantly. The only downside is that the resulting code won’t be as easy to edit as before, so always keep your original, pre-optimized stylesheet backed up!

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

no comments yet.

Leave a comment

Names and email addresses are required (email addresses aren't displayed), url's are optional.

Comments may contain the following xhtml tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Comments by unregistered users need approval, and all comments are subject to Akismet SPAM filtering. A valid e-mail address is required but will not be published or used for third-party solicitation (see our Privacy Policy). Please provide either your real name or a nickname representative of yourself.