Source
- Video Harry Roberts - Managing CSS Projects with ITCSS
- Slides https://speakerdeck.com/dafed/managing-css-projects-with-itcss
- Start with generic and end with explicit.
- Write CSS in specificity order.
- 📈 The Specificity Graph must be always trending upward.
- All rulesets should only ever add to and onherit from previous ones.
- Globally-available variables.
- Config switches.
- Brand colours, etc.
- Globally-available tools.
- Public mixins.
- Helper functions.
- Ground-zero styles.
- Normalize.css, reset, box-sizing, etc.
- Unclassed HTML elements.
- Last layer we see type selector.
- OOCSS.
- Design patterns.
- No cosmetics.
- Begin using classes exclusively.
- Agnostically named (e.g.
.ui-list {}
).
- Designed pieces of UI.
- Still only using classes.
- More explicitly named (e.g.
.product-list {}
).
- Overrides, helpers, utilities.
- Only affect one piece of the DOM at a time.
- Usually carry
!important
.
_[section-name].[partial-name].scss
. e.g.:
_base.links.scss
_componets.buttons.scss
- Media queries: put them in the partial where the selected affected are.