diff options
author | Francesco <tomaselli.fr@gmail.com> | 2024-05-11 23:29:14 +0200 |
---|---|---|
committer | Francesco <tomaselli.fr@gmail.com> | 2024-05-11 23:29:14 +0200 |
commit | d33146956f679bac086208ae2096d835f17200de (patch) | |
tree | 18d9d0372781cc90a23ecb74285ebe55189153a3 /layouts | |
parent | 1b40d37d7b35b6090a088ba049883dcf4c1e8dba (diff) |
Minor
Diffstat (limited to 'layouts')
-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(); |