Skip to content

Commit e152c92

Browse files
committed
force toggle
Signed-off-by: Max Pumperla <max.pumperla@googlemail.com>
1 parent 6feaa4a commit e152c92

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

_static/custom_toggle.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,18 @@ window.addEventListener("DOMContentLoaded", function () {
1111
}
1212
}
1313
});
14+
15+
// Force Jupyter Book to always use light mode
16+
window.addEventListener("DOMContentLoaded", function () {
17+
if (document.documentElement.getAttribute("data-theme") !== "light") {
18+
document.documentElement.setAttribute("data-theme", "light");
19+
// Remove dark mode class if present
20+
document.documentElement.classList.remove("theme-dark");
21+
document.documentElement.classList.add("theme-light");
22+
}
23+
// Remove theme switcher if you want (optional)
24+
// var switcher = document.querySelector('.theme-switch-button, .toggle-switch');
25+
// if (switcher) {
26+
// switcher.style.display = "none";
27+
// }
28+
});

0 commit comments

Comments
 (0)