Skip to content

Commit 78e0d4f

Browse files
committed
chore(masonry): Add media queries to masonry cards
1 parent 114ef19 commit 78e0d4f

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This was inspired by [this tutorial](https://www.joshmorony.com/creating-a-pinterest-layout-in-ionic/) created by Josh Morony.

src/pages/miscellaneous/masonry-cards/masonry-cards.scss

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ page-masonry-cards {
33
column-count: 2;
44
}
55

6+
67
.pin {
78
display: inline-block;
89
}
@@ -24,4 +25,26 @@ page-masonry-cards {
2425
padding: 8px;
2526
border-bottom: 1px solid #eee;
2627
}
28+
29+
// Media queries
30+
@media (min-width: 480px) {
31+
.pins {
32+
column-count: 3;
33+
}
34+
.item ion-avatar img {
35+
width: 7vw !important;
36+
height: 7vw !important;
37+
}
38+
}
39+
40+
@media (min-width: 640px) {
41+
.pins {
42+
column-count: 4;
43+
}
44+
.item ion-avatar img {
45+
width: 5vw !important;
46+
height: 5vw !important;
47+
margin: 6px;
48+
}
49+
}
2750
}

src/pages/miscellaneous/miscellaneous.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class MiscellaneousListPage {
4141
page: 'FlashCardPage'
4242
},
4343
{
44-
title: 'Masonry Cards',
44+
title: 'Pinterest Masonry Cards',
4545
page: 'MasonryCardsPage'
4646
},
4747
{

0 commit comments

Comments
 (0)