Преглед изворни кода

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
```
George Cushen пре 5 година
родитељ
комит
c4f0317cdf
1 измењених фајлова са 6 додато и 0 уклоњено
  1. 6 0
      layouts/partials/widget_page.html

+ 6 - 0
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 }}