Skip to content

Commit df2e2c7

Browse files
committed
masonry
1 parent bc34577 commit df2e2c7

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

apps/angular-app/src/pages/components/components.component.css

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,31 @@
1313
}
1414

1515
.components-grid {
16-
display: grid;
17-
gap: 2rem;
18-
grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
16+
column-count: 3;
17+
column-gap: 1rem;
18+
}
19+
20+
.components-grid > m3-card {
21+
display: inline-block;
22+
width: 100%;
23+
break-inside: avoid;
24+
page-break-inside: avoid;
25+
}
26+
27+
/* Responsive layout - makes a two column-layout instead of four columns */
28+
@media screen and (max-width: 1000px) {
29+
.components-grid {
30+
column-count: 2;
31+
column-gap: 2rem;
32+
}
33+
}
34+
35+
/* Responsive layout - makes the two columns stack on top of each other instead of next to each other */
36+
@media screen and (max-width: 600px) {
37+
.components-grid {
38+
column-count: 1;
39+
column-gap: 2rem;
40+
}
1941
}
2042

2143
.actions {

0 commit comments

Comments
 (0)