Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Started to skeleton out CSS best practices

ZachTRice689c2c3a3d91
diff --git a/doc/developing.md b/doc/developing.md
index d96a662e1..ab582aca0 100644
--- a/doc/developing.md
+++ b/doc/developing.md
@@ -1,6 +1,6 @@
## Development
-*Please Note*: There is litte to no documentation at ths time and any
+*Please Note*: There is little to no documentation at this time and any
comments in the code may be out of date.
### Minification of CSS and JavaScript files
@@ -109,12 +109,12 @@ Run the following to check only check Javascript errors:
grunt eslint
-[stylelint] is used for CSS linting.
+[stylelint](https://stylelint.io) is used for CSS linting.
Run the following to checkout only CSS errors:
grunt stylelint
-Run the following to automatically fix stylelint errors
+Run the following to automatically fix stylelint errors:
grunt stylefmt
diff --git a/doc/style_guide.md b/doc/style_guide.md
index 7c88f99ec..c54e054fe 100644
--- a/doc/style_guide.md
+++ b/doc/style_guide.md
@@ -2,16 +2,45 @@
This document is an attempt to normalize the code.
-## JavaScript
+## Writing code
+
+### CSS
+
+We use stylelint to enforce our CSS code standards. You can run `grunt stylelint` to check your CSS code. CSS that does not adhere to this standard will not pass the Travis CI build. Please use a linter while developer to catch any issues as they occur. We provide an additional tool to auto-correct your CSS, `grunt stylefmt`.
+
+#### Main Focus
+* CSS should be written in a clean, consistent manner with equal spaced rules and properties.
+* **Class based cascading specificity.** ID and chained type (i.e. span.icon) selectors are highly discouraged and will be forbidden in the future.
+
+#### Selectors
+* Selector pseudo classes
+* Declaration
+
+#### At rules
+* No import rules. If you want to add a css file, include it via a def link in the html, then add it to the css.json file;
+* We are only allowing these at rules:
+* At media rules ...
+
+#### Units / Fonts / Colors
+* Units not allowed: c, ex, in, mm, pc, pt, rem, vh, vmin, vw
+* Colors can only be hexadecimal and if a shorthand is available, this must be used.
+* `0px` must be `0`
+
+Examples
+```css
-* Functions should be pure when possible; pass paramaters that are used to return a result
```
+
+### JavaScript
+
+* Functions should be pure when possible; pass paramaters that are used to return a result
+```js
function getWordArray(str) {
return str.split(' ');
}
```
* Keep variable declaration at the top of the scope to be a more literal representation of where variables are declared
-```
+```js
function varDeclare() {
var all, variables, here;