Don't animate height!

This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).

A CSS height animation was causing 60% CPU and 25% GPU usage in an Electron app. The issue stems from height being a layout property that triggers expensive layout recalculation, painting, and compositing on every frame. The solution involves replacing height animations with transform-based animations using translate and

5m read timeFrom granola.ai
Post cover image
Table of contents
The problemA solution
5 Comments

Sort: