Any perspectives on height auto for CSS3 transitions and animations?

DADU picture DADU · Jun 3, 2011 · Viewed 7k times · Source

CSS3 transitions, transforms and animations are wonderful. They are even more now more browsers do support them.

Still there's one thing I keep asking myself: Why isn't the spec definining that CSS3 transitions and animations should handle height:auto?

It doesn't make any sense when we're moving away from fixed layouts with things like the CSS3 flexible box model and media queries.

It doesn't make any sense to use JavaScript just to set a CSS transition with a fixed height.

Now comes my question:

Will the W3C ever specify that height:auto should be supported for CSS3 transitions and animations or can we request them to specify this?

Answer

Lea Verou picture Lea Verou · Jun 3, 2011

You can transition max-height instead: http://jsfiddle.net/leaverou/zwvNY/