freecoding.school100% FREE · NO SIGNUP
Neon DistrictISSUE #36 of 50

will-change · the perf hint

PrismaVSJank the Janitor
Prisma sayswill-change hints to the browser which property will animate so it can optimize ahead.

will-change: transform tells the browser to promote an element to its own layer before an animation, reducing jank. Use it sparingly and remove it when done — too many promoted layers waste memory and can hurt performance. A scalpel, not a default.

Power-ups you unlock

Jank the Janitor attacks — common mistakes

Boss battleAdd will-change:transform to an element you animate on hover; reason about when to remove it.

Example code

<!doctype html><html><head><meta charset="utf-8">
<style>.b{width:80px;height:80px;background:#b388ff;will-change:transform;transition:transform .2s}.b:hover{transform:scale(1.2)}</style></head><body style="background:#06040d;padding:30px"><div class="b"></div></body></html>
▶ Open the interactive comic issue
‹ Scrollbar Styling · ::-Webkit-ScrollbarContain · Layout · Paint · Style Isolation ›