Vitals 101
Vitals 101
@CoreVitals101

Moving an animation to CSS cut INP from 240ms to 80ms

INP — Interaction to Next Paint — measures how fast a page reacts after you tap. Animations run in JavaScript can clog the same lane that handles your clicks, so taps feel late. Think of it like one cashier juggling both the line and a phone call: everyone waits.

A menu opened with a JavaScript animation that ran on every frame. While it played, taps queued behind it, so INP hit 240ms.

The fix handed the animation to CSS, which runs on a separate track the browser optimizes:

— Replaced the JS animation with a CSS transition.
— Animated transform and opacity (the two cheapest properties).
— The main lane stayed free for taps.

Result: INP dropped to 80ms, and the animation looked smoother.

Try this: if an animation runs in JavaScript, see if a CSS transition can replace it.
This post was published in the Telegram channel Vitals 101 (@CoreVitals101). All its posts are on the channel page.
Open on Telegram

Latest posts in “Tools and infrastructure”

All channels in this category →

реклама в сети

Готовы запустить рекламу через сеть public.tg?

Новый оффер, продукт, GEO, кейс, событие или партнёрский запуск — соберём маршрут под задачу и отдадим медиаплан.

Telegram для медиаплана: @AFFtop_connect. Быстрый тест: $20 за канал, $1000 за пакет по сети.