will-change

Tells the browser that an element is expected to change soon, allowing the browser to optimize for that change before it happens. Use it sparingly to improve performance for complex animations.

It is documented as part of the CSS Will Change specification.

/* Usage Example */
.complex-animation {
  will-change: transform, opacity;
  /* hints to the browser to prepare for heavy GPU work */
}

/* Syntax */
will-change: auto;

/* Global values */
will-change: inherit;
will-change: initial;
will-change: revert;
will-change: revert-layer;
will-change: unset;
Widely available Since 2020 96% global usage

This feature is well established and works across many devices and browser versions. It has been available across browsers since 2020.

36+
36+
9.1+
79+
Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC