Increasing Animation Performance Using the will-change Property

suggest change

will-change is a property, not an HTML attribute. It hints that a property is about to change so the browser can prepare. It does not itself animate anything, and it does not make every animation run on the GPU. In practice, transform and opacity are the properties most often promoted to their own layer; animating layout properties such as width or top can still cause layout work.

The value is a comma-separated list of properties. If an element will be transformed and faded, you can write:

.example {
  will-change: transform, opacity;
}

Use will-change sparingly, and only just before the change when you can. Setting it on every element can waste memory, because the browser may keep extra layers around. Remove the hint when the change is finished if it was applied from script.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents