(Tutorial) Drupal CSS Coding Standards

Tutorial : Drupal CSS Coding Standards

On the #drupal IRC channel, Excallibur points out that there are no coding standards for CSS. I'd like to propose some straightforward ones.

Note that I am not intentionally omitting indentation within rules, but am having trouble with my code filter.

I. CSS is not Java.

This java-style of CSS does not make the code easier to read:

#rule1
{
margin:0px;
}

It just adds an unnecessary space. Below is the correct way, which is consistent with core CSS.
#rule1 {
margin:0px;
padding:1em;
}

II. Two selectors = Two lines.

While the following code is more compact, it's also more difficult to scan.

Read more..

Courtesy : nicklewis.org