feat: Add theme settings
This commit is contained in:
parent
dd1ede93d9
commit
17deb772cf
6 changed files with 37 additions and 18 deletions
|
@ -18,7 +18,7 @@
|
|||
<!--================= add analytics if enabled =========================-->
|
||||
{{- partial "analytics.html" . -}}
|
||||
<script>
|
||||
theme = localStorage.getItem('darkmode:color-scheme') || 'system';
|
||||
theme = localStorage.getItem('theme-scheme') || localStorage.getItem('darkmode:color-scheme') || '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