4

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
}

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

1 Comment

How would you compare this with iceyboard.no-ip.org/projects/css_compressor?
0

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/

2 Comments

How would you compare this with CSSTidy?
The second link I sent you says icey is better than CleanCSS, which is based off of tidy. But that was 5 years ago so things may have changed. Icey is just a webpage, and tidy seems like a small download. Why don't you try both and see which compresses your code better? If compression is a major concern, you can use both.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.