Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-grid-3][masonry] Make auto-fit do things #10274

Open
fantasai opened this issue May 1, 2024 · 0 comments
Open

[css-grid-3][masonry] Make auto-fit do things #10274

fantasai opened this issue May 1, 2024 · 0 comments

Comments

@fantasai
Copy link
Collaborator

fantasai commented May 1, 2024

As Tab pointed out in #9041 (comment), auto-fit repeat value is currently defined to behave identically to auto-fill in masonry. See https://drafts.csswg.org/css-grid-3/#repeat-auto-fit

repeat(auto-fit) behaves as repeat(auto-fill) when the other axis is a masonry axis.

AFAICT the rationale was that we can't redistribute space to the other tracks since placement depends on sizing in masonry layouts.

However, that doesn't mean we can't use the alignment properties to redistribute space, so I think we should allow auto-fit to drop columns just as is does in regular Grid layout, and just forbid it from looping back into the track sizing algorithm.

This means that, for example, if you have a masonry grid with 3 items but you could fit 6 columns, we'd drop the extra 3 columns and allow you to use justify-content: space-around to distribute the columns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant