Skip to content

Commit

Permalink
style: Add a default scroll margin
Browse files Browse the repository at this point in the history
This adds a little space above a fragment-linked item (foo.html#bar), for in-page linking.

I've added a --scroll-margin variable which can be used to customize it per page. But we rely on the fallback for now.
  • Loading branch information
garrett authored and martinpitt committed Jan 23, 2024
1 parent 84bd159 commit ce1beaa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions assets/site.scss
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ body {
display: none;
}

[id] {
scroll-margin-block-start: var(--scroll-margin, 2rem);
}

:where(h1, h2, h3, h4, h5, h6, blockquote, dl, ol, ul, figure, p, pre) {
margin-block-end: .5em;
}
Expand Down

0 comments on commit ce1beaa

Please sign in to comment.