diff options
Diffstat (limited to 'layouts/_default/baseof.html')
-rw-r--r-- | layouts/_default/baseof.html | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 9b63b69..373e635 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -41,28 +41,22 @@ return } - console document.body.classList.remove("auto"); let cls = "light"; - - console.log - if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { cls = "dark"; } document.body.classList.add(cls); - } - function invert() { + function invertBody() { document.body.classList.toggle("dark"); document.body.classList.toggle("light"); } if (isAuto()) { - console.log("Setting invert listener"); - window.matchMedia('(prefers-color-scheme: dark)').addListener(invert); + window.matchMedia('(prefers-color-scheme: dark)').addListener(invertBody); } setTheme(); |