Re: animate/transition height to/from auto

On Tue, Nov 13, 2012 at 11:42 AM, Tab Atkins Jr. <jackalmage@gmail.com>wrote:

> On Thu, Nov 8, 2012 at 4:46 PM, Behrang Saeedzadeh <behrangsa@gmail.com>
> wrote:
> > Any plans to add this to the CSS spec? Right now, even with JS, it is not
> > possible to do this elegantly.
>
> Yes, it's a major lack in Transitions right now.  It's not easy to
> fix, though - Transitions currently fire only when the computed value
> changes, while 'auto' is translated into a length at used-value time.
>

Can you elaborate?
'auto' becomes a value in the computed style so it should be possible to
transition from that value.
>From the CSS transtions spec:

The computed value of a property transitions over time from the old value
to the new value.



>
> It may be possible to special-case width/height, without too much
> trouble, so that transitions to/from auto work as expected.  However,
> this won't allow you to, say, transition the height of an element
> which is 'auto' the entire time, but changes due to a child changing
> height.
>
> ~TJ
>
>

Received on Tuesday, 13 November 2012 23:42:00 UTC