3 ms·
I’ll admit that I was skeptical at first about including masonry in the CSS Grid spec. After reading through the article, I’m convinced it is the right path fo
by branmcconnell 2y ago
I’ll admit that I was skeptical at first about including masonry in the CSS Grid spec.
After reading through the article, I’m convinced it is the right path forward, allowing masonry layouts to utilize the same APIs and properties (columns/rows, gap, etc.) as CSS Grid.
This would lower the bar of entry by using familiar APIs and allow simpler switching between masonry and other column/row setups responsively.
```css
.example {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
grid-template-rows: auto;
@media (width > 500px) {
grid-template-rows: masonry;
}
}
```