Performance: Divide utilities between children
MEDIUM IMPACT
This affects how CSS utilities are applied to child elements, impacting CSS size and rendering efficiency.
<div class="text-lg font-bold divide-y divide-gray-300"> <p class="mb-4">Child 1</p> <p class="mb-4">Child 2</p> <p class="mb-4">Child 3</p> </div>
<div> <p class="text-lg font-bold mb-4">Child 1</p> <p class="text-lg font-bold mb-4">Child 2</p> <p class="text-lg font-bold mb-4">Child 3</p> </div>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Repeated utilities on each child | Multiple style recalculations per child | Triggers reflow for each child styled | Higher paint cost due to repeated styles | [X] Bad |
| Parent-level divide utilities | Single style recalculation for parent and children | Single reflow for the divide effect | Lower paint cost due to efficient styling | [OK] Good |