rstacruz / css-condense

[unsupported] A CSS compressor that shows no mercy
205 stars 4 forks source link

Take a look at csso #1

Open arikon opened 12 years ago

arikon commented 12 years ago

Hi!

Have you looked at csso created by @afelix? https://github.com/css/csso

The goals of this project are the same. Do you mind to join forces?

rstacruz commented 12 years ago

Thanks! That's cool! I don't know what to contribute though, it seems they've already implemented the things I wanted to implement for css-condense aready haha.

rstacruz commented 12 years ago

Hmm, looks like their structure minimization is more conservative that css-condense's. Which is great and safe, but css-condense aims to be a bit more "living on the edge". eg:

div { color: blue; }
.box { background: green; }
a { color: blue; }

csso:

div{color:blue}.box{background:green}a{color:blue}

css-condense:

.box{background:green}a,div{color:blue}

...reordering the items to put the div and a rules together works for cssc though.

arikon commented 12 years ago

Thanks! I guess @afelix will join the discussion a bit later ;)

afelix commented 12 years ago

Yep, safety is the number one choice. :) In the first versions there were many optimizations like you provided (in the comment), but sometimes it will make CSS-compressor in trouble. General rule: if you are changing the order of rulesets (i.e. .x {..} .y {..} .z {..} -> .x, .z {..} .y {..}), someday some user will post you an issue about different rendering of the style before and after. Sure, it is possible to try to distinguish safe cases and not very safe, but... it will be interesting to watch. :)