Not all motion counts against CLS — Cumulative Layout Shift. The metric only cares when an element pushes other content out of the way. So the kind of animation you choose decides whether Google penalizes it.
The key idea: animating an element's position in the layout shoves its neighbors. Animating only how it's painted doesn't.
Safe to animate freely:
— transform (move, scale, rotate) — neighbors don't budge
— opacity — fading never shifts anything
Risky, counts as shift:
— top, left, margin, height — these reflow the page
Think of transform as sliding a sticker across a finished poster, versus re-cutting the whole poster.
Try this: Find one hover or slide-in effect using margin or top and rewrite it with transform: translate(). Same look on screen, zero layout shift counted.
Vitals 101
@CoreVitals101
Which animations are safe for layout shift (and which aren't)
This post was published in the Telegram channel Vitals 101 (@CoreVitals101). All its posts are on the channel page.
Open on Telegram