Skip to content

Commit 4c8e12e

Browse files
committed
layouts: apply the page top margin once
It was set as both a margin and a padding, so every page carried double. The 404 height calc had been tuned around the doubled value, so it is rewritten off the header height and the real spacing.
1 parent 1c76325 commit 4c8e12e

2 files changed

Lines changed: 5 additions & 10 deletions

File tree

src/layouts/Layout.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ const fullTitle = title.includes("|")
153153
gap: var(--space-2xl);
154154
padding: var(--page-top-margin) var(--mobile-padding-inline)
155155
var(--space-2xl);
156-
margin: var(--page-top-margin) auto 0;
156+
margin: 0 auto;
157157
width: 100%;
158158
max-width: var(--content-max-width);
159159
flex: 1 0 auto;

src/pages/404.astro

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ const { t, localizeHref, localizeNumber } = Astro.locals;
3838
display: flex;
3939
align-items: center;
4040
justify-content: center;
41-
min-height: calc(100svh - (var(--page-top-margin) * 2) - 4.5rem);
41+
min-block-size: calc(100vh - var(--header-height) - var(--page-top-margin));
42+
min-block-size: calc(
43+
100dvh - var(--header-height) - var(--page-top-margin)
44+
);
4245
flex: 1;
4346
}
4447

@@ -82,12 +85,4 @@ const { t, localizeHref, localizeNumber } = Astro.locals;
8285
.quick-links a {
8386
font-weight: var(--font-weight-semibold);
8487
}
85-
86-
@media (width >= 600px) {
87-
.error-container {
88-
min-height: calc(
89-
100vh - (var(--page-top-margin) * 5)
90-
); /* makes the footer be offscreen */
91-
}
92-
}
9388
</style>

0 commit comments

Comments
 (0)