Cull excessive JS/CSS for {dark,light}-without-swticher
styles
This commit is contained in:
parent
f6769864be
commit
f4e0412244
3 changed files with 25 additions and 6 deletions
|
@ -1,24 +1,34 @@
|
|||
{{ $light := resources.Get "css/light.css" }}
|
||||
{{ $dark := resources.Get "css/dark.css" }}
|
||||
|
||||
{{ $light.Content }}
|
||||
{{ $style := "light-without-switcher" }}
|
||||
{{ if and (isset site.Params "style") (ne site.Params.style "") }}
|
||||
{{ $style = site.Params.style | lower }}
|
||||
{{ end }}
|
||||
|
||||
{{ if eq site.Params.style "dark-without-switcher" }}
|
||||
{{ if eq $style "dark-without-switcher" }}
|
||||
:root {
|
||||
{{ $dark.Content }}
|
||||
}
|
||||
{{ else if eq site.Params.style "auto-without-switcher" }}
|
||||
|
||||
{{ else }}
|
||||
|
||||
{{ $light.Content }}
|
||||
|
||||
{{ if eq $style "auto-without-switcher" }}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
{{ $dark.Content }}
|
||||
}
|
||||
}
|
||||
{{else }}
|
||||
{{ else if ne $style "light-without-switcher" }}
|
||||
[data-theme="dark"] {
|
||||
{{ $dark.Content }}
|
||||
}
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
|
||||
/* Basic */
|
||||
html {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue