Skip to content

[css-grid-3] Should align-self/justify-self: stretch override explicit size? #13950

@celestepan

Description

@celestepan

CSS Grid and CSS Flex both ignore align-self: stretch and align-items: stretch when an item has a specified size. Part of our motivations in this discussion: #10275 (comment) were to fill out the masonry layout visually, avoiding empty bottoms.

Generally, it makes sense to me that web authors would just expect the same behavior as CSS Flex and CSS Grid, and not specify item sizes when also applying align-items: stretch to them. The concern I have here is a case where authors want uniformly-sized items, but want the last row to fill out the page with stretch. If we ignore the explicit sizes, we would end up with:
Image

while if we were to follow the explicit sizes we'd get something more like:
Image

I think it makes sense to respect explicit sizes -- if an author is specifying explicit sizes, it's likely that they want to maintain that specific size of the item throughout the layout. It would also be the most expected behavior, in parity with CSS Grid and CSS Flex.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions