title: Is there an advanced CSS minifier/compiler that does things like strip redundancy and comma separate identical rules?
body: <p>For example</p>
  
  <pre><code>input{margin:0}body{margin:0;background:white}
  </code></pre>
  
  <p>would be shorter written like this</p>
  
  <pre><code>input,body{margin:0}body{background:white}
  </code></pre>
  
  <p>or this</p>
  
  <pre><code>input,body{margin:0}body{margin:0;padding:0}
  </code></pre>
  
  <p>would be shorter written like this</p>
  
  <pre><code>input,body{margin:0}body{padding:0}
  </code></pre>
  
  <p><strike><strong>Conclusion</strong> no such tool</strike> See the accepted answer.</p>
  
  <p><strong>A tip to the tool writers</strong>, you <strong>may</strong> want to consider gzip. Sometimes, leaving a few bytes on a second-rate optimization will be shorter in the end because gzip is essentially byte-level deduplication. If there are two identical sections, gzip will reference the earlier one. <strong>Ideally</strong> this would be considered in deciding if certain optimizations should be skipped some or all of the time, and what the order of the selectors and rules should be.</p>