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

Re: [css3-flexbox] ambiguity in flex shorthand?

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 21 Mar 2013 09:47:17 -0700
Message-ID: <CAAWBYDAHNJydOvJKad5SjsXHbCb9vtv7bKcwxx-XC3SWtpWSAQ@mail.gmail.com>
To: Daniel Glazman <daniel.glazman@disruptive-innovations.com>
Cc: www-style list <www-style@w3.org>
On Thu, Mar 21, 2013 at 9:22 AM, Daniel Glazman
<daniel.glazman@disruptive-innovations.com> wrote:
> On 21/03/13 17:05, Christian Biesinger wrote:
>> At the end of the section, the spec says "A unitless zero that is not
>> already preceded by two flex factors must be interpreted as a flex
>> factor. To avoid misinterpretation or invalid declarations, authors
>> must specify a zero <flex-basis> component with a unit or precede it
>> by two flex factors."
>
> Ah thanks, I missed it. So this means that
>
>   flex: 1px 1 2
>
> is allowed but
>
>   flex: 0 1 2 (where 0 is the flex basis)
>
> is not. I understand we don't have an ambiguity in the spec but
> honestly, that's not very nice. Can I ask why we just can't forbid
> unitless lengths here and make the whole thing simpler? We've always
> said in the past that unitless 0 length was tolerated but not
> encouraged.

Because there's no reason to, shrug.  Any time you write a 0 flex
basis in the shorthand, you can instead just omit it.

~TJ
Received on Thursday, 21 March 2013 16:48:04 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:07 GMT