Added default theme (#960)
* feat: Added default theme
* Revert "feat: Added default theme"
This reverts commit a11a99f92a
.
* feat: Add basic theme feature
* feat: Add theme settings
* fix: Fix default theme value
* fix: Fix CR and doc-string
* Comment out darkMode on exampleSite/hugo.yaml
Signed-off-by: hossainemruz <hossainemruz@gmail.com>
---------
Signed-off-by: hossainemruz <hossainemruz@gmail.com>
Co-authored-by: Emruz Hossain <hossainemruz@gmail.com>
This commit is contained in:
parent
3ce670e2a5
commit
7bc37c74c7
8 changed files with 134 additions and 7 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') || 'light';
|
||||
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