with a two space indent. • Put spaces after : in property declarations. • Put spaces before { in rule declarations. • Line returns after the last property declaration to place the }. • Use // for comment blocks (instead of /* */). (Why? // comments are stripped when compiled and minimized, /* */ will show up regardless.) • Use hex color codes #000 unless using rgba. • DO NOT USE IDs
in more than one file should be put in globals/. Others should be put at the top of the file where they're used. • List `@extend`s first. • List "regular" styles next in alphabetical order. • List `@include`s next. • Nested Selectors last, in alphabetical order. • Nothing goes after the nested stuff. And the same order as above within the nested selector would apply. • All Vendor Prefixes Use @mixins. • Maximum Nesting: Three Levels Deep. If you find yourself going further, think about reorganizing your rules (either the specificity needed, or the layout of the nesting). • Maximum Nesting: 50 Lines. • Global and Section-Specific Sass Files Are just Table of Contents. • List Vendor/Global Dependancies First, Then Author Dependancies, Then Patterns, Then Parts
%module; // List "regular" styles next in alphabetical order background-color: #000; position: absolute; // List @include(s) next @include transition(all 0.3s ease-out); // Nested Selectors last, in alphabetical order > h3 { border-bottom: 1px solid white; @include transform(rotate(90deg)); span { ... // NO MORE NESTED STYLES! } } .nested-example { ... } }
elements un-styled • You have to then style everything • Preserves useful defaults rather than "unstyling" everything. • Corrects some common bugs that are out of scope for reset.css. • Doesn't clutter your dev tools. (Doesn’t blanket style a bunch of elements) • More modular.
prefaced with js- • Also status type classes like is-selected, but it against how jQuery normally classes elements with functions like .hide(); • Categories 1. Base 2. Layout 3. Module 4. State 5. Theme