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:
parent
9149772ce9
commit
4d54768875
1 changed files with 10 additions and 4 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Reference in a new issue