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

This is already a very heated debate, so I'll keep it short. I want express my strong support for adding masonry to `display:grid`. The fact that it gracefully degrades to a traditional grid is a huge benefit IMO.

But also, masonry layout is *already* possible (with some constraints) in Grid layout *today*!

I came up with this example of a masonry layout with pure CSS using grid layout. 
- https://codepen.io/naman34/pen/ZEgzKzE

What were the compromises?
1. The need to know the height of each time ahead of time.
2. Because this relies `grid-row: span N` to work, `row-gap` had to be 0 for the math to work, and I had to use hacks for recreating `row-gap`.

Honestly, even I'm surprised how far we can go with grid layout already. IMO, my solution is ready for production in many cases. 

And since grid *already* does masonry, I think it makes sense to improve the experience of doing that rather than invent a whole new display mode.

---

Even if there is vehement disagreement, I hope my demo is interesting.

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


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

Received on Saturday, 21 September 2024 05:00:33 UTC