w3c / csswg-drafts

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

[css-grid-3][masonry] Initial value of track listing for masonry grid axis #10869

Open fantasai opened 1 month ago

fantasai commented 1 month ago

The initial value of grid-template-columns is none, which ends up creating as many tracks as there are template areas, sizing them per grid-auto-columns.

Tab's Alternate Masonry Proposal instead uses an initial value of repeat(auto-areas, auto) which repeats auto to match the template areas (ignoring masonry-auto-tracks), and falls back to repeat(auto-fill, auto)... which is technically not defined atm, since auto depends on explicit placement.

What should the initial track listing be for masonry layout?

tabatkins commented 1 month ago

Yeah, we lost the definition of how to handle intrinsic track sizes during repetition when we figured out the compromise layout algorithm. 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.

This has been spot-reviewed by @bfgeek, but not yet by the MS engineers actually doing the experimental implementation.

fantasai commented 1 month ago

OK, split out the question of whether/how to define auto-repeats into https://github.com/w3c/csswg-drafts/issues/10915 ; leaving this issue to just the question of what the initial value should be (assuming both are possible).