Performance: Flex grow and shrink
MEDIUM IMPACT
This affects how flex items resize within a container, impacting layout recalculations and paint times during resizing or dynamic content changes.
<div class="flex"> <div class="flex-grow flex-shrink basis-64">Flexible base size item</div> <div class="flex-grow flex-shrink">Flexible item</div> </div>
<div class="flex"> <div class="flex-grow-0 flex-shrink-0 w-64">Fixed width item</div> <div class="flex-grow flex-shrink">Flexible item</div> </div>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Fixed width with flex-grow/shrink mix | Low | Multiple on resize | High due to layout shifts | [X] Bad |
| Consistent flex-basis with grow and shrink | Low | Single on resize | Low, smooth resizing | [OK] Good |