aboutsummaryrefslogtreecommitdiff
path: root/documentation/coding_standards/css_coding_standards.txt
diff options
context:
space:
mode:
authorBrett Profitt <brett.profitt@gmail.com>2011-08-23 09:16:20 -0700
committerBrett Profitt <brett.profitt@gmail.com>2011-08-23 09:16:20 -0700
commit3e1a96cabb228b59021676772daca23b22a026c7 (patch)
tree3ba1cdf9a9d271c39bceac8b8d5c2b78e0d61977 /documentation/coding_standards/css_coding_standards.txt
parent8dc4ca48d1ff5c3800637a463a7b072fb253634e (diff)
parent5ac7727c36392633dc7d1d4a79ee3c5086bd37b6 (diff)
downloadelgg-3e1a96cabb228b59021676772daca23b22a026c7.tar.gz
elgg-3e1a96cabb228b59021676772daca23b22a026c7.tar.bz2
Merge branch 'master' of github.com:Elgg/Elgg
Conflicts: engine/lib/views.php
Diffstat (limited to 'documentation/coding_standards/css_coding_standards.txt')
-rw-r--r--documentation/coding_standards/css_coding_standards.txt67
1 files changed, 67 insertions, 0 deletions
diff --git a/documentation/coding_standards/css_coding_standards.txt b/documentation/coding_standards/css_coding_standards.txt
new file mode 100644
index 000000000..195ca345b
--- /dev/null
+++ b/documentation/coding_standards/css_coding_standards.txt
@@ -0,0 +1,67 @@
+*** CSS CODING STANDARDS ***
+
+* Use shorthand where possible:
+ Bad:
+ background-color: #333333;
+ background-image: url(...);
+ background-repeat: repeat-x;
+ background-position: left 10px;
+ padding: 2px 9px 2px 9px;
+
+ Good:
+ background: #333 url(...) repeat-x left 10px;
+ padding: 2px 9px;
+
+* Use hyphens as separators in classes/ids, not underscores:
+ Bad:
+ .example_class
+
+ Good:
+ .example-class
+
+* One property per line
+ Bad:
+ color: white;font-size: smaller;
+
+ Good:
+ color: white;
+ font-size: smaller;
+
+* Property declarations should be spaced like so: `property: value;`
+ Bad:
+ color:value;
+ color :value;
+ color : value;
+
+ Good:
+ color: value;
+
+* Group vendor-prefixes for the same property together:
+* Longest vendor-prefixed version first:
+* Always include non-vendor-prefixed version:
+* Put an extra newline between vendor-prefixed groups and other properties:
+ Bad:
+ -moz-border-radius: 5px;
+ border: 1px solid #999999;
+ -webkit-border-radius: 5px;
+ width: auto;
+
+ Good:
+ border: 1px solid #999999;
+
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-radius: 5px;
+
+ width: auto;
+
+* Group declarations of subproperties:
+ Bad:
+ background-color: white;
+ color: #0054A7;
+ background-position: 2px -257px;
+
+ Good:
+ background-color: white;
+ background-position: 2px -257px;
+ color: #0054A7;