Get the latest tech news

What Does will-change In CSS Do?


What does will-change in CSS actually do?

Finally, the painted layers are handed to the GPU, which stacks them together and shows the combined frame on screen like sliding finished drawings under a sheet of glass. If an animation touches only compositor friendly properties like transform and opacity, the browser can skip layout and paint and let the GPU handle everything in the compositing step. In some cases you might not even notice the difference as modern browsers are already great at optimizing things, but it can be a game-changer for more complex animations that need to feel smooth from the very first frame.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of css

css

Related news:

News photo

Aspects of modern HTML/CSS you may not be familiar with

News photo

Rolling the dice with CSS random()

News photo

The attr() function in CSS now supports types