Skip to content

Not removing unnecessary :is() in selector .main > :is(.wrapper > *, .wrapper2 > *) #1625

Closed
@n0099

Description

@n0099

Bug description

As title.

Source CSS

.main > :is(.wrapper > *, .wrapper2 > *) {
    font-size: 2rem;
}

Expected CSS

.main > .wrapper > * {
    font-size: 2rem;
}
.main > .wrapper2 > * {
    font-size: 2rem;
}

Actual CSS

.main > :is(.wrapper > *) {
    font-size: 2rem;
}
.main > :is(.wrapper2 > *) {
    font-size: 2rem;
}

Playgound example

https://preset-env.cssdb.org/playground/#JTdCJTIyc291cmNlJTIyJTNBJTIyLm1haW4lMjAlM0UlMjAlM0Fpcygud3JhcHBlciUyMCUzRSUyMColMkMlMjAud3JhcHBlcjIlMjAlM0UlMjAqKSUyMCU3QiU1Q24lMjAlMjAlMjAlMjBmb250LXNpemUlM0ElMjAycmVtJTNCJTVDbiU3RCUyMiUyQyUyMmNvbmZpZyUyMiUzQSU3QiUyMmJyb3dzZXJzJTIyJTNBJTVCJTIyZGVmYXVsdHMlMjIlNUQlMkMlMjJtaW5pbXVtVmVuZG9ySW1wbGVtZW50YXRpb25zJTIyJTNBMSUyQyUyMnN0YWdlJTIyJTNBMiUyQyUyMmxvZ2ljYWwlMjIlM0ElN0IlMjJpbmxpbmVEaXJlY3Rpb24lMjIlM0ElMjJsZWZ0LXRvLXJpZ2h0JTIyJTJDJTIyYmxvY2tEaXJlY3Rpb24lMjIlM0ElMjJ0b3AtdG8tYm90dG9tJTIyJTdEJTdEJTdE

Does it happen with npx @csstools/csstools-cli <plugin-name> minimal-example.css?

Yes

Debug output

postcss-is-pseudo-class: test.css:1:1: Complex selectors in '.main > :is(.wrapper > *, .wrapper2 > *)' can not be transformed to an equivalent selector without ':is()'.
postcss-is-pseudo-class: test.css:1:1: Complex selectors in '.main > :is(.wrapper > *)' can not be transformed to an equivalent selector without ':is()'.
postcss-is-pseudo-class: test.css:1:1: Complex selectors in '.main > :is(.wrapper2 > *)' can not be transformed to an equivalent selector without ':is()'.

Extra config

postcss-preset-env

{
  minimumVendorImplementations: 2
}

browserslist

defaults
> 0.1% in CN
fully supports es6-module and fully supports url

What plugin are you experiencing this issue on?

PostCSS Preset Env

Plugin version

10.2.1

What OS are you experiencing this on?

Linux, Windows

Node Version

24.1.0

Validations

  • Follow our Code of Conduct
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Would you like to open a PR for this bug?

  • I'm willing to open a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions