From 0f839b54e22f97633f13a0833cc115bba022f12d Mon Sep 17 00:00:00 2001 From: AngelJumbo Date: Wed, 5 Jun 2024 20:11:33 -0500 Subject: [PATCH] fix switch button did't work at first click --- build.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.sh b/build.sh index 48e19f5..04f9517 100755 --- a/build.sh +++ b/build.sh @@ -137,6 +137,9 @@ echo " if(!window.matchMedia(\"(prefers-color-scheme: dark)\").matches){ document.getElementsByClassName(\"fa-sun\")[0].style.display = \"none\"; document.getElementsByClassName(\"fa-moon\")[0].style.display = \"block\"; + document.documentElement.style.setProperty('color-scheme', 'light'); + }else{ + document.documentElement.style.setProperty('color-scheme', 'dark'); } }