mirror of
https://github.com/status-im/re-frame-10x.git
synced 2025-02-10 21:16:40 +00:00
Refactor function for style string parsing
This commit is contained in:
parent
7f07f3c9ef
commit
6c5de6e9f3
@ -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