Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: css.md

Issue 29356084: No Issue - Drafted existing CSS coding style guide (Closed)
Patch Set: Created Oct. 6, 2016, 11:18 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1
2 # CSS
3
4 - Philosophy
5 - Use [valid](https://jigsaw.w3.org/css-validator/) CSS where possible
6 - Try to avoid user agent detection and CSS "hacks"
7 - File
8 - No mode line comments (`/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: ni l; c-basic-offset: 2 -*- */`)
9 - All files should have a [license header](https://adblockplus.org/license-hea ders)
10 - Naming
11 - No special CSS notation (EG: Hungarian, BEM, other prefixes or suffixes deno ting type or scope)
12 - Use meaningful or generic ID and class names
13 - Use ID and class names that are as short as possible but as long as necessar y
14 - Avoid qualifying ID and class names with type selectors (EG: div.error)
15 - Separate words in Id and class names by a hyphen
16 - Group sections together by comment
17 - Spacing
18 - Use unix-style newlines
19 - Use spaces instead of tabs
20 - Use 2 spaces for indentation
21 - Use a space after a property name’s colon
22 - Opening braces always go on their own line.
23 - Separate rules by new lines
24 - Separate selectors and declarations by new lines
25 - Indent all block content (EG: Media queries)
26 - Line length is 80 char, except when it improves readability
27 - No trailing whitespace
28 - Newline at end of file
29 - Properties
30 - Use double quotes
31 - Use hex colors
32 - 3 character notation where possible
33 - Provide units where possible (EG: 0px vs 0)
34 - Don't omit loading 0s in decimal numbers (EG: 0.5px vs .5px)
35 - Shorthand properties are optional
36 - Use a semicolon after every declaration
37 - Property sort order
38 - Display
39 - Positioning
40 - Box model
41 - Colors and Typography
42 - Other
43 - Comments
44 - Use JavaDoc style comments
45 - Don't comment code out, delete it.
46 - Don't add TODO comments, create an issue and reference it in a comment inste ad.
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld