Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions css/style.css
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -258,11 +272,6 @@ a {
padding-top: 40px;
}

#api-doc *:target, #page-doc *:target {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I support removing this
since we are using scroll top margin only on headers.

margin-top: -120px;
padding-top: 120px;
z-index: -1;
}

/* logo */
.logo-container a {
Expand Down
11 changes: 0 additions & 11 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,6 @@ if (langDisplay) {
langDisplay.textContent = matchedLang ? matchedLang.name : 'English';
}

// scroll to top of the page
if (scrollToTopBtn) {
scrollToTopBtn.addEventListener("click", function (e) {
e.preventDefault();
window.scrollTo({
top: 0,
behavior: "smooth"
})
})
}

// add/remove class 'scroll' on scroll by 5px
const scrollTarget = document.querySelector('.logo-container');
const scrollObserver = new IntersectionObserver(
Expand Down
4 changes: 2 additions & 2 deletions js/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ 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
event.preventDefault(); // stop navigation to submenu

// Find the closest parent <li>
const closestLiParent = link.closest("li");
const childUlSubMenu = closestLiParent.children[1];
Expand Down