Performance glossaryNon-composited animations change properties, such as width or top, that make the browser recalculate layout or repaint on every frame, which can cause jank. Animating transform and opacity avoids it.
Browsers draw a page in stages. They calculate styles, work out the layout (the size and position of every element), paint the pixels, and finally composite, combining the painted layers into the image on screen. Compositing can run on the GPU, on a separate thread from the page's JavaScript.
A composited animation only changes properties the compositor can handle by itself, chiefly transform (moving, scaling, and rotating) and opacity. A non-composited animation changes something that forces the earlier stages to run again on every frame. Animating width, height, top, left, or margin triggers layout; animating background-color or box-shadow triggers paint. That work happens on the main thread, competing with everything else the page is doing.
Why it matters
- Jank. To look smooth on a typical 60 Hz screen, each frame has about 16 milliseconds. Layout and paint on every frame can blow that budget, especially on low-cost phones, and the animation stutters.
- Layout shifts. An animation that changes position or size through layout moves surrounding content, which can add to Cumulative Layout Shift. Movement done with
transformdoes not count as a layout shift. - Slower responses. Main-thread time spent animating is time not spent responding to clicks and taps, which can hurt Interaction to Next Paint.
Lighthouse and PageSpeed Insights point to them in the "Layout shift culprits" insight, and the Performance panel in Chrome DevTools shows which animations could not be composited and why.
How to fix them
- Move elements with
transform: translate()instead of changingtoporleft. - Resize with
transform: scale()instead of animatingwidthorheight, where the visual result works. - Fade with
opacity. To animate a shadow, put the shadow on a pseudo-element and fade that element's opacity. - Use
will-change: transformsparingly, on elements that are about to animate; applied everywhere, it wastes memory. - Respect the
prefers-reduced-motionsetting for visitors who ask for less movement.
Where they come from on WordPress sites
The usual sources are sliders, page builder entrance effects, headers that shrink on scroll, and animate-on-scroll plugins. Many of these can be configured: choose fade or slide effects built on transforms, turn animations off on mobile, or remove effects that add little. In a custom theme, the fix is usually a small CSS change.
Source: Chrome for Developers: Avoid non-composited animations.