W3C home > Mailing lists > Public > www-style@w3.org > October 2011

Re: [css3-flexbox] flex() and CSS transitions

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 11 Oct 2011 18:11:18 -0700
Message-ID: <CAAWBYDDO_Ybk5R4dW-qSY5VqJK1ix24MKkv50xKea3ctKFTjsg@mail.gmail.com>
To: Tony Chang <tony@chromium.org>
Cc: www-style@w3.org
On Thu, Oct 6, 2011 at 4:51 PM, Tony Chang <tony@chromium.org> wrote:
> What should happen if we try to use a CSS transition between two different
> flex() values?
> I made a small demo in javascript that scales each value independently (pos
> flex -> pos flex, neg flex -> neg flex, preferred size -> preferred size)
> and it seems to behave reasonably.  I just wanted to make sure this is
> something we want to support.

For transitioning between flexible values, yeah, just transitioning
the components individually seems likely fine.

Could you share your demo?


> Also, it seems like transitioning from a fixed length to a flex() value
> should just treat the fixed length as flex(0 0 [fixed length]).  Does that
> seem reasonable as well?

I think this works, except for the case where all the items are
inflexible and then transition to being flexible.  They'll suddenly
jump in size as soon as their flex becomes non-zero.

We could possibly fix this by adopting something similar to the
behavior of Andrew Fedoniouk's %% unit, where if the sum of all the
flex values in the line is less than 1, it resolves to a percentage of
the free space instead.  Put another way, the flex value would specify
what fraction of the free space it wants, normalized so that they sum
to 1 *only* if the sum is greater than 1.  (Presumably the same would
apply to neg-flex?)

~TJ
Received on Wednesday, 12 October 2011 01:12:07 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:45 GMT