Skip to content

QuizNot attempted

Why animate transform

Why animate transform: translateX() instead of left?
1–4 to choose, Enter to submit
Show answer & explanation

Correct answer:

  • transform can be handled by the compositor on the GPU (no layout or paint per frame); left triggers layout every frame
  • transform (and opacity) can be animated on a compositor layer by the GPU with no layout or paint per frame, while left changes geometry and forces layout + paint every frame, which janks.
  • Not deprecated: left is perfectly valid.
  • Not works without position: true, but irrelevant to smoothness.
  • Not a 30fps cap: browsers cap nothing
  • it just drops frames when layout is expensive.
  • will-change: transform promotes a layer ahead of time (sparingly, layers cost memory).