Add missing dark_theme.js (oops)

This commit is contained in:
oobabooga 2024-07-21 09:47:28 -07:00
parent e9d4bff7d0
commit 58a1581b96

9
js/dark_theme.js Normal file
View File

@ -0,0 +1,9 @@
function toggleDarkMode() {
document.body.classList.toggle("dark");
var currentCSS = document.getElementById("highlight-css");
if (currentCSS.getAttribute("href") === "file/css/highlightjs/github-dark.min.css") {
currentCSS.setAttribute("href", "file/css/highlightjs/github.min.css");
} else {
currentCSS.setAttribute("href", "file/css/highlightjs/github-dark.min.css");
}
}