Object Oriented CSS
.bluebackground { background-color: blue;}
.roundedcorners { border-radius: .5rem;}
Scalable and Modular Architecture for CSS
Builds on the idea of OOCSS
Base, Layout, Module, State, Theme, Changing State rules
Modules and submodules for styling design components
modules/blocks can be nested or woven together
<article class="article"> <header class="article-header"> <h1 class="heading heading--alpha article-title">Title</h1> <h2 class="heading heading--beta article-subtitle">Subtitle</h2>
</header></article>
wrong way:
.article { ....
.heading { ...}}
right way:
.article { ... }.article-title { ... }
block element modifier methodology
.block { ... }.block-element { ... }.block-element--modifier { ...}
All Together Now
OOCSS for utility classes
SMACSS for just about everything else
BEM naming convention
Flat CSS structure to avoid specificity battles and enhance reusability
Classes Always
Javascript:
Structure
@import "utils";
@import "typography";
@import "base";
@import "layout/*";
@import "block/*";
@import "state/*";
@import "theme/*";
@import "junk";