Skip to content

nth-child with of adds unexpected [_ngcontent] attr to selector #64913

@waterplea

Description

@waterplea

Which @angular/* package(s) are the source of the bug?

compiler

Is this a regression?

No

Description

Consider these styles:

:host:nth-child(1 of *:not(.lol):not(.whatever)) {
  color: blue;
}

:host:nth-child(1 of *:not(.whatever)) {
  color: red !important;
}

First one works correctly but the second one, without dual :not, adds an unexpected content attribute to selector.

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/stackblitz-starters-tnsye4fb

Please provide the exception or error you saw

[_nghost-ng-c1419874505]:nth-child(1 of *:not(.lol):not(.whatever)) {
  color: blue;
}

[_nghost-ng-c1419874505][_ngcontent-ng-c1419874505]:nth-child(1 of *:not(.whatever)) {
  color: red !important;
}

Please provide the environment you discovered this bug in (run ng version)

Latest

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions