Re: [csswg-drafts] Alternate masonry path forward (#9041)

> grid-template-areas works fine and is usable in Masonry

I don't agree that it works "fine". It *works*, in theory, but it's awkward to use and allows you to write things that don't make sense in a Masonry context.

"awkward" because you have to do something completely different if the masonry has columns vs rows. When it's columns, you just write `grid-template-areas: "foo bar baz";`, easy, but when it's rows you have to write `grid-template-areas: "foo" "bar" "baz";`.

Similarly, and perhaps worse, if you use `grid-template` so you can size and name the tracks at the same time, the sizing values go in completely different places: `grid-template-areas: "foo bar baz" 10px 20px 1fr;` vs `grid-template-areas: "foo" 10px "bar" 20px "baz" 1fr;`.

And "don't make sense" in that you can write `grid-template-areas: "foo foo" "bar bar";` to define a 2x2 explicit grid, but Masonry has, *at best*, an Nx1 (or 1xN) explicit grid. We'd have to ignore all but the first track in one of the axises, rather than being able to reject that at parse time as a syntax error.

-------

> and there's an issue open (https://github.com/w3c/csswg-drafts/issues/10231) on merging masonry-auto-flow and grid-auto-flow which may make that point moot.

I think this would, similarly, be a bad idea. Masonry and Grid have slightly different things that they care about for auto flowing controls; if we put them both in the same property, we either have to bodge the different behaviors into the same keywords even when they're not ideal, or define layout-specific keywords and give them some fallback behavior when they're specified for the wrong layout. Again, being able to reject bad syntax at parse time is better.

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


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

Received on Wednesday, 24 April 2024 15:37:40 UTC