开发者

Optimizing css compiler

I'd like real optimization/compilation of my CSS styles (not just minification), in a similar vein as the Google Closure Compiler works for JavaScript.

For example, if my entire stylesheet is just:

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;
}

That can be 开发者_如何转开发optimized down into (I'm keeping whitespace here for readability, but obviously that would have to go too):

#hello {
    color: #FFF;
    background: #000
}

#hello p, a {
    color: #FFF;
    margin: 10px;
    font-family: Helvetica, Arial, sans-serif
}


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


This seems to be what you are looking for:

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

Heres a comparison of a few others:

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜