w3c / csswg-drafts

CSS Working Group Editor Drafts
https://drafts.csswg.org/
Other
4.5k stars 668 forks source link

[css-grid-3][masonry] Prioritize tracks that don't create overflow #10088

Open fantasai opened 8 months ago

fantasai commented 8 months ago

Pulling out @ethanjv's comment:

Btw we might want to consider that, in the current draft of masonry, having definite tracks mixed with intrinsic tracks might result in some items overflowing the spanning tracks in the grid axis. E.g., if we have a grid-template-columns: 50px auto definition, if we have two auto placed items, the first one with a min-content size of 100px and the other with 50px, the first will be placed in the first column and overflow it, then the second would be placed in the auto track.

Maybe we want to prioritize placing a grid item in a track that won't overflow?

fantasai commented 8 months ago

There's two ways to address this use case: