Show HN: Magic Grid – A simple JavaScript library for dynamic grid layouts
1–10 of 41 posts
Re: Show HN: Magic Grid – A simple JavaScript library for dynamic grid layouts
#2Re: Show HN: Magic Grid – A simple JavaScript library for dynamic grid layouts
#3Re: Show HN: Magic Grid – A simple JavaScript library for dynamic grid layouts
#4And the reason to use this over built-in CSS grids is...
Re: Show HN: Magic Grid – A simple JavaScript library for dynamic grid layouts
#5Neat. We use Masonry [1] although I’m not the biggest fan of it. How does this library compare? [1] https://github.com/desandro/masonry
Re: Show HN: Magic Grid – A simple JavaScript library for dynamic grid layouts
#6And the reason to use this over built-in CSS grids is...
Re: Show HN: Magic Grid – A simple JavaScript library for dynamic grid layouts
#7And the reason to use this over built-in CSS grids is...
Re: Show HN: Magic Grid – A simple JavaScript library for dynamic grid layouts
#8And the reason to use this over built-in CSS grids is...
Re: Show HN: Magic Grid – A simple JavaScript library for dynamic grid layouts
#9And the reason to use this over built-in CSS grids is...
When the components in a grid have different heights, a single longer or shorter component stretches the whole row or leaves unpleasant whitespace at the bottom.
It isn't as optimal a layout system as you can get with javascript but generally so long as all elements are at least half the height of other members of a row it doesn't look offensively bad. And there is room for more sophisticated layout algorithms in the future.
And it generally isn't that hard to pad grid items to be multiples of a common height so they can organically fill consistently.
Re: Show HN: Magic Grid – A simple JavaScript library for dynamic grid layouts
#10As mentioned, Masonry[1] is the other famous library for doing this. Magic Grid also has a Vue port[2] if you're into that.
[EDIT] - PR just got merged, explanation of this stuff is on the Github README now
[0]: https://github.com/rachelandrew/cssgrid-ama/issues/19