Css compiler optimization

I need a real optimization / compilation of my CSS styles (and not just minification), in the same vein as the Google Closure compiler for JavaScript.

For example, if my entire stylesheet is simple:

div#hello { color: #FFF; background-color: #000; } div#hello p { color: #FFF; margin-top: 10px; margin-bottom: 10px; margin-right: 10px; margin-left: 10px; font-family: Helvetica, Arial, sans-serif; } a { color: #FFF; margin-top: 10px; margin-bottom: 10px; margin-right: 10px; margin-left: 10px; font-family: Helvetica, Arial, sans-serif; } 

This can be optimized (I keep the gaps here for readability, but obviously this would also be needed):

 #hello { color: #FFF; background: #000 } #hello p, a { color: #FFF; margin: 10px; font-family: Helvetica, Arial, sans-serif } 
+4
source share
2 answers

This seems to be what you are looking for:

http://iceyboard.no-ip.org/projects/css_compressor

Here is a comparison of several others:

http://www.bloggingpro.com/archives/2006/08/17/css-optimization/

0
source

It looks like you want CSSTidy: http://csstidy.sourceforge.net/

+1
source

All Articles