🐛 Fix color token (#9095)

This commit is contained in:
Eva Marco 2026-04-23 10:51:30 +02:00 committed by GitHub
parent 5c9696e20c
commit d6b341c053
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 7 deletions

View File

@ -69,12 +69,11 @@
;; Unique color attribute maps
all-colors (distinct (mapv :attrs data))
;; Split into: library colors, token colors, and plain colors
library-colors (filterv :ref-id all-colors)
;; Split into mutually exclusive groups:
;; token-colors take priority; library-colors and plain colors exclude tokens
token-colors (filterv :token-name all-colors)
colors (filterv #(and (nil? (:ref-id %))
(not (:token-name %)))
all-colors)]
library-colors (filterv (fn [c] (and (some? (:ref-id c)) (nil? (:token-name c)))) all-colors)
colors (filterv (fn [c] (and (nil? (:ref-id c)) (nil? (:token-name c)))) all-colors)]
{:groups groups
:all-colors all-colors
:colors colors
@ -242,8 +241,7 @@
[:div {:class (stl/css :selected-color-group)}
(let [token-color-extract (cond->> token-colors (not @expand-token-color) (take 3))]
(for [[index token-color] (d/enumerate token-color-extract)]
(let [color {:color (:color token-color)
:opacity (:opacity token-color)}]
(let [color (dissoc token-color :token-name :has-token-applied)]
[:> color-row*
{:key index
:color color

View File

@ -453,4 +453,5 @@
[:> icon-button* {:variant "ghost"
:aria-label (tr "settings.select-this-color")
:on-click handle-select
:tooltip-position "top-left"
:icon i/move}])]))