title: Is there a tool to alphabetize CSS definitions in Visual Studio?
body: <p>Eric Meyer's advice to keep individual rules alphabetized in a CSS style definition makes sense - there's no &quot;natural&quot; way to order rules, and this makes it easy in a complex definition to make sure you don't define the same thing twice.</p>
  <pre><code>div.Foo
  {
      background:Green;
      border:1px solid Khaki;
      display:none;
      left:225px;
      max-height:300px;
      overflow-x:hidden;
      overflow-y:auto;
      position:absolute;
      top:0;
      width:230px;
      z-index:99;
  }
  </code></pre>
  <p>So my question: Is there a plugin or some other easy way to select a list of rules in Visual Studio and alphabetize them? (Better yet, to apply this throughout a stylesheet in one fell swoop.)</p>
  <h3>Update</h3>
  <p>@Geoff suggests CleanCSS, which is very cool and will do the above-requested alphabetization all at once, in addition to a lot of other nice clean-up (e.g. merging definitions with the same selector). Unfortunately it collapses multiple selectors in a definition into a single line. For example</p>
  <pre><code>div.Foo,
  div.Foo p,
  div.Foo li
  {
     color:Green;
  }
  </code></pre>
  <p>becomes</p>
  <pre><code>div.Foo,div.Foo p,div.Foo li
  {
     color:Green;
  }
  </code></pre>
  <p>which is much harder to read and kind of a deal-breaker. This is with the lowest compression setting, and I don't see a way to override it.</p>