mirror of
https://github.com/penpot/penpot.git
synced 2026-05-26 18:33:43 +00:00
🐛 Fix color token (#9095)
This commit is contained in:
parent
5c9696e20c
commit
d6b341c053
@ -69,12 +69,11 @@
|
|||||||
;; Unique color attribute maps
|
;; Unique color attribute maps
|
||||||
all-colors (distinct (mapv :attrs data))
|
all-colors (distinct (mapv :attrs data))
|
||||||
|
|
||||||
;; Split into: library colors, token colors, and plain colors
|
;; Split into mutually exclusive groups:
|
||||||
library-colors (filterv :ref-id all-colors)
|
;; token-colors take priority; library-colors and plain colors exclude tokens
|
||||||
token-colors (filterv :token-name all-colors)
|
token-colors (filterv :token-name all-colors)
|
||||||
colors (filterv #(and (nil? (:ref-id %))
|
library-colors (filterv (fn [c] (and (some? (:ref-id c)) (nil? (:token-name c)))) all-colors)
|
||||||
(not (:token-name %)))
|
colors (filterv (fn [c] (and (nil? (:ref-id c)) (nil? (:token-name c)))) all-colors)]
|
||||||
all-colors)]
|
|
||||||
{:groups groups
|
{:groups groups
|
||||||
:all-colors all-colors
|
:all-colors all-colors
|
||||||
:colors colors
|
:colors colors
|
||||||
@ -242,8 +241,7 @@
|
|||||||
[:div {:class (stl/css :selected-color-group)}
|
[:div {:class (stl/css :selected-color-group)}
|
||||||
(let [token-color-extract (cond->> token-colors (not @expand-token-color) (take 3))]
|
(let [token-color-extract (cond->> token-colors (not @expand-token-color) (take 3))]
|
||||||
(for [[index token-color] (d/enumerate token-color-extract)]
|
(for [[index token-color] (d/enumerate token-color-extract)]
|
||||||
(let [color {:color (:color token-color)
|
(let [color (dissoc token-color :token-name :has-token-applied)]
|
||||||
:opacity (:opacity token-color)}]
|
|
||||||
[:> color-row*
|
[:> color-row*
|
||||||
{:key index
|
{:key index
|
||||||
:color color
|
:color color
|
||||||
|
|||||||
@ -453,4 +453,5 @@
|
|||||||
[:> icon-button* {:variant "ghost"
|
[:> icon-button* {:variant "ghost"
|
||||||
:aria-label (tr "settings.select-this-color")
|
:aria-label (tr "settings.select-this-color")
|
||||||
:on-click handle-select
|
:on-click handle-select
|
||||||
|
:tooltip-position "top-left"
|
||||||
:icon i/move}])]))
|
:icon i/move}])]))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user