Performance: Why typography control is needed
MEDIUM IMPACT
Typography control affects page readability and visual stability, impacting user experience and layout shifts.
<p class="text-base">Hello</p> <p class="text-lg font-bold">World</p> <p class="text-lg">!</p>
<p class="text-base">Hello</p> <p class="text-lg font-bold">World</p> <p style="font-size: 24px;">!</p>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Inconsistent font sizes with inline styles | Multiple style recalculations | Multiple reflows triggered | High paint cost due to layout shifts | [X] Bad |
| Consistent Tailwind typography classes | Single style calculation | Single reflow | Low paint cost with stable layout | [OK] Good |