W3C home > Mailing lists > Public > www-style@w3.org > March 2013

Re: [css3-flexbox] changing default flex value back to "0 0 auto"

From: Ojan Vafai <ojan@chromium.org>
Date: Wed, 27 Mar 2013 12:21:32 -0700
Message-ID: <CANMdWTuum9my+hqsyLpa3i9Krh038rfxo8+6MSS+muThYcASmQ@mail.gmail.com>
To: "www-style@w3.org" <www-style@w3.org>
TL;DR: I had some offline discussion with some other Chromium folk and I
take back this suggestion.

The default flex-shrink of 1 still does mean we avoid overflow in
overconstrained cases if it's possible to wrap the contents of the flex
item. It also means that "text-overflow: ellipsis; overflow: hidden;
white-space: nowrap", will shrink the item and ellipsize it's contents.
Turns out that the same page in the bug I link to below, also depends on
the default flex-shrink being 1.


On Tue, Mar 26, 2013 at 1:58 PM, Ojan Vafai <ojan@chromium.org> wrote:

> Now that we no longer default the min-size in the flex-direction to being
> min-content, I think we need to go back to having the default flex value
> being "0 0 auto". Having a default flex-shrink value made some sense when
> we wouldn't shrink below the min-content value by default, but now it means
> that common uses will shrink in ways that authors don't understand.
>
> We've already had one internal regression due to this:
> https://code.google.com/p/chromium/issues/detail?id=223542. We haven't
> pushed out a build with the min-size:0 change yet, so I expect we would
> hear about more regressions if we don't change both of these things at the
> same time. Anecdotally, I keep hearing from authors being confused by this.
>
> This simple case, now no longer does what most people would expect:
>
> <div style="display: -webkit-flex; width: 400px;">
>     <div style="width: 400px; height: 20px;"></div>
>     <div style="width: 12px; height: 20px;"></div>
> </div>
>
> The second div gets a width of 0px instead of overflowing the container
> due to the flex-shrink. It's confusing and unexpected that you need to set
> -webkit-flex in order to get the div to respect the explicit width that you
> set.
>
> Ojan
>
Received on Wednesday, 27 March 2013 19:22:21 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 27 March 2013 19:22:22 UTC