Skip to content

Rule · Lint

Animation of layout properties (width/height/top/left/margin/padding)

lint/animate-layout-propwarnvoid lintupdated

Why it matters

Animating layout properties forces layout + paint on every frame on the main thread, so the animation drops frames under load and can shift surrounding content.

How to fix it

Animate transform and opacity instead (scale, translate, clip-path), use grid-template-rows: 0fr → 1fr for accordions, or motion's layout prop for size changes.

Example

css
@keyframes enter { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }

References

void lint reports 67 rules in this category. Static source checks with no browser: Tailwind v4 silent failures, Next.js 16 API traps, React render-body bugs, accessibility markup, SEO files and motion hygiene.