One of the Boss Battles of CSS is Almost Won! Transitioning to Auto
Briefly

For many years, CSS developers have desired a way to animate elements from hidden to their natural size. However, CSS lacks the ability to know the natural size due to various factors like font and layout choices.
Workarounds include using JavaScript to measure off-screen sizes for animation, or animating max-height, despite timing issues. CSS improvements are expected to allow animations from zero height to intrinsic size soon.
Read at Frontendmasters
[
]
[
|
]