Formatting
- Use soft tabs (2 spaces) for indentation
- Prefer dashes over camelCasing in class names
- Do not use ID selectors
- When using multiple selectors in a rule declaration, give each selector its own line
- Put a space before the opening brace { in rule declarations
- In properties, put a space after, but not before, the : character
- Put closing braces } of rule declarations on a new line
- Put blank lines between rule declarations
Comment
- Prefer line comments (// in Sass-land) to block comments.
- Prefer comments on their own line. Avoid end-of-line comments.
- Write detailed comments for code that isn’t self-documenting:
- Uses of z-index
- Compatibility or browser-specific hacks
Order
- Positioning properties
- Display properties
- Box properties
- Content properties (including background)
- Pseudo properties