Performance: Border width utilities
MEDIUM IMPACT
Border width utilities affect the paint and layout stages by changing element borders, impacting rendering speed and visual stability.
<div class="border-2"></div> <div class="border-4"></div> <div class="border-8"></div>
<div class="border-[3px]"></div> <div class="border-[5px]"></div> <div class="border-[7px]"></div>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Arbitrary border widths (e.g., border-[3px], border-[5px]) | Low | Multiple reflows if layout changes | High paint cost due to unique styles | [X] Bad |
| Predefined Tailwind border utilities (e.g., border-2, border-4) | Low | Single reflow if layout changes | Lower paint cost due to reused styles | [OK] Good |