fix: Fix default theme value

This commit is contained in:
JY Hsu 2024-09-01 13:52:35 +08:00
parent 17deb772cf
commit b6244030a3
4 changed files with 7 additions and 5 deletions

View file

@ -12,7 +12,7 @@
<!--================= add analytics if enabled =========================-->
{{- partial "analytics.html" . -}}
<script>
theme = localStorage.getItem('theme-scheme') || localStorage.getItem('darkmode:color-scheme') || 'system';
theme = localStorage.getItem('theme-scheme') || localStorage.getItem('darkmode:color-scheme') || 'light';
if (theme == 'system') {
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
theme = 'dark';