Skip to main content
Home / Articles /

Be Careful with will-change

Direct Link →

The concept behind the will-change property is to stop using hacks like transform: translateZ(0) to tell browsers where to optimize and standardize it. The typical, understandable gripe is that this complicates CSS. Shouldn't browsers be smart enough to do these optimizations, rather than leaving it up to us authors? To which browsers say: it's near impossible to heuristically determine these things. Much like the sizes property in responsive images - just telling the browser allows it to act on that information much sooner. Browsers also say, it's not CSS getting more complicated, it's pages. Another gripe is that the suggested use of applying and removing will-change with JavaScript as needed is asking too much.

All that warm-up to link to Thierry Koblentz's article in which he warns that will-change can create new stacking contexts, which can be unexpected and create cross-browser differences.

icon-link icon-logo-star icon-search icon-star