Performance: Breakpoints
MEDIUM IMPACT
Breakpoints affect how CSS adapts layout and styles at different screen sizes, impacting rendering speed and visual stability.
@media (max-width: 1200px) { .container { width: 100%; } } @media (max-width: 900px) { .container { width: 90%; } } @media (max-width: 600px) { .container { width: 80%; } }
@media (max-width: 1200px) { .container { width: 100%; } } @media (max-width: 1199px) { .container { width: 90%; } } @media (max-width: 1198px) { .container { width: 80%; } }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Many close breakpoints | No extra DOM nodes | Multiple reflows on resize | High paint cost due to frequent changes | [X] Bad |
| Few well-spaced breakpoints | No extra DOM nodes | Single reflow per breakpoint change | Lower paint cost, smoother transitions | [OK] Good |