mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 15:57:57 +00:00
variant: make auto switch work for hugo server
and hugo
#445
This commit is contained in:
parent
5babf80537
commit
df0a4102e2
1 changed files with 9 additions and 1 deletions
|
@ -27,8 +27,16 @@
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- $themevariantsauto = ($themevariantsauto | first 2) -}}
|
{{- $themevariantsauto = ($themevariantsauto | first 2) -}}
|
||||||
{{- with index $themevariantsauto 0 -}}
|
{{- with index $themevariantsauto 0 -}}
|
||||||
|
{{- if site.IsServer -}}
|
||||||
@import "{{(printf "css/theme-%s.css" .) | relURL}}" screen;
|
@import "{{(printf "css/theme-%s.css" .) | relURL}}" screen;
|
||||||
|
{{- else -}}
|
||||||
|
@import "{{(printf "theme-%s.css" .)}}" screen;
|
||||||
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- with index $themevariantsauto 1 }}
|
{{- with index $themevariantsauto 1 -}}
|
||||||
|
{{- if site.IsServer }}
|
||||||
@import "{{(printf "css/theme-%s.css" .) | relURL}}" screen and (prefers-color-scheme: dark);
|
@import "{{(printf "css/theme-%s.css" .) | relURL}}" screen and (prefers-color-scheme: dark);
|
||||||
|
{{- else }}
|
||||||
|
@import "{{(printf "theme-%s.css" .)}}" screen and (prefers-color-scheme: dark);
|
||||||
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
Loading…
Reference in a new issue