Performance: Transform (scale, rotate, translate)
MEDIUM IMPACT
This affects how the browser paints and composites elements, impacting animation smoothness and interaction responsiveness.
<div class="w-32 h-32 bg-blue-500 transform transition-transform duration-300" style="transform: translateX(100px) scale(1.5);"></div>
<div class="w-32 h-32 bg-blue-500" style="width: 200px; left: 100px; position: relative; transition: width 0.3s, left 0.3s;"></div>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Animating width and position | Multiple style changes | Multiple reflows | High paint cost | [X] Bad |
| Animating with transform (scale, rotate, translate) | No DOM changes | No reflows | Low paint cost (composite only) | [OK] Good |