Re:Don't Animate Height
by spankalee on Tuesday July 22, 2025 @09:17PM
(#44654813)
`contain: strict` is much better than `overflow: hidden` for this case, and implies `overflow: hidden`.
[ Parent
| on HN ]
Re:Don't Animate Height
by bobbylarrybobby on Tuesday July 22, 2025 @11:31PM
(#44655481)
https://developer.mozilla.org/en-US/docs/Web/CSS/contain
Yes, looks like this property isn't just a hack, but was designed with exactly the performance considerations laid out in the article in mind. Animating height is only expensive when the element’s height affects layout, which it doesn't have to!