Skip to content

Commit a711c25

Browse files
svandragtclaude
andcommitted
Keep section headings in view while scrolling
Each heading sticks to the top while its section is on screen and the next heading pushes it off. The gap above headings moves to the section margin, since a sticky element keeps its margin in flow. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YXgsteCeqVfDQeTgyyBCcz
1 parent 3db8e35 commit a711c25

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎static/style.css‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,14 @@ main {
226226
text-transform: uppercase;
227227
letter-spacing: .1em;
228228
color: var(--muted);
229-
margin: 1.75rem 0 .75rem;
229+
margin: 0 0 .75rem;
230+
padding: .5rem 0;
231+
position: sticky;
232+
top: 0;
233+
z-index: 1;
234+
background: var(--bg);
230235
}
231236

232-
.section-heading:first-child { margin-top: 0; }
233237

234238
.project-card--pinned {
235239
border-color: #c7d7f9;

0 commit comments

Comments
 (0)