Last active
December 29, 2015 16:09
-
-
Save hedleysmith/7695973 to your computer and use it in GitHub Desktop.
SASS Style Guide / Coding Standards
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Code block comment | |
| */ | |
| $variable: 1; | |
| $variable: 2; | |
| .selector { | |
| @extend %placehold-extender; | |
| @include functionname(); | |
| property: value; | |
| property: value; | |
| @media all and (property: value) { | |
| property: value; | |
| } | |
| &:hover, | |
| &:visited { | |
| property: value; | |
| } | |
| > .direct-children { | |
| property: value | |
| } | |
| // Inline comment | |
| .other-selectors { | |
| @include functionname(); | |
| property: value; | |
| property: value; | |
| @media all and (property: value) { | |
| property: value; | |
| .other-selector { | |
| property: value; | |
| } | |
| } | |
| } | |
| } | |
| /** | |
| * Order of preference: | |
| * | |
| * 1. Extends | |
| * 2. Includes | |
| * 3. Declarations | |
| * 4. Media queries | |
| * 5. Nested rules | |
| * | |
| */ | |
| /** | |
| * Other suggestions: | |
| * | |
| * 1. Don't nest too deep (4 max), or write nested rules which are too long (~100 lines max) | |
| * 2. Name your variables modularly http://webdesign.tutsplus.com/tutorials/htmlcss-tutorials/quick-tip-name-your-sass-variables-modularly/ | |
| * | |
| */ | |
| /** | |
| * References: | |
| * | |
| * https://medium.com/building-potluck/74434b267920 | |
| * http://css-tricks.com/sass-style-guide/ | |
| * http://www.ackmanndickenson.com/2013/08/a-sass-style-guide/ | |
| * | |
| */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment