lambdaisland / ornament

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

Garden vector of selectors missing extra #3

Closed JohanCodinha closed 3 months ago

JohanCodinha commented 2 years ago

(o/defstyled Test :div {:color :red} [:p :span {:color :blue}]) expand to this css string => .nsTest{color:red}.nsTest p{color:blue} expected is => .nsTest{color:red}.nsTest p span{color:blue}

Here's the Garden rule doc

plexus commented 2 years ago

Thanks for the report. This is indeed a difference with Garden that we should document. We recommend using [:p [:span {:color :blue}]] since that makes the nesting explicit.

I'll leave the issue open because we may still decide to support this down the road, but it leads to ambiguity, we'd need to guess if the second keyword is a CSS selector or a Girouette class.

It does raise a good point though that we should at error or at least warn when using a Girouette class that is not recognized, instead of quietly not emitting anything.

JohanCodinha commented 2 years ago

Thanks. Just to clarify [:p :span {:color :blue}] is supposed to target both :p and :span and not a :span nestead in a :p

plexus commented 2 years ago

Thanks for clarifying, that does make me think we should address this.

plexus commented 3 months ago

For "or" selectors we have for some time supported sets.

[#{:p :span} {:color "blue"}]