feat: Added default theme
This commit is contained in:
parent
dde735d3af
commit
a11a99f92a
3 changed files with 12 additions and 3 deletions
|
@ -12,7 +12,7 @@
|
|||
<!--================= add analytics if enabled =========================-->
|
||||
{{- partial "analytics.html" . -}}
|
||||
<script>
|
||||
theme = localStorage.getItem('darkmode:color-scheme') || 'system';
|
||||
theme = localStorage.getItem('darkmode:color-scheme') || document.getElementById('defaultTheme').innerText || "system"
|
||||
if (theme == 'system') {
|
||||
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
||||
theme = 'dark';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue