Skip to content

Commit 456bbc5

Browse files
committed
index: give the hero the whole first screen
Out of flow it cleared the header by hand and `.main-content` reserved its space, so the logo sat under the header and off-centre, the text could run into the next section on short viewports, and the section stopped short of filling the screen on phones. Back in flow the layout clears the header and reserves the hero's space on its own; sizing it to the screen below the header does the rest. The fixed inline insets go too, so the hero follows the content column.
1 parent 4c8e12e commit 456bbc5

1 file changed

Lines changed: 3 additions & 27 deletions

File tree

src/pages/index.astro

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,6 @@ const { t, localizeHref } = Astro.locals;
126126
</Layout>
127127

128128
<style>
129-
:root {
130-
--hero-min-height: calc(75vh + 3rem);
131-
}
132-
133-
@supports (height: 100dvh) {
134-
:root {
135-
--hero-min-height: calc(75dvh + 3rem);
136-
}
137-
}
138-
139129
h2 {
140130
font-size: var(--font-size-3xl);
141131
color: var(--heading-color);
@@ -162,29 +152,15 @@ const { t, localizeHref } = Astro.locals;
162152
mask-image: radial-gradient(ellipse at center, black 60%, transparent 100%);
163153
}
164154

165-
.main-content {
166-
position: relative;
167-
margin-top: calc(
168-
var(--hero-min-height) - var(--page-top-margin)
169-
) !important;
170-
}
171-
172155
.index-hero {
173-
position: absolute;
174-
top: 3rem;
175-
inset-inline: 5rem;
176-
min-height: var(--hero-min-height);
156+
margin-block-start: calc(-1 * var(--page-top-margin));
157+
min-block-size: calc(100vh - var(--header-height));
158+
min-block-size: calc(100dvh - var(--header-height));
177159
}
178160

179161
#about-monero,
180162
#start-using-monero,
181163
#get-involved {
182164
scroll-margin-block-start: var(--anchor-offset);
183165
}
184-
185-
@media (width <= 600px) {
186-
.index-hero {
187-
inset-inline: 2rem;
188-
}
189-
}
190166
</style>

0 commit comments

Comments
 (0)