title: Convention for CSS Formatting
body: <p>Some developers are particular about how they format their codes, for some good reasons. CSS is one of the items whose formatting doesn't really have a strong convention to follow (most probably because of its declarative nature).</p>
  
  <p>Our group typically follow this "convention." The longer and more detailed doc can be found <a href="https://docs.google.com/document/d/1YxUHQUnQ8NvMgF8bjdHi8W2WNecvRT9LgwFKXn4yXJU/edit" rel="nofollow noreferrer">here</a>.</p>
  
  <pre><code>/* Separate each selector to its own line. */
  selector-1,
  selector-2&lt;1-space&gt;{
    &lt;indent&gt;property:&lt;1-space&gt;value;
  }
  
  selector {
    /* Float. */
    /* Positioning related declarations. */
    /* Visibility. */
    /* Box related declarations. */
    /* Font related declarations. */
  }
  </code></pre>
  
  <p>Is there a tool, which I can easily customize, in order to produce this formatting?</p>
  
  <p>Actually, I'd be really interested to gather other experienced CSS programmers' inputs about e.g. whether it's better to lump multiple selectors into one line or separate them into multiple lines, whether I should even bother to prettify and maintain logical orders of my code manually.</p>
  
  <p><strong>Note:</strong> This probably doesn't perfectly fit to be a SO question. However, I am pretty certain the experience accumulated by some SO-ers during their tenure writing and maintaining CSS codes will definitely give insights to this issue.</p>
  
  <p>Some CSS auto-format tools <a href="https://stackoverflow.com/q/161056/583539">exist</a> but there are not quite extensible.</p>