mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 07:14:46 +00:00
Docs UI: Style the currently active nav link
This commit is contained in:
parent
d2dbb0001a
commit
33a6c9e6c5
2 changed files with 9 additions and 2 deletions
|
@ -14,7 +14,10 @@
|
|||
|
||||
sidebar.querySelectorAll(".sidebar-entry").forEach((entry) => {
|
||||
let entryName = entry.querySelector('.sidebar-module-link').textContent;
|
||||
if (currentModuleName === entryName) return;
|
||||
if (currentModuleName === entryName) {
|
||||
entry.firstChild.classList.add("active");
|
||||
return;
|
||||
};
|
||||
entry.querySelectorAll(".sidebar-sub-entries a").forEach((subEntry) => subEntry.classList.add("hidden"));
|
||||
})
|
||||
} else {
|
||||
|
@ -41,4 +44,4 @@
|
|||
searchBox.addEventListener("input", search);
|
||||
|
||||
search();
|
||||
})();
|
||||
})();
|
||||
|
|
|
@ -303,6 +303,10 @@ footer p {
|
|||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.sidebar-module-link.active {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
a, a:visited {
|
||||
color: var(--link-color);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue