Closed Dushyant1295 closed 1 year ago
Hello @Dushyant1295,
The will-change
property has to be used sparingly, YES.
If your element is already using transform: matrix3d
, it will enable a 3d layer in the browser that will compute the transformation with the GPU instead of the CPU. So basically enough to get a smooth rendering.
From the MDN doc:
The will-change CSS property hints to browsers how an element is expected to change. Browsers may set up optimizations before an element is actually changed. These kinds of optimizations can increase the responsiveness of a page by doing potentially expensive work before they are actually required.
As you may know, locomotive scroll transform the whole page content. Because of that - and expensive work - this can lead to a degraded user experience when scrolling, especially if your page content is big, with many scroll animations. From my experience, it's better to prevent using this property, since today, all (modern) browsers are optimized to use the GPU when it's needed.
Hope I answered your question :wink:
Feel free to close the issue if it's the case.
@xavierfoucrier thanks
Agree and understand
Can we use CSS' will-change property for the Performance boosts for inview translating section ?
but MDN says use it sparingly, not sure what's the best approach
@Jerek0 @xavierfoucrier