aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/image-gradient.css.html
diff options
context:
space:
mode:
Diffstat (limited to 'themes/default/layouts/partials/image-gradient.css.html')
-rw-r--r--themes/default/layouts/partials/image-gradient.css.html18
1 files changed, 18 insertions, 0 deletions
diff --git a/themes/default/layouts/partials/image-gradient.css.html b/themes/default/layouts/partials/image-gradient.css.html
new file mode 100644
index 0000000..794ea8b
--- /dev/null
+++ b/themes/default/layouts/partials/image-gradient.css.html
@@ -0,0 +1,18 @@
+{{- $colors := . -}}
+
+{{- with $colors -}}
+ background:
+ {{- range $key, $color := $colors -}}
+ {{- $last := sub (len $colors) 1 -}}
+ {{- $separator := "," -}}
+ {{- $color = $color -}}
+ {{- $position := "top" -}}
+ {{- if eq $last $key -}}
+ {{- $separator = ";" -}}
+ {{- end -}}
+ {{- if gt $key 0 -}}
+ {{- $position = "bottom" -}}
+ {{- end -}}
+ radial-gradient(ellipse at {{ $position }}, {{ $color }}, transparent){{ $separator }}
+ {{- end -}}
+{{- end -}}