0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-21 06:02:32 -05:00

Show checkmark icon for applied tokens

This commit is contained in:
Florian Schroedl 2024-05-17 11:37:36 +02:00
parent ad26d9e2d3
commit 3caa9d780a
3 changed files with 6 additions and 4 deletions

View file

@ -100,9 +100,10 @@
tokens (mf/deref refs/workspace-tokens)
border-radius-tokens (mf/use-memo (mf/deps tokens) #(wtc/tokens-name-map-for-type :border-radius tokens))
border-radius-options (mf/use-memo (mf/deps border-radius-tokens)
border-radius-options (mf/use-memo (mf/deps shape border-radius-tokens)
#(map (fn [[_k {:keys [name] :as item}]]
(assoc item :label name))
(cond-> (assoc item :label name)
(wtc/token-applied? item shape (wtc/token-attributes :border-radius)) (assoc :selected? true)))
border-radius-tokens))
flex-child? (->> selection-parents (some ctl/flex-layout?))

View file

@ -47,11 +47,11 @@
(cond
(= :separator item) [:li {:class (stl/css :separator)
:key (dm/str element-id "-" index)}]
:else (let [{:keys [value label]} item]
:else (let [{:keys [value label selected?]} item]
[:li
{:key (str element-id "-" index)
:class (stl/css-case :dropdown-element true
:is-selected false #_(= (dm/str value) current-value))
:is-selected selected?)
:data-label label
:on-click on-select}
[:span {:class (stl/css :label)} label]

View file

@ -74,6 +74,7 @@
.check-icon {
@include flexCenter;
translate: -$s-4 0;
svg {
@extend .button-icon-small;
visibility: hidden;