4 ms·
`contain: strict` is much better than `overflow: hidden` for this case, and implies `overflow: hidden`.
by spankalee 1y ago
`contain: strict` is much better than `overflow: hidden` for this case, and implies `overflow: hidden`.
- bobbylarrybobby 1y agohttps://developer.mozilla.org/en-US/docs/Web/CSS/contain 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!