(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.
Courtesy : nicklewis.org
- guru's blog
- Login to post comments
![Drupal-6-Book-[Building Powerful and Robust Websites with Drupal 6].jpg](http://www.drupalranch.com/images/Drupal-6-Book-[Building%20Powerful%20and%20Robust%20Websites%20with%20Drupal%206].jpg)