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

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 16 Sep 2011 11:17:20 -0700
Message-ID: <CAAWBYDDocQUe_fXDcz71+7-szuNK=uKYzMz4SuTjVxEFJvbRug@mail.gmail.com>
To: www-style list <www-style@w3.org>
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.


Received on Friday, 16 September 2011 18:18:08 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:49 UTC