Performance: Responsive typography
Responsive typography affects how quickly text adapts to different screen sizes without causing layout shifts or slow rendering.
Jump into concepts and practice - no test required
font-size: clamp(1rem, 2vw + 1rem, 2rem);
font-size: 16px; @media (min-width: 768px) { font-size: 24px; } @media (min-width: 1200px) { font-size: 32px; }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Fixed font sizes with media queries | Low | Multiple on resize | Moderate | [X] Bad |
| Fluid font sizes with clamp() | Low | Single on load | Low | [OK] Good |
font-size: clamp(1rem, 2vw, 2rem);
@media (max-width: 600px) { font-size: 2vw; }