From c4f0317cdf5b2197bb42e793b151a246534b7b48 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Sun, 12 Jul 2020 19:36:30 +0100 Subject: [PATCH] feat: enable non-rectangular widget styles Introduces `design.clip_path` widget option. Refer to CSS docs on `clip-path` for use. E.g. to create a slanted bottom to a widget: ``` [design] clip_path = "polygon(0 0,100% 0,100% 80%,0% 100%)" [design.background] color = "navy" text_color_light = true ``` --- layouts/partials/widget_page.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/layouts/partials/widget_page.html b/layouts/partials/widget_page.html index 452896e7..472675b5 100644 --- a/layouts/partials/widget_page.html +++ b/layouts/partials/widget_page.html @@ -59,6 +59,12 @@ {{ $style = print $style $style_pad }} {{ end }} + {{/* Support for clip path (design.clip_path) */}} + {{ with $st.Params.design.clip_path }} + {{ $style_clip_path := printf "clip-path: %s;" . }} + {{ $style = print $style $style_clip_path }} + {{ end }} + {{ with $st.Params.advanced.css_style }} {{ $style = print $style . }} {{ end }}