From db0169f34b8855803cd0937f8b19f7b405748600 Mon Sep 17 00:00:00 2001 From: coja Date: Sun, 9 Aug 2026 04:43:46 +0200 Subject: [PATCH] [Theme] light/dark persistance --- site/scripts/main.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/site/scripts/main.js b/site/scripts/main.js index 703b7ed8..aaacfad6 100644 --- a/site/scripts/main.js +++ b/site/scripts/main.js @@ -15,6 +15,7 @@ window.addEventListener("DOMContentLoaded", () => { /* Functions */ const changeToDarkTheme = () => { + window.localStorage.setItem("theme", "dark"); document.documentElement.classList.add("dark"); themeBtn?.setAttribute("title", "turn the light on"); Array.from(imgs).forEach((img) => { @@ -23,6 +24,7 @@ window.addEventListener("DOMContentLoaded", () => { } const changeToLightTheme = () => { + window.localStorage.setItem("theme", "light"); document.documentElement.classList.remove("dark"); themeBtn?.setAttribute("title", "turn the light off"); Array.from(imgs).forEach((img) => {