Performance: Responsive typography scaling
MEDIUM IMPACT
This affects page load speed and rendering performance by controlling how font sizes adjust across different screen sizes without causing layout shifts.
<p class="text-[clamp(1rem,2vw,2.5rem)] md:text-[clamp(1rem,2vw,2.5rem)]">Hello World</p><p class="text-base md:text-4xl">Hello World</p>| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Abrupt breakpoint font size changes | Minimal | Multiple on viewport resize | High due to layout shifts | [X] Bad |
| Fluid typography with clamp() and Tailwind | Minimal | Single on initial load | Low, smooth scaling | [OK] Good |