diff --git a/js/dark_theme.js b/js/dark_theme.js new file mode 100644 index 00000000..b540fb11 --- /dev/null +++ b/js/dark_theme.js @@ -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"); + } +}