lambdaisland / ornament

Clojure Styled Components
Mozilla Public License 2.0
118 stars 13 forks source link

🐛 Resolve components inside set #25

Closed oxalorg closed 11 months ago

oxalorg commented 12 months ago

Component don't get resolved correctly when they are present inside of a set.

Thanks @gabriel376 for catching the bug.

For components like this:

(o/defstyled child-1 :div
  :bg-red-100
  ([]
   [:p "hello"]))

(o/defstyled child-2 :div
  :bg-blue-100
  ([]
   [:p "world"]))

This does not work.

(o/defstyled parent :div
  [#{child-1 child-2} :bg-green-100]
  ([]
   [:<>
    [child-1]
    [child-2]]))

This PR fixes that:

(o/css parent)
;; => ".poke__parent .poke__child_2,.poke__parent .poke__child_1{--gi-bg-opacity:1;background-color:rgba(220,252,231,var(--gi-bg-opacity))}"
plexus commented 11 months ago

Released in v1.12.107

[com.lambdaisland/ornament "1.12.107"]                 ;; deps.edn
{com.lambdaisland/ornament {:mvn/version "1.12.107"}}  ;; project.clj