Skip to content

Commit 9d0c584

Browse files
committed
Sticky footer: flex-column layout so short pages don't leave a blank band
Replace main's min-height:60vh + footer's 96px top margin (which floated the footer in whitespace on short/filtered pages) with a flex-column body and a growing main, so the footer sits at the viewport bottom when content is short and flows naturally when it's long.
1 parent c099e76 commit 9d0c584

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/layouts/Base.astro

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ const canonical = path ? new URL(path, Astro.site).href : undefined;
6161
font: 400 15px/1.55 var(--font-sans);
6262
-webkit-font-smoothing: antialiased;
6363
min-height: 100vh;
64+
display: flex;
65+
flex-direction: column;
6466
}
6567
a { color: inherit; }
6668
::selection { background: #dbeafe; }
@@ -108,9 +110,9 @@ const canonical = path ? new URL(path, Astro.site).href : undefined;
108110
padding-left: 8px; border-left: 1px solid var(--gray-200);
109111
}
110112

111-
main { min-height: 60vh; }
113+
main { flex: 1 0 auto; padding-bottom: 72px; }
112114

113-
footer.site { border-top: 1px solid var(--gray-100); margin-top: 96px; position: relative; z-index: 1; background: var(--white); }
115+
footer.site { border-top: 1px solid var(--gray-100); position: relative; z-index: 1; background: var(--white); }
114116
footer.site .container {
115117
height: 56px; display: flex; align-items: center; gap: 24px;
116118
font-family: var(--font-mono); font-size: 12px; color: var(--gray-400);

0 commit comments

Comments
 (0)