mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-01-18 10:50:24 +00:00
variant: make auto variant work in all combinations of root/subfolder and hugo/hugo server #516
This commit is contained in:
parent
c975dfd2de
commit
c3a67fad85
1 changed files with 4 additions and 12 deletions
|
@ -27,16 +27,8 @@
|
|||
{{- end -}}
|
||||
{{- $themevariantsauto = ($themevariantsauto | first 2) -}}
|
||||
{{- with index $themevariantsauto 0 -}}
|
||||
{{- if site.IsServer -}}
|
||||
@import "{{(printf "css/theme-%s.css" .) | relURL}}" screen and (prefers-color-scheme: light);
|
||||
{{- else -}}
|
||||
@import "{{(printf "theme-%s.css" .)}}" screen and (prefers-color-scheme: light);
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@import "{{ printf "theme-%s.css" . }}" screen and (prefers-color-scheme: light);
|
||||
{{ end -}}
|
||||
{{- with index $themevariantsauto 1 -}}
|
||||
{{- if site.IsServer }}
|
||||
@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 -}}
|
||||
@import "{{ printf "theme-%s.css" . }}" screen and (prefers-color-scheme: dark);
|
||||
{{ end -}}
|
||||
|
|
Loading…
Reference in a new issue