Skip to content

[css-grid][masonry] repeat(auto-areas) #10854

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

Open
fantasai opened this issue Sep 9, 2024 · 4 comments
Open

[css-grid][masonry] repeat(auto-areas) #10854

fantasai opened this issue Sep 9, 2024 · 4 comments
Labels

Comments

@fantasai
Copy link
Collaborator

fantasai commented Sep 9, 2024

Tab's Alternate Masonry Proposal introduced a new auto-areas keyword for the repeat() function, which repeats the given track listing as many times as necessary to accommodate the named template areas.

Opening this issue to discuss whether we want to add it to Grid/Masonry.

Note that the effective grid/masonry-auto-[tracks] property applies to this case already.

@tabatkins
Copy link
Member

Elika pointed out privately a feature of Grid 1 that I'd completely forgotten about (described in the section they link) - the explicit grid is sized by the larger of grid-template-areas and grid-template-rows/columns. If grid-template-areas gives a longer list in an axis than you've provided via grid-template-rows/columns, then the remaining tracks are sized by grid-auto-rows/columns, but are still considered part of the explicit grid.

So, auto-areas isn't actually needed for the purpose of filling in tracks to match the areas list; the existing initial values of the relevant properties work just fine.

However, auto-areas does one additional important thing, which is fall back to auto-fill if there are no named areas; this is not done by the default Grid values. This means that, by default, a masonry will fill with as many auto columns as it can fit (and it can tell how large auto is since its placement and sizing are intertwined). This isn't done in Grid - by default, a Grid will end up with an empty explicit grid, and an implicit grid sized to either the largest span or the largest definition position.

I think this remains an ideal default behavior for Masonry containers.

@fantasai
Copy link
Collaborator Author

fantasai commented Sep 10, 2024

@tabatkins I think deciding the initial value of the tracks for masonry is a separate issue, please file it separately. ^_^

@tabatkins
Copy link
Member

Regardless of whether it's the initial value or not, my comment still stands here - it provides a useful behavior for Masonry that is not reproducible without the value.

@fantasai fantasai removed the Agenda+ label Sep 11, 2024
@mirisuzanne
Copy link
Contributor

It does seem to me like this value might be useful in both masonry and non-masonry tracks. But I would expect it to fall back to auto-fit rather than auto-fill. I find it's very uncommon for authors to want extra empty tracks, when there's no content to put in those tracks.

tabatkins added a commit that referenced this issue Sep 27, 2024
noamr pushed a commit to noamr/csswg-drafts that referenced this issue Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants