Skip to content

Commit

Permalink
Add scroll-margin-top to headings which contain link targets.
Browse files Browse the repository at this point in the history
This means when the link is followed, the page scrolls in such a way as to
leave space for the fixed menu bar.

Fixes rust-lang#1040
  • Loading branch information
mattheww committed Oct 26, 2019
1 parent 9cf56ab commit 99ced51
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/theme/css/general.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ h4 a.header:target::before {
width: 30px;
}

h1 a.header:target,
h2 a.header:target,
h3 a.header:target,
h4 a.header:target {
scroll-margin-top: 62px;
}

.page {
outline: 0;
padding: 0 var(--page-padding);
Expand Down

0 comments on commit 99ced51

Please sign in to comment.