Skip to content

Commit 5a8d29f

Browse files
fix: Improve accuracy of toc highlighting (#436)
Resolves #414 The `.o-container` position has been changed to relative and there is no need to remove the scroll padding. Co-authored-by: Robert Schuster <77234379+therobrob@users.noreply.github.com>
1 parent 8543bfb commit 5a8d29f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

assets/js/highlightHeadline.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ function initHighlightHeadline() {
2727
for (let i = 0; i < headings.length; i++) {
2828
const heading = headings[i];
2929

30-
// Add the scroll-padding-top defined in styles.scss + 1px to trigger the detection
31-
if (heading.offsetTop <= window.pageYOffset + 81) {
30+
if (heading.offsetTop <= window.pageYOffset) {
3231
currentHeading = heading;
3332
} else {
3433
break;

0 commit comments

Comments
 (0)