Skip to content

Commit

Permalink
Add a tiny extra offset for Blink browsers on scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
pradyunsg committed Feb 23, 2022
1 parent 45fa3ca commit df3defb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/furo/assets/scripts/furo.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ function setupScrollSpy() {
recursive: true,
navClass: "scroll-current",
offset: () => {
return header.getBoundingClientRect().height + 8;
let rem = parseFloat(getComputedStyle(document.documentElement).fontSize);
return header.getBoundingClientRect().height + 0.5 * rem + 1;
},
});
}
Expand Down

0 comments on commit df3defb

Please sign in to comment.