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

Re: [css3-flexbox] Behavior of flex() in non-flex situations

From: Ojan Vafai <ojan@chromium.org>
Date: Fri, 16 Sep 2011 11:26:20 -0700
Message-ID: <CANMdWTsc6E4XT53VFpO-6bo9m+6UFW8qHUft4=XxM9TPKh7_jQ@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: www-style list <www-style@w3.org>
On Fri, Sep 16, 2011 at 11:17 AM, Tab Atkins Jr. <jackalmage@gmail.com>wrote:

> How should we treat an element using flex() in its 'width' or 'height'
> when it's not a flexbox item?  The most obvious answer (to make it a
> syntax error) isn't available to us, because we don't know whether
> it's invalid or not until computed value time.
> I see two reasonable answers:
> 1. It computes to 'auto'.
> 2. It computes to the preferred length in the function.
> I prefer #2.  It seems to stay closer to the author's intent - if they
> wrote "width: flex(1 200px);" for a flexbox item, they're saying the
> item should start at 200px, and then flex larger if there's free
> space.  If you're in a context that can't flex, there's no free space,
> so it should just stay at 200px.
> I'd like to require authors not to use flex() outside of flexbox
> items, but define the UA handling as #2.
> Thoughts?

I prefer 2 as well. It's what WebKit's implementation does currently as that
was the most natural way to implement it.

Received on Friday, 16 September 2011 18:27:14 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:50:06 UTC