Skip to content

Commit 74003aa

Browse files
card container overflow method (#13434)
* use flex * formatting * add comment
1 parent cb495e9 commit 74003aa

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

website/components/io-card-container/style.module.css

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,11 @@
5757
--columns: var(--length);
5858

5959
position: relative;
60-
display: grid;
61-
grid-template-columns: repeat(var(--columns), minmax(var(--minCol), 1fr));
6260
gap: 32px;
6361
padding: 0;
6462

6563
@media (--small) {
64+
display: flex;
6665
overflow-x: auto;
6766
-ms-overflow-style: none;
6867
scrollbar-width: none;
@@ -71,6 +70,19 @@
7170
left: 50%;
7271
margin-left: -50vw;
7372
width: 100vw;
73+
74+
/* This is to ensure there is overflow padding right on mobile. */
75+
&::after {
76+
content: '';
77+
display: block;
78+
width: 1px;
79+
flex-shrink: 0;
80+
}
81+
}
82+
83+
@media (--medium-up) {
84+
display: grid;
85+
grid-template-columns: repeat(var(--columns), minmax(var(--minCol), 1fr));
7486
}
7587

7688
&.threeUp {
@@ -95,17 +107,8 @@
95107
display: flex;
96108

97109
@media (--small) {
110+
flex-shrink: 0;
98111
width: 250px;
99-
100-
&:last-of-type {
101-
width: 274px;
102-
103-
&::after {
104-
content: '';
105-
width: 24px;
106-
flex-shrink: 0;
107-
}
108-
}
109112
}
110113
}
111114
}

0 commit comments

Comments
 (0)