(rainbow-delimiters parent level)
(rainbow-delimiters parent level m)
Returns a map of elements and class names.
Source
(defn
rainbow-delimiters
"Returns a map of elements and class names."
([parent level]
(persistent! (rainbow-delimiters parent level (transient {}))))
([parent level m]
(reduce
(fn
[m elem]
(let
[classes (.-classList elem)]
(cond
(.contains classes "delimiter")
(assoc! m elem (str "rainbow-" (mod level rainbow-count)))
(.contains classes "collection")
(rainbow-delimiters elem (inc level) m)
:else
m)))
m
(-> parent .-children array-seq))))