Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add note about syntax rules.

  • Loading branch information...
commit d697fa4b170bc4e8d78f63a5595ba42ed6b6c2ad 1 parent b916224
@csswizardry authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 CSS Guidelines.md
View
6 CSS Guidelines.md
@@ -7,8 +7,14 @@
We maintain a table of contents at the top of each CSS file which maps to sections in the document. Each section is prefixed with a `$` symbol which means that doing a find for `$[section name]` will only yield results that are sections.
+### Syntax and formatting
+
We use multi-line CSS to help with version control (diffing single line CSS is a nightmare) and we order CSS declarations by relevance, **not** alphabetically.
+We use hyphen delimited, lowercase selectors: `.thisIsBad{}`, `.this_is_also_bad{}` but `.this-is-correct{}`.
+
+Always use a trailing semi-colon on the last declaration in a ruleset to avoid any potential confusion and syntax errors over the life of the document.
+
For an example of our preferred CSS file formatting and structure please see [github.com/csswizardry/vanilla/…/style.css](http://github.com/csswizardry/vanilla/blob/master/css/style.css)
**Read:**
Please sign in to comment.
Something went wrong with that request. Please try again.