backy/docs/themes/hugo-theme-relearn/assets/css/theme-auto.css
Andrew Woodlee 4b382bddd9 v0.3.0
* Getting environment variables and passwords from Vault (not tested
yet)
* Vault configuration to config (not tested yet)
* Ability to run scripts from file on local machine on the remote host
* Ability to get ouput in the notification of a list for individual
commands or all commands
* Make SSH connections close after all commands have been run; reuse
previous connections if needed
2023-07-01 21:46:54 -05:00

35 lines
1.3 KiB
CSS

{{- $themevariants := slice | append (.Site.Params.themeVariant | default "auto") -}}
{{- $themevariantsauto := slice | append (.Site.Params.themeVariantAuto | default slice) -}}
{{- $i := 0 -}}
{{- if eq (int (len $themevariantsauto)) 0 -}}
{{- range $themevariants -}}
{{- $i = add $i 1 -}}
{{- if ne . "auto" -}}
{{- $themevariantsauto = $themevariantsauto | append . -}}
{{- 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 -}}
{{- if ne . "auto" -}}
{{- $themevariantsauto = $themevariantsauto | append . -}}
{{- break -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- if eq (int (len $themevariantsauto)) 1 -}}
{{- $themevariantsauto = $themevariantsauto | append "relearn-dark" -}}
{{- end -}}
{{- $themevariantsauto = ($themevariantsauto | first 2) -}}
{{- with index $themevariantsauto 0 -}}
@import "{{ printf "theme-%s.css" . }}" screen and (prefers-color-scheme: light);
{{ end -}}
{{- with index $themevariantsauto 1 -}}
@import "{{ printf "theme-%s.css" . }}" screen and (prefers-color-scheme: dark);
{{ end -}}