Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Items within a :where statement are incorrectly prefixed #515

Closed
talldan opened this issue Jul 30, 2024 · 2 comments · Fixed by #517
Closed

Items within a :where statement are incorrectly prefixed #515

talldan opened this issue Jul 30, 2024 · 2 comments · Fixed by #517

Comments

@talldan
Copy link

talldan commented Jul 30, 2024

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.

@dbtedman
Copy link
Owner

dbtedman commented Aug 1, 2024

Thanks for reporting this, I will take a look at your suggestion soon and prepare an update to resolve the issue.

dbtedman added a commit that referenced this issue Aug 5, 2024
@dbtedman dbtedman linked a pull request Aug 5, 2024 that will close this issue
@dbtedman
Copy link
Owner

dbtedman commented Aug 5, 2024

Fix will be included in 1.51.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants