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

As I did outline in [my comment](https://github.com/w3c/csswg-drafts/issues/10233#issuecomment-2074484643) in https://github.com/w3c/csswg-drafts/issues/10233, I will need to find more time to elaborate on why I think masonry could still be a part of CSS grid (but maybe in a less magical form), and how there are many non-masonry cases for one-dimensional grids.

For now, I want to quickly respond to two points:

> There is at least one feature in Grid that doesn't make sense in Masonry (`grid-template-areas`)

There are multiple use cases for template-areas in one-dimensional grids, I did write an article about one of them: [“Grid Projection Naming”](https://kizu.dev/grid-projection-naming/). If anything, having an ability to have one of the dimensions removed from a grid could allow for more flexible and usable `grid-template-areas` for such grids.

> More specifically, consider `grid-template-columns: 100px auto auto auto 50px`, an item with `width: 100px` spanning 3 columns has 3 different possible contributions to the 3rd track. If it's placed at the beginning of the 1st track, it will contribute `0px` to the 3rd column; if it's placed at the beginning of the 2nd column it will contribute `33.33px`; finally, if placed at the beginning of the 3rd track, it will contribute `25px`.

I really think that spanning items should _not_ contribute to the width of the columns in masonry. Even in a regular grid this is the behavior that I find unnecessary and often harmful, and I don't think there are many legit use cases for wanting this in a masonry layout. As an author, when I want some element to span other columns/rows, I want it to _adapt_ to whatever there is, not to _contribute_. (After writing this, I found https://github.com/w3c/csswg-drafts/issues/10053 which talks about this point, I'll copy this part there.)

-- 
GitHub Notification of comment by kizu
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9041#issuecomment-2074586448 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 10:05:57 UTC