This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
In section 7.1, The ‘flex’ Shorthand: http://www.w3.org/TR/css3-flexbox/#flex-property The flex-grow description ends with "When omitted, it is set to ‘1’" However the default for flex-grow is 0: http://www.w3.org/TR/css3-flexbox/#flex-grow It seems like a copy/paste issue from flex-shrink which does have a default of 1.
Nope, that's the intended behavior. The initial values are set up to give us the default behavior of "0 1 auto", but they're not the best values for when you actually start using the shorthand. So, we substitute missing values specially, rather than relying on the normal "use the initial value" behavior.
Odd, thats not how I've used CSS shorthand properties before... --- http://www.w3.org/TR/CSS21/fonts.html#propdef-font Because the 'font' shorthand property resets any property not explicitly given a value to its /initial/ value. --- http://www.w3.org/TR/CSS21/box.html#propdef-border-left Omitted values are set to their /initial/ values. --- http://www.w3.org/TR/CSS21/colors.html#propdef-background Given a valid declaration, the 'background' property first sets all the individual background properties to their /initial/ values, then assigns explicit values given in the declaration. --- Those are the first three that come to mind, and all use the initial value... so for consistency the flex shorthand should do as well.
Yes, like I said, it's different from normal shorthand behavior, and intentional. It's because there's a mismatch between what we want as the "initial" value, and what we want as the "default" values when omitted. In most properties, the two concepts are the same.
Not sure I like that, I was experimenting with the flexbox approach today and tried to use the spec to understand what was happening... I initially misread it as the "grow" property should have been set to 1 by default. Will leave it as resolved, as I presume this has already been implemented in the browsers. Maybe the document should say: When omitted, it is set to '1', although the default is '0'.
(In reply to comment #4) > Maybe the document should say: > > When omitted, it is set to '1', although the default is '0'. There is already a note to that effect at the end of section 7.1.