2023-11-20 08:39:40 +00:00
|
|
|
{{- $themevariants := partial "get-theme-variants.hugo" . -}}
|
2023-02-04 21:33:27 +00:00
|
|
|
{{- $themevariantsauto := slice | append (.Site.Params.themeVariantAuto | default slice) -}}
|
|
|
|
{{- $i := 0 -}}
|
|
|
|
{{- if eq (int (len $themevariantsauto)) 0 -}}
|
|
|
|
{{- range $themevariants -}}
|
|
|
|
{{- $i = add $i 1 -}}
|
2023-11-20 08:39:40 +00:00
|
|
|
{{- if ne .identifier "auto" -}}
|
|
|
|
{{- $themevariantsauto = $themevariantsauto | append .identifier -}}
|
2023-02-04 21:33:27 +00:00
|
|
|
{{- break -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- if eq (int (len $themevariantsauto)) 0 -}}
|
|
|
|
{{- $themevariantsauto = $themevariantsauto | append "relearn-light" -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- if eq (int (len $themevariantsauto)) 1 -}}
|
|
|
|
{{- $poppedthemevariants := last (sub (len $themevariants) $i) $themevariants -}}
|
|
|
|
{{- range $poppedthemevariants -}}
|
2023-11-20 08:39:40 +00:00
|
|
|
{{- if ne .identifier "auto" -}}
|
|
|
|
{{- $themevariantsauto = $themevariantsauto | append .identifier -}}
|
2023-02-04 21:33:27 +00:00
|
|
|
{{- break -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- if eq (int (len $themevariantsauto)) 1 -}}
|
|
|
|
{{- $themevariantsauto = $themevariantsauto | append "relearn-dark" -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- $themevariantsauto = ($themevariantsauto | first 2) -}}
|
|
|
|
{{- with index $themevariantsauto 0 -}}
|
2023-05-18 13:56:16 +00:00
|
|
|
@import "{{ printf "theme-%s.css" . }}" screen and (prefers-color-scheme: light);
|
|
|
|
{{ end -}}
|
2023-02-04 22:28:57 +00:00
|
|
|
{{- with index $themevariantsauto 1 -}}
|
2023-05-18 13:56:16 +00:00
|
|
|
@import "{{ printf "theme-%s.css" . }}" screen and (prefers-color-scheme: dark);
|
|
|
|
{{ end -}}
|