Re:Help us invent CSS Grid Level 3, a.k.a. "Masonry" layout
by jampekka on Tuesday April 23, 2024 @08:06AM
(#40130972)
JS masonry libraries, e.g. masonry.js, can and typically do use the HTML for the content and just lay it out similarly to what CSS does.
Re:Help us invent CSS Grid Level 3, a.k.a. "Masonry" layout
by rezonant on Tuesday April 23, 2024 @12:56PM
(#40134133)
But the screen size is an important part of how the library will lay out the bricks, and that isn't known until JS runs (this can kind of be done with client hints, but not on initial page load)
This is where a proper solution to this problem shines: After all, when you are on mobile (at least 60% of your users), they will get a single column anyway. Any solution that doesn't solve for them is a nonstarter.
That being said, it is the slow loading of JS and the folks using truly modern browsers with JS turned off that are more common, and for those people this isn't a problem.