Add theme toggle back and default to 'auto'

This commit is contained in:
Dave Gallant
2024-01-12 16:55:10 -05:00
parent 24ad44a9ec
commit ca44fa9515
5 changed files with 67 additions and 25 deletions

View File

@@ -6,8 +6,7 @@
{{ $backgroundColor = "bg0_h" }}
{{ end }}
@media (prefers-color-scheme: light) {
:root {
:root[data-theme="light"] {
--bg: var(--{{ $backgroundColor }});
--bg0: #fbf1c7;
--bg0_h: #f9f5d7;
@@ -42,11 +41,9 @@
& .light--hidden {
display: none;
}
}
}
@media (prefers-color-scheme: dark) {
:root {
:root[data-theme="dark"] {
--bg: var(--{{ $backgroundColor }});
--bg0: #282828;
--bg0_h: #1d2021;
@@ -83,11 +80,8 @@
}
}
}
:root {
{{ $themeColor := .Param "themeColor" | default "blue" }}
--primary: var(--{{ $themeColor }}1);
--primary-alt: var(--{{ $themeColor }}2);
}