You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[css-flexbox-1] "flex" initial value seems to be coontradictory to "flex-grow" and "flex-shrink" #6639
In §7.1 of the current Editor's draft, "flex-grow" and "flex-shrink" both have an initial value of "1", while in "flex" shorthand the initial value is given as "0 1 auto" - this looks contradictory to me, as in this case the "flex-grow" value is "0". Could You correct or clarify, please?
The initial values of the flex components are equivalent to flex: 0 1 auto.
Note: The initial values of flex-grow and flex-basis are different from their defaults when omitted in the flex shorthand. This is so that the flex shorthand can better accommodate the most common cases.
so it's intentional that the value of flex-grow resolves to 0 if you use flex shorthand unless overriding flex-grow.
Thank You for Your quick answer! Probably the structure of §7 could be changed to something like §5? IMHO, starting the paragraph with "flex" shorthand, then explaining the different sub properties, and finally coming back to the shorthand is somewhat confusing, especially when having different initial values.
@pnabbefeld OK, we shifted the note up towards the top of the section so it's more obvious. :)
We didn't structure the flex section the same way because in this case we wanted to strongly recommend that authors use the shorthand rather than the longhands. (The longhands were mainly added to facilitate scripting, and because of the way they are defaulted, are more likely to get authors in trouble than using the shorthand.)
Activity
myakura commentedon Sep 18, 2021
you can find a note later in that section:
so it's intentional that the value of
flex-growresolves to 0 if you useflexshorthand unless overridingflex-grow.pnabbefeld commentedon Sep 18, 2021
Thank You for Your quick answer! Probably the structure of §7 could be changed to something like §5? IMHO, starting the paragraph with "flex" shorthand, then explaining the different sub properties, and finally coming back to the shorthand is somewhat confusing, especially when having different initial values.
[css-flexbox-1] Make note about initial vs default flex shorthand com…
fantasai commentedon Aug 18, 2022
@pnabbefeld OK, we shifted the note up towards the top of the section so it's more obvious. :)
We didn't structure the
flexsection the same way because in this case we wanted to strongly recommend that authors use the shorthand rather than the longhands. (The longhands were mainly added to facilitate scripting, and because of the way they are defaulted, are more likely to get authors in trouble than using the shorthand.)