Open green-coder opened 3 years ago
As mentioned in https://github.com/green-coder/girouette/pull/74#issuecomment-974616150, the problem is:
(garden/css [".space-x-2" [#garden.selectors.CSSSelector{:selector "& > * + *"} {:margin-left "0.5rem"}]]) => ".space-x-2 & > * + * {\n margin-left: 0.5rem;\n}"
The expected output was more like .space-x-2 > * + * {\n margin-left: 0.5rem;\n} (without the &)
.space-x-2 > * + * {\n margin-left: 0.5rem;\n}
&
This bug happens because "& > * + *" is not matched by parent-selector-re in https://github.com/noprompt/garden/blob/31066ed2d7d769819c2d1d95460bd20818bc9561/src/garden/compiler.cljc#L176-L189
"& > * + *"
parent-selector-re
This workaround is working:
(garden/css [".space-x-2" [#garden.selectors.CSSSelector{:selector "&>*+*"} {:margin-left "0.5rem"}]]) => ".space-x-2>*+* {\n margin-left: 0.5rem;\n}"
As mentioned in https://github.com/green-coder/girouette/pull/74#issuecomment-974616150, the problem is:
The expected output was more like
.space-x-2 > * + * {\n margin-left: 0.5rem;\n}
(without the&
)This bug happens because
"& > * + *"
is not matched byparent-selector-re
in https://github.com/noprompt/garden/blob/31066ed2d7d769819c2d1d95460bd20818bc9561/src/garden/compiler.cljc#L176-L189This workaround is working: