Performance: CSS Modules support
MEDIUM IMPACT
This affects page load speed by controlling CSS scope and bundle size, impacting render blocking and style recalculation.
import styles from './Button.module.css'; <div className={styles.primary}>Click me</div>
/* global.css loaded everywhere */ import './global.css'; <div class="button primary">Click me</div>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Global CSS | N/A | Multiple reflows on style changes | High paint cost due to large CSS | [X] Bad |
| CSS Modules | Scoped to component nodes | Single reflow limited to component | Lower paint cost with smaller CSS | [OK] Good |