Skip to main content
InterviewHubPRO
Section Overview
Q20

Question 20 of 50

Part 2: Core Architecture & Implementation (Mid-Level)

40%
CSS3 & Modern Layouts (50 Qs)•Part 2: Core Architecture & Implementation (Mid-Level)

What is `will-change` in CSS and why should you use it sparingly?

senior LevelSystem Design

In Simple Words: will-change: transform hints to the browser ahead of time that an element is about to animate, instructing it to promote the element to its own dedicated GPU Compositing Layer.

  • Why use sparingly:
    • Each composited layer consumes dedicated VRAM (video memory).
    • Applying will-change to 100 list items consumes hundreds of megabytes of GPU memory, causing mobile devices to crash or drop frames!
    • Best practice: Add will-change on :hover right before animation, and remove it once animation completes.