will-change
A CSS hint that tells the browser an element is about to animate a given property, so it can prepare, for example by giving it its own compositor layer.
In more detail
Browsers already optimise common animations, so it is rarely needed. Use it sparingly and only just before animating; every promoted layer costs memory.
Related terms
- compositing — The final rendering stage, in which separately painted layers are stacked and drawn together on screen, usually by the GPU.
- compositor thread — A browser thread, separate from the main thread, that combines layers into frames and can scroll and run some animations on its own.
Taught in
- Modern CSS Animations, Transitions And View Transitions API — Frontend Architecture & Web Platform