Skip to content

Commit 3e4c1fb

Browse files
authored
Merge pull request #1246 from doradocodes/1228-2.0
fix: adjust landscape hero images to fill header on mobile (#1222)
2 parents 86d9192 + fea7c0c commit 3e4c1fb

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

src/components/PageHeader/HomePage.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const { config } = Astro.props;
4141
im.linkTarget ?
4242
<a href={im.linkTarget} class={`max-lg:flex-1 max-lg:min-h-0 hero-image-container ${i > 0 ? "hidden" : ""}`}>
4343
<Image
44-
containerClass={"relative"}
44+
containerClass={"relative h-full"}
4545
class={"hero-image"}
4646
aspectRatio="none"
4747
src={im.image}
@@ -80,4 +80,4 @@ const { config } = Astro.props;
8080
}
8181
}
8282
});
83-
</script>
83+
</script>

styles/global.scss

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ code {
207207
background-color: var(--bg-gray-80);
208208
border-radius: 20px;
209209
padding: 0 var(--spacing-xxs);
210-
211210
.dark-theme &:not(.code-box) {
212211
color: var(--type-black);
213212
}
@@ -231,18 +230,16 @@ section,
231230
h2,
232231
.text-h2 {
233232
margin-top: var(--gutter-md);
234-
margin-bottom: var(--spacing-md);
233+
margin-bottom: 0px;
235234
}
236235

237236
h2,
238237
.text-h2,
239238
h3,
240239
text-h3 {
241-
242240
&,
243-
&>* {
241+
& > * {
244242
scroll-margin-top: var(--gutter-md);
245-
246243
@media (min-width: $breakpoint-tablet) {
247244
scroll-margin-top: var(--gutter-sm);
248245
}
@@ -272,7 +269,6 @@ section,
272269
overflow-x: auto;
273270

274271
border-radius: 20px;
275-
276272
@media (max-width: $breakpoint-tablet) {
277273
border-radius: 10px;
278274
}
@@ -477,15 +473,11 @@ th {
477473
border-bottom-width: 1px;
478474
border-top-width: 1px;
479475

480-
// Fix #1061: On mobile/tablet (< 1024px) the outer wrapper is a flex column
481-
// and the image container is flex-1. height: 100% fills the remaining header
482-
// space exactly — no overflow into the h1 below, no gap on tall devices.
483476
@media (max-width: #{$breakpoint-laptop - 1px}) {
484477
height: 100%;
485478
max-height: none;
486479
min-height: 180px;
487480
}
488-
489481
@media (min-width: $breakpoint-tablet) {
490482
left: calc(-1 * var(--spacing-lg));
491483
width: calc(100% + var(--spacing-lg) * 2);
@@ -499,7 +491,6 @@ hr.full-bleed {
499491
left: -2.5rem;
500492
width: calc(100% + 5rem);
501493
max-width: calc(100% + 5rem);
502-
503494
@media (min-width: $breakpoint-tablet) {
504495
left: calc(-1 * var(--spacing-lg));
505496
width: calc(100% + var(--spacing-lg) * 2);
@@ -519,13 +510,10 @@ input[type="search"]::-webkit-search-results-decoration {
519510
.no-scrollbar::-webkit-scrollbar {
520511
display: none;
521512
}
522-
523513
/* Hide scrollbar for IE, Edge and Firefox */
524514
.no-scrollbar {
525-
-ms-overflow-style: none;
526-
/* IE and Edge */
527-
scrollbar-width: none;
528-
/* Firefox */
515+
-ms-overflow-style: none; /* IE and Edge */
516+
scrollbar-width: none; /* Firefox */
529517
}
530518

531519
/** SPECIAL ELEMENTS **/

0 commit comments

Comments
 (0)