0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-26 00:19:07 -05:00

Add special cases for runtime map to props conversion

This commit is contained in:
Andrey Antukh 2024-01-11 15:23:58 +01:00
parent 9149772ce9
commit 4d54768875

View file

@ -86,10 +86,16 @@
obj)))
(defn- props-key-fn
[key]
(if (or (= key :class) (= key :class-name))
"className"
(str/camel (name key))))
[k]
(if (or (keyword? k) (symbol? k))
(let [nword (name k)]
(cond
(= nword "class") "className"
(str/starts-with? nword "--") nword
(str/starts-with? nword "data-") nword
(str/starts-with? nword "aria-") nword
:else (str/camel nword)))
k))
(defn clj->props
[props]