If you take a selector like .class-a :where(.class-b, .class-c) and try prefixing it with .prefix-class, it results in a selector .prefix-class .class-a :where(.class-b, .prefix-class .class-c), which is incorrect. I think the expected result should be .prefix-class .class-a :where(.class-b, .class-c)
It appears to be because the code splits a selector string using the string .split( ',' ) method:
|
const rules = cssRule.selector |
|
.split(",") |
I think the AST does provide an already split cssRule.selectors property, so splitting the string might not be needed, it may be ok to lean on what the AST provides.
If you take a selector like
.class-a :where(.class-b, .class-c)and try prefixing it with.prefix-class, it results in a selector.prefix-class .class-a :where(.class-b, .prefix-class .class-c), which is incorrect. I think the expected result should be.prefix-class .class-a :where(.class-b, .class-c)It appears to be because the code splits a selector string using the string
.split( ',' )method:postcss-prefixwrap/src/internal/domain/CSSRuleWrapper.ts
Lines 20 to 21 in c2636cd
I think the AST does provide an already split
cssRule.selectorsproperty, so splitting the string might not be needed, it may be ok to lean on what the AST provides.