Skip to content

Items within a :where statement are incorrectly prefixed #515

@talldan

Description

@talldan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions