Performance: Why consistent typography matters
MEDIUM IMPACT
Consistent typography affects page rendering speed and visual stability by reducing layout shifts and repaint costs.
html { font-size: 16px; } body { font-family: 'Bootstrap Sans', sans-serif; font-weight: 400; font-size: 1rem; } h1, .btn { font-weight: 600; font-size: 1.5rem; } p { font-weight: 400; font-size: 1rem; }body { font-size: 1rem; } h1 { font-size: 2.5rem; font-weight: 700; } p { font-size: 1.2rem; font-weight: 400; } .btn { font-size: 1.5rem; font-weight: 600; }| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Inconsistent typography sizes | Multiple style recalculations | Multiple reflows triggered | High paint cost due to text resizing | [X] Bad |
| Consistent typography with Bootstrap variables | Minimal style recalculations | Single reflow on load | Low paint cost, stable text layout | [OK] Good |