Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
docs(common): expand the recommended use of ::ng-deep
  • Loading branch information
Gouvernathor committed Dec 9, 2025
commit 1b6355a630c52e2e002051b77e86df9844772076
5 changes: 3 additions & 2 deletions adev/src/content/guide/components/styling.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ as `::shadow` or `::part`.
#### `::ng-deep`

Angular's emulated encapsulation mode supports a custom pseudo class, `::ng-deep`.
**The Angular team strongly discourages new use of `::ng-deep`**. These APIs remain
exclusively for backwards compatibility.

When a selector contains `::ng-deep`, Angular stops applying view-encapsulation boundaries after that point in the selector. Any part of the selector that follows `::ng-deep` can match elements outside the component’s template.

Expand All @@ -94,6 +92,9 @@ For example:

They can come from the component's template or the views of its child components, but not elsewhere in the app.

The only recommended use of `::ng-deep` is when preceded with a component-bound selector as in the last examples above, in order to style elements that are in the component's template or in its projected or child content.
**The Angular team strongly discourages other uses of `::ng-deep`** applying to the outside of the component. That use case remains exclusively for backwards compatibility.

### ViewEncapsulation.ShadowDom

This mode scopes styles within a component by
Expand Down