Open fantasai opened 2 months ago
Copying over the key part of Tab's comment:
I've set down what I think is a reasonable definition (basically just restoring the old behavior from my draft) in https://drafts.csswg.org/css-grid-3/#masonry-intrinsic-repeat, along with an explanation of why the definition is the way it is.
See also earlier discussion in https://github.com/w3c/csswg-drafts/issues/9321
Yeah, my original draft's constraints meant that auto-sized repeats could be done completely correctly; there was no chance of spans covering different types of tracks. (You still had to ignore placement, of course, but it had less of an effect.)
Adapting that into this draft means that I can at best be heuristic. If you've only got span-1 items, it works correctly; if you do have all the tracks identical (which is what the initial value gives), it works correctly. It's only when you have a mixture of track sizes and spanning items that the heuristics have to kick in, and I think they still give a reasonable result.
Google's earlier Alternate Masonry Proposal—which didn't allow for mixed track sizing and constrained all content-sized tracks to be the same size—allowed
repeat(auto-fill, auto)
as a track listing, computingauto
as the largest [item size]/[span size].This definition doesn't work with mixed track sizes, because the amount that an item contributes to each track can differ based on what it's spanning. Filing this issue to ask if we can still add this value, and if so, what does it mean? Does it also work in grid layout?
Note: There's a separate, but related, issue about what the initial track listing should be, and whether it should be this.