Skip to content

Commit 1de5729

Browse files
authored
Merge pull request #2608 from canonical/WD-37055-css-styles-broken-on-canonical-com-home-page-on-some-ios-mobile-devices
Wd 37055 css styles broken on canonical com home page on some ios mobile devices
2 parents 8591045 + 1cbfd32 commit 1de5729

1 file changed

Lines changed: 28 additions & 4 deletions

File tree

static/sass/_pattern_homepage.scss

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,21 +134,45 @@
134134
}
135135

136136
.p-homepage-card {
137-
background-color: #202020; /* dark background */
137+
background-color: #202020;
138138
padding: 0;
139-
border: 1px solid rgb(255 255 255 / 10%); /* subtle border */
139+
border: 1px solid rgb(255 255 255 / 10%);
140140
justify-content: space-between;
141141
align-items: center;
142142
}
143143

144144
.p-homepage-blog-card {
145-
background-color: #202020; /* dark background */
146-
border: 1px solid rgb(255 255 255 / 10%); /* subtle border */
145+
background-color: #202020;
146+
border: 1px solid rgb(255 255 255 / 10%);
147147
padding: 0;
148+
148149
@media screen and (width < $breakpoint-large) {
149150
padding-bottom: 0;
150151
}
151152

153+
// On small screens Vanilla collapses the image, title and excerpt into a
154+
// single subgrid column, which overlaps (excerpt over title) on some
155+
// iOS/Safari builds. Lay the card out with flexbox there instead — medium
156+
// and large keep Vanilla's equal-height grid (image left / text right)
157+
// untouched. Qualifying with `&.p-equal-height-row__col` raises specificity
158+
// above Vanilla's `.p-equal-height-row .p-equal-height-row__col`, so these
159+
// win without `!important`.
160+
@media screen and (width < $breakpoint-small) {
161+
&.p-equal-height-row__col {
162+
display: flex;
163+
flex-direction: column;
164+
// Opt out of the 4-row subgrid span, and stop the card stretching to
165+
// fill its grid track — otherwise a taller card grows down into the
166+
// next one and swallows the gap between them.
167+
grid-row: auto;
168+
align-self: start;
169+
}
170+
171+
& + & {
172+
margin-top: 1.5rem;
173+
}
174+
}
175+
152176
a {
153177
color: var(--vf-color-link-default);
154178
}

0 commit comments

Comments
 (0)