Performance: ITCSS methodology with SASS
MEDIUM IMPACT
This affects CSS loading speed and rendering performance by organizing styles to reduce complexity and improve caching.
// ITCSS layers @import 'settings'; // variables, colors @import 'tools'; // mixins, functions @import 'generic'; // resets, normalize @import 'elements'; // basic HTML elements @import 'objects'; // layout and structure @import 'components'; // UI components @import 'utilities'; // helper classes
@import 'reset'; @import 'buttons'; @import 'header'; @import 'footer'; // All styles mixed without clear layering or specificity control
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Unstructured SASS imports with deep nesting | High due to complex selectors | Multiple reflows triggered by style recalculations | High paint cost from layout thrashing | [X] Bad |
| ITCSS layered SASS imports with simple selectors | Low due to flat selector structure | Single reflow after initial style calculation | Low paint cost with stable layout | [OK] Good |