From 2de4b7aeaf3e4544ff8429ca9ae0f655f5602f61 Mon Sep 17 00:00:00 2001 From: Brian <18603393+brian6932@users.noreply.github.com> Date: Tue, 24 Dec 2024 07:44:05 -0500 Subject: [PATCH] fix: prefers-color-scheme --- static/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/script.js b/static/script.js index ab854d0..f33106f 100644 --- a/static/script.js +++ b/static/script.js @@ -76,7 +76,7 @@ function getAnnotation(e) { }; } -window._currentTheme = localStorage.getItem("_theme") || "light"; +window._currentTheme = localStorage.getItem("_theme") || (window.matchMedia("(prefers-color-scheme:dark)").matches ? "dark" : "light"); setTheme(window._currentTheme); const themeChooser = document.getElementById("choose-theme");