mirror of
https://github.com/penpot/penpot.git
synced 2025-01-07 15:39:42 -05:00
Merge pull request #116 from tokens-studio/spacing-token-layout-update
spacing token to update only row or column gap as per flex direction
This commit is contained in:
commit
cb7d4409e2
1 changed files with 9 additions and 4 deletions
|
@ -101,10 +101,15 @@
|
||||||
(when (seq (:strokes shape))
|
(when (seq (:strokes shape))
|
||||||
(assoc-in shape [:strokes 0 :stroke-width] value))))))
|
(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)]
|
(doseq [shape-id shape-ids]
|
||||||
(st/emit!
|
(let [shape (dt/get-shape-from-state shape-id @st/state)
|
||||||
(dwsl/update-layout selected-shapes {:layout-gap {:column-gap value :row-gap value}}))))
|
layout-direction (:layout-flex-dir shape)
|
||||||
|
layout-update (if (or (= layout-direction :row-reverse) (= layout-direction :row))
|
||||||
|
{:layout-gap {:column-gap value}}
|
||||||
|
{:layout-gap {:row-gap value}})]
|
||||||
|
(st/emit!
|
||||||
|
(dwsl/update-layout [shape-id] layout-update)))))
|
||||||
|
|
||||||
;; Token types -----------------------------------------------------------------
|
;; Token types -----------------------------------------------------------------
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue