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

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 UTC