DEV Community

Discussion on: Using CSS Transitions on the Height Property

Collapse
 
equinusocio profile image
Mattia Astorino

With max-height you should know the element computed height because if the content have a variable length 1500px may can’t be enough.

If you set a custom property to replace the max-height value, with js you can get the actual element height and change the max-height custom property runtime.

Anyway you should not transitioning height or max-height. Transforming a clip-path property may be more performant. Cheers.