mirror of
https://github.com/penpot/penpot.git
synced 2025-12-12 06:24:17 +01:00
Move to tokens ns, add test
This commit is contained in:
@@ -35,6 +35,14 @@
|
||||
{:path (seq path)
|
||||
:selector selector}))
|
||||
|
||||
(defn token-names-map
|
||||
"Convert tokens into a map with their `:name` as the key.
|
||||
|
||||
E.g.: {\"sm\" {:token-type :border-radius :id #uuid \"000\" ...}}"
|
||||
[tokens]
|
||||
(->> (map (fn [{:keys [name] :as token}] [name token]) tokens)
|
||||
(into {})))
|
||||
|
||||
(defn token-names-tree
|
||||
"Convert tokens into a nested tree with their `:name` as the path."
|
||||
[tokens]
|
||||
|
||||
Reference in New Issue
Block a user