Skip to content

[css-flexbox][css-align] Support justify-items for flexbox containers (and justify-self for items) #9495

Open
@nicoburns

Description

@nicoburns

Spec links:

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 -items in one axis and -content in 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 like place-items: center in 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions