-
Notifications
You must be signed in to change notification settings - Fork 756
Open
Labels
Description
Spec links:
- https://www.w3.org/TR/css-flexbox-1/#alignment
- https://www.w3.org/TR/css-align-3/#self-alignment
- https://www.w3.org/TR/css-align-3/#default-alignment
Motivation
Alignment with CSS Grid is wonderfully symmetrical: you can align-items in one axis and justify-items in the other and this does exactly the same thing. Sadly the same cannot be said for Flexbox: align-items works nicely, but justify-items does nothing at all! I consider this undesirable for two reasons:
- It's confusing for people to have to remember that it's
-itemsin one axis and-contentin the other, and it makes the naming scheme seem arbitrary to the point that I've observed that a lot of people seem to give up on learning the rules behind the alignment property naming entirely. - It means that
place-shorthand syntax can't be used. Which would be particularly nice in order to be able to do things likeplace-items: centerin order to center a single-child of a Flexbox node. Of course one can do this with Grid. But it would be nice if this capability was more universally avaialable.
Proposal
It occurs to me that could be fixed. Specifically for the case when justify-content is stretch (which is of course the default) we could enable the justify-items property to take effect.
zhangenming