mirror of
https://github.com/status-im/re-frame-10x.git
synced 2025-02-27 13:10:42 +00:00
Refactor function for style string parsing
This commit is contained in:
parent
c18714a9d8
commit
49095dcfe3
@ -6,7 +6,8 @@
|
||||
[cljs.pprint :refer [pprint]]))
|
||||
|
||||
(defn string->css [css-string]
|
||||
(->> (map #(str/split % #":") (str/split (get css-string "style") #";"))
|
||||
(->> (str/split (get css-string "style") #";")
|
||||
(map #(str/split % #":"))
|
||||
(reduce (fn [acc [property value]]
|
||||
(assoc acc (keyword property) value)) {})))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user