CSS will-change Property Explained

What the CSS will-change property does, with an example.

Published November 6, 2026

will-change hints to the browser which properties will change so it can optimise ahead of time, for example promoting an element to its own layer.

How it works

Use it sparingly and remove it when the animation is done: too many layers consume memory.

Typical values: transform, opacity.

Values and effects

will-change: transform; → prepare for transform animation
will-change: opacity; → prepare for fades
will-change: auto; → no hint

Practical examples

Before a heavy animation

.menu { will-change: transform; }

Add via JS only while needed

el.style.willChange = 'transform'
el.addEventListener('transitionend', () => (el.style.willChange = 'auto'))

Avoid

* { will-change: transform; } /* never do this */

Common mistakes

  • Applying it to many elements.
  • Leaving it on permanently.
  • Using it as a fix for unrelated jank.

Key takeaways

  • will-change in one line: will-change hints to the browser which properties will change so it can optimise ahead of time, for example promoting an element to its own layer.
  • Inspect it live in DevTools → Styles.
  • Test across browsers and screen sizes.

FAQ

Should I use it everywhere?

No; it is a last-resort optimisation.

Is will-change supported in all browsers?

Yes in all modern browsers; check caniuse.com for edge cases.

More CSS articles