Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gurusabarish/hugo-profile.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLutz Reinhardt <lr1980@users.noreply.github.com>2022-01-24 19:23:09 +0300
committerLutz Reinhardt <lr1980@users.noreply.github.com>2022-01-24 19:23:09 +0300
commit57066e92a650036b5ab2918c28dc1bae9c073c32 (patch)
tree95a12a085fb6458cd404510b614e0b4f82208e8d
parent6aae5908fd3df429d9dfde4753d7cd9eb640772e (diff)
add auto dark mode to baseof html
-rw-r--r--layouts/_default/baseof.html5
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 }}