ornament icon indicating copy to clipboard operation
ornament copied to clipboard

Garden vector of selectors missing extra

Open JohanCodinha opened this issue 2 years ago • 3 comments

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

Here's the Garden rule doc

JohanCodinha avatar Oct 12 '21 13:10 JohanCodinha

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.

plexus avatar Oct 13 '21 05:10 plexus

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

JohanCodinha avatar Oct 13 '21 05:10 JohanCodinha

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

plexus avatar Oct 13 '21 05:10 plexus

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

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

plexus avatar Jun 08 '24 13:06 plexus