From 58a1581b96cbe285fcb6ac968a9b1d1e5ecb3680 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Sun, 21 Jul 2024 09:47:28 -0700 Subject: [PATCH] Add missing dark_theme.js (oops) --- js/dark_theme.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 js/dark_theme.js 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"); + } +}