mirror of
https://github.com/penpot/penpot.git
synced 2025-01-21 22:22:43 -05:00
commit
d3c0abc11a
3 changed files with 27 additions and 0 deletions
|
@ -35,6 +35,7 @@
|
||||||
(def token-types
|
(def token-types
|
||||||
#{:boolean
|
#{:boolean
|
||||||
:border-radius
|
:border-radius
|
||||||
|
:stroke-width
|
||||||
:box-shadow
|
:box-shadow
|
||||||
:dimension
|
:dimension
|
||||||
:numeric
|
:numeric
|
||||||
|
@ -66,6 +67,12 @@
|
||||||
|
|
||||||
(def border-radius-keys (schema-keys ::border-radius))
|
(def border-radius-keys (schema-keys ::border-radius))
|
||||||
|
|
||||||
|
(sm/def! ::stroke-width
|
||||||
|
[:map
|
||||||
|
[:stroke-width {:optional true} ::sm/uuid]])
|
||||||
|
|
||||||
|
(def stroke-width-keys (schema-keys ::stroke-width))
|
||||||
|
|
||||||
(sm/def! ::dimensions
|
(sm/def! ::dimensions
|
||||||
[:map
|
[:map
|
||||||
[:width {:optional true} ::sm/uuid]
|
[:width {:optional true} ::sm/uuid]
|
||||||
|
|
|
@ -71,6 +71,13 @@
|
||||||
(st/emit!
|
(st/emit!
|
||||||
(dch/update-shapes shape-ids #(assoc % :opacity value))))
|
(dch/update-shapes shape-ids #(assoc % :opacity value))))
|
||||||
|
|
||||||
|
(defn update-stroke-width
|
||||||
|
[value shape-ids]
|
||||||
|
(st/emit!
|
||||||
|
(dch/update-shapes shape-ids (fn [shape]
|
||||||
|
(when (seq (:strokes shape))
|
||||||
|
(assoc-in shape [:strokes 0 :stroke-width] value))))))
|
||||||
|
|
||||||
(defn update-layout-spacing-column [value _shape-ids]
|
(defn update-layout-spacing-column [value _shape-ids]
|
||||||
(let [selected-shapes (wsh/lookup-selected @st/state)]
|
(let [selected-shapes (wsh/lookup-selected @st/state)]
|
||||||
(st/emit!
|
(st/emit!
|
||||||
|
@ -91,6 +98,13 @@
|
||||||
:modal {:key :tokens/border-radius
|
:modal {:key :tokens/border-radius
|
||||||
:fields [{:label "Border Radius"
|
:fields [{:label "Border Radius"
|
||||||
:key :border-radius}]}}]
|
:key :border-radius}]}}]
|
||||||
|
[:stroke-width
|
||||||
|
{:title "Stroke Width"
|
||||||
|
:attributes ctt/stroke-width-keys
|
||||||
|
:on-update-shape update-stroke-width
|
||||||
|
:modal {:key :tokens/stroke-width
|
||||||
|
:fields [{:label "Stroke Width"
|
||||||
|
:key :stroke-width}]}}]
|
||||||
[:box-shadow
|
[:box-shadow
|
||||||
{:title "Box Shadow"
|
{:title "Box Shadow"
|
||||||
:modal {:key :tokens/box-shadow
|
:modal {:key :tokens/box-shadow
|
||||||
|
|
|
@ -22,6 +22,12 @@
|
||||||
[properties]
|
[properties]
|
||||||
[:& tokens-properties-form properties])
|
[:& tokens-properties-form properties])
|
||||||
|
|
||||||
|
(mf/defc stroke-width-modal
|
||||||
|
{::mf/register modal/components
|
||||||
|
::mf/register-as :tokens/stroke-width}
|
||||||
|
[properties]
|
||||||
|
[:& tokens-properties-form properties])
|
||||||
|
|
||||||
(mf/defc box-shadow-modal
|
(mf/defc box-shadow-modal
|
||||||
{::mf/register modal/components
|
{::mf/register modal/components
|
||||||
::mf/register-as :tokens/box-shadow}
|
::mf/register-as :tokens/box-shadow}
|
||||||
|
|
Loading…
Add table
Reference in a new issue