aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/image-gradient.css.html
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2023-08-31 21:03:07 -0400
committertdro <tdro@noreply.example.com>2023-08-31 21:04:26 -0400
commit226f80efd8fc29ce37f32548e51df75f43a20702 (patch)
tree24fea0e249d54e00ea66292677cf55f0e1526298 /themes/default/layouts/partials/image-gradient.css.html
parentb91a12a12f9df5ede9abf1991ebee1fd35b7e384 (diff)
downloadcanory-226f80efd8fc29ce37f32548e51df75f43a20702.tar.gz
canory-226f80efd8fc29ce37f32548e51df75f43a20702.tar.bz2
canory-226f80efd8fc29ce37f32548e51df75f43a20702.zip
themes/default/layouts/partials: Make CSS in HTML easy to find
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 -}}