Skip to content

::ng-deep becomes :is() with CSS files #58996

@Zefling

Description

@Zefling

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

compiler

Is this a regression?

Yes

Description

In CSS file (not SCSS), when using ::ng-deep the result is broken.

pre {
    white-space: pre-wrap;

    ::ng-deep {
        h3 {
            margin: 0px;
            border-bottom: 1px solid;
            padding: 0 6px 6px;
        }

        .license {
            margin-right: 5px;
            font-size: 20px;
            text-align: right;
        }
    }
}

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

**In build**


▲ [WARNING] 1 rules skipped due to selector errors:
  :is() -> Empty sub-selector


**In browser**


pre[_ngcontent-ng-c2840326293] {
    white-space:pre-wrap
}
:is()   h3[_ngcontent-ng-c2840326293] {
    margin:0;
    border-bottom:1px solid;
    padding:0 6px 6px
}
:is()   .license[_ngcontent-ng-c2840326293] {
    margin-right:5px;
    font-size:20px;
    text-align:right
}

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

Angular CLI: 19.0.2
Node: 20.11.1
Package Manager: npm 10.2.4
OS: linux x64

Angular: 19.0.1
... animations, cdk, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1900.2
@angular-devkit/build-angular   19.0.2
@angular-devkit/core            19.0.2 (cli-only)
@angular-devkit/schematics      19.0.2
@angular/cli                    19.0.2
@schematics/angular             19.0.2
rxjs                            7.8.1
typescript                      5.6.3
zone.js                         0.15.0

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