From a4198db182970c335fb6a5d50e31112d29e5b2aa Mon Sep 17 00:00:00 2001 From: MoritzWeber0 Date: Wed, 22 Oct 2025 20:46:29 +0200 Subject: [PATCH] fix: Improve accuracy of toc highlighting --- assets/js/highlightHeadline.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/assets/js/highlightHeadline.js b/assets/js/highlightHeadline.js index 75585680..fe318680 100644 --- a/assets/js/highlightHeadline.js +++ b/assets/js/highlightHeadline.js @@ -27,8 +27,7 @@ function initHighlightHeadline() { for (let i = 0; i < headings.length; i++) { const heading = headings[i]; - // Add the scroll-padding-top defined in styles.scss + 1px to trigger the detection - if (heading.offsetTop <= window.pageYOffset + 81) { + if (heading.offsetTop <= window.pageYOffset) { currentHeading = heading; } else { break;