diff --git a/css/style.css b/css/style.css index 86e124fe4b..a3cd96c0c6 100644 --- a/css/style.css +++ b/css/style.css @@ -1,6 +1,20 @@ * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; + scroll-behavior: smooth; +} + +/* handle header offset with scroll-margin */ +h1, h2, h3, h4, h5, h6, +[id] { + scroll-margin-top: 60px; +} + +/* Respect user motion preferences for access */ +@media (prefers-reduced-motion: reduce) { + html { + scroll-behavior: auto; + } } body { @@ -264,11 +278,6 @@ a { padding-top: 40px; } -#api-doc *:target, #page-doc *:target { - margin-top: -120px; - padding-top: 120px; - z-index: -1; -} /* logo */ .logo-container a { diff --git a/js/menu.js b/js/menu.js index 4b46b66641..4a27e9bcb4 100644 --- a/js/menu.js +++ b/js/menu.js @@ -183,7 +183,6 @@ toggleBtn?.addEventListener("click", (e) => { // Open/Close sub TOC content on click document.querySelectorAll("#menu > li > a").forEach((link) => { link.addEventListener("click", function (event) { - event.preventDefault(); // stop navigation to submenu // Find the closest parent
  • const closestLiParent = link.closest("li");