Re: [csswg-drafts] [css-grid-3][masonry] item-flow row vs. column in masonry layouts (#12803)

Thanks for the slides! 

Digging into this a bit more, I feel pretty strongly that the _layout shape_ approach is an unreliable distraction. While yes, on first glance I expect to ask for "masonry columns" and get a waterfall default, I also expect to ask for "grid columns" in order to get the current default grid layout. But I don't, because all the current `flow` properties are defined by item placement, not layout shape. 

And that's good! Not because it's my instinct, but because it's reliable. The slides show a grid sample that has visible 'rows', but achieving that is _entirely dependent_ on setting explicit columns, and mostly avoiding items that span multiple rows. Both the default (single column) and any grid with complex row-span items is likely to _appear_ as a column-forward layout. That includes the approach I use currently to achieve something masonry-like in grid. The flow is across rows, literally `grid-auto-flow: row`, but the row-spanning items make it appear as a column-forward waterfall.

The shape and flow of grid layout _only sometimes_ match. But `grid-auto-flow` defines the flow, not the shape. 

https://codepen.io/editor/miriamsuzanne/pen/019a0d25-32ee-7322-a0ce-b5b9b8b71e7c

I don't find this _intuitive_, but I do find it _consistent_ and _reliable_. And I think it would be a bad idea to change this for masonry-layout only. _Even though_ a quick glance gives the wrong intuition.

And I don't find it convincing to say the default waterfall is defined with `grid-template-columns`, and the explicit positioning in that waterfall uses `grid-column` and therefor we need the flow to be `column` – because _that same logic could be applied to most grids_. By far the majority of my grid use-cases are column-forward. I define template-columns, and place items into those columns, and yet the default flow is `row`. Was that the right choice? I don't know. But if we can't change it for grid, we shouldn't try and change it for compact/masonry-grid either.

So I'm pushing for `item-flow` in compact/masonry grids to _also_ follow the flow of items, and not the layout shape. Because of that, I also think `item-flow` is the right term to use. It's the term that makes me question my otherwise layout-forward intuition.

This is a vote for "A" on the first quiz. It maintains a `row` default, matching both the flexbox and grid defaults – while giving us the expected waterfall layout, in a single column by default. And (just like grid) that can be expanded to multiple columns with `grid-column-templates`, and (just like grid) items flow into those new columns first. And (just like grid) we call this a `row`-based flow.

I think that same logic translates to a vote for "B" in the second quiz. If we're considering this an extension of grid, we should match grid defaults and language as closely as possible.

-- 
GitHub Notification of comment by mirisuzanne
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12803#issuecomment-3433887217 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 22 October 2025 19:20:56 UTC