Skip to content

Rule · Smoothness

Animation of a layout-triggering property

smooth/animate-layout-propertywarnvoid smoothupdated

Why it matters

Animating width, height, top/left, margin or padding re-runs layout and paint on every frame; box-shadow on large elements repaints large areas. These animations drop frames on phones.

How to fix it

Animate transform and opacity instead (scale/translate), use clip-path or a pseudo-element's opacity for shadows, and grid-template-rows 0fr→1fr for accordions.

Example

ts
/* before */ .bar { transition: width .3s }
/* after  */ .bar { transform-origin: left; transition: transform .3s } .bar.on { transform: scaleX(1) }

References

void smooth reports 13 rules in this category. How the page feels after it loads: dropped frames during a scripted scroll, long animation frames, INP of real clicks, shifts after input, animated layout properties, idle rAF loops and reduced-motion handling.