The use of /deep/ and >>> in Angular 2

According to the google documentation all major browsers are going to deprecate all functionality of said feature. Therefore, the shadow-piercing descendant combinator is deprecated and support is being removed from major browsers and tools.

https://angular.io/guide/component-styles

What can be used that is more offiical and not deprecaed is ::host() and ::host-context

Also, according to google ::ng-deep will not be deprecated and will continue to be a viable option. so using ::ng-deep will be preferred.

The /deep/ combinator also has the aliases >>>, and ::ng-deep.

Use /deep/, >>> and ::ng-deep only with emulated view encapsulation. Emulated is the default and most commonly used view encapsulation. For more information, see the Controlling view encapsulation section. The shadow-piercing descendant combinator is deprecated and support is being removed from major browsers and tools. As such we plan to drop support in Angular (for all 3 of /deep/, >>> and ::ng-deep). Until then ::ng-deep should be preferred for a broader compatibility with the tools.


  1. Is /deep/ here to stay? Do we have any source, a quote, or anything from any specification saying that it will be adopted? Or if it has officially been deprecated?

    The /deep/ syntax is obsolete, last seen in css-scoping in 2014, and its replacement >>> was deprecated about half a year ago in Chrome 45.

    The entire concept of the shadow-piercing descendant combinator is slated to be removed from the Shadow DOM entirely. Implementations may either remove it altogether or alias it to the regular descendant combinator (which depending on how the Shadow DOM is implemented in the future may or may not make sense).

  2. Can we suppress this error in Visual Studio Code without all-together disabling syntax checking?

    Unfortunately not.

    Angular allows both in emulated view encapsulation for compatibility purposes, but authors are strongly encouraged to use >>> going forward, since /deep/ is technically invalid now, and therefore unsupported in native view encapsulation.