Skip to content

Commit 368feb3

Browse files
author
Kevin Allioli
committed
refactor: switch header from fixed to sticky, remove compensating offsets
Fixed positioning required padding-top on every page container to avoid content going under the header. Sticky keeps the header in flow so those offsets are no longer needed.
1 parent 9305069 commit 368feb3

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

static/style.css

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ body {
8484

8585
/* ── Header ─────────────────────────────────────────────────────────────────── */
8686
header {
87-
position: fixed;
88-
top: 0; left: 0; right: 0;
87+
position: sticky;
88+
top: 0;
8989
z-index: 100;
9090
height: 70px;
9191
display: flex;
@@ -157,11 +157,10 @@ header {
157157
/* ── Index page layout ──────────────────────────────────────────────────────── */
158158
.index-layout {
159159
flex: 1;
160-
height: 100vh;
160+
height: calc(100vh - 70px);
161161
overflow: hidden;
162162
display: flex;
163163
flex-direction: column;
164-
padding-top: 70px;
165164
}
166165

167166
.index-hero {
@@ -683,7 +682,7 @@ kbd {
683682
}
684683

685684
.paste-layout {
686-
padding-top: 98px;
685+
padding-top: 28px;
687686
max-width: 1100px;
688687
margin: 0 auto;
689688
padding-left: 32px;
@@ -1220,7 +1219,7 @@ kbd {
12201219
.header-actions { gap: 6px; }
12211220

12221221
/* ── Index layout: scrollable instead of fixed 100vh ── */
1223-
.index-layout { height: auto; min-height: 100vh; overflow: visible; padding-top: 54px; }
1222+
.index-layout { height: auto; min-height: calc(100vh - 54px); overflow: visible; }
12241223
/* ── Form ── */
12251224
.index-form { flex-direction: column; padding: 20px 12px 24px; flex: none; gap: 20px; }
12261225
.index-sidebar { flex: none; width: 100%; gap: 20px; }
@@ -1246,7 +1245,7 @@ kbd {
12461245
.site-footer { display: block; text-align: center; padding: 12px 16px; line-height: 2; }
12471246

12481247
/* ── Paste page ── */
1249-
.paste-layout { padding-top: 60px; padding-left: 14px; padding-right: 14px; padding-bottom: 30px; }
1248+
.paste-layout { padding-top: 16px; padding-left: 14px; padding-right: 14px; padding-bottom: 30px; }
12501249
.line-gutter { padding: 10px 8px 10px 10px; min-width: 44px; font-size: 0.8rem; }
12511250
.paste-body pre { padding: 10px 12px; font-size: 0.82rem; }
12521251
.paste-inbar { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 6px; }

0 commit comments

Comments
 (0)