diff options
author | Lutz Reinhardt <lr1980@users.noreply.github.com> | 2022-01-24 19:23:09 +0300 |
---|---|---|
committer | Lutz Reinhardt <lr1980@users.noreply.github.com> | 2022-01-24 19:23:09 +0300 |
commit | 57066e92a650036b5ab2918c28dc1bae9c073c32 (patch) | |
tree | 95a12a085fb6458cd404510b614e0b4f82208e8d | |
parent | 6aae5908fd3df429d9dfde4753d7cd9eb640772e (diff) |
add auto dark mode to baseof html
-rw-r--r-- | layouts/_default/baseof.html | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 884515f..a032e67 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -79,6 +79,11 @@ $('.text-dark').addClass('darkmode-text-dark').removeClass('text-dark'); $('.text-muted').addClass('darkmode-text-muted').removeClass('text-muted'); }; + + let darkmode = window.matchMedia('(prefers-color-scheme: dark)').matches; + if (darkmode) { + $(".darkmode-label").click(); + } </script> </body> {{ else }} |