Skip to content

Commit

Permalink
πŸ› Resolve components inside set
Browse files Browse the repository at this point in the history
  • Loading branch information
oxalorg committed Sep 18, 2023
1 parent c44ff75 commit 68deda0
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions src/lambdaisland/ornament.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -603,16 +603,21 @@
~(walk/postwalk
(fn [o]
(if (vector? o)
(into [(if (and (symbol? (first o))
(contains? @registry (qualify-sym &env (first o))))
`(str "." (get-in @registry ['~(qualify-sym &env (first o)) :classname]))
(first o))]
(mapcat (fn [s]
(if (and (symbol? s)
(contains? @registry (qualify-sym &env s)))
(get-in @registry [(qualify-sym &env s) :rules])
[s])))
(next o))
(let [component->selector
(fn [s]
(if (and (symbol? s)
(contains? @registry (qualify-sym &env s)))
`(str "." (get-in @registry ['~(qualify-sym &env s) :classname]))
s))]
(into [(if (set? (first o))
(into #{} (map component->selector (first o)))
(component->selector (first o)))]
(mapcat (fn [s]
(if (and (symbol? s)
(contains? @registry (qualify-sym &env s)))
(get-in @registry [(qualify-sym &env s) :rules])
[s])))
(next o)))
o))
(vec
(mapcat (fn [s]
Expand Down

0 comments on commit 68deda0

Please sign in to comment.