Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

/deep/ combinator in CSS is deprecated and will be removed in M63

Tags:

html

css

angular

I updated my angular to 4.0.0 and chrome to to 62.0.3202.94 and I got this error:

[Deprecation] /deep/ combinator in CSS is deprecated and will be removed in M63, around December 2017. See https://www.chromestatus.com/features/4964279606312960 for more details.

And is refer to clientWidth or clientHeight in my code:

document.getElementById(this.ID).clientWidth;

or here:

document.documentElement.scrollTop = parseInt(sessionStorage.getItem('scrollPosition'), 10);

Is this error misinterpreted by the browser? How to fix this?

like image 667
Verri Avatar asked Nov 17 '17 10:11

Verri


1 Answers

update

::slotted is now supported by all new browsers and can be used with `ViewEncapsulation.ShadowDom

https://developer.mozilla.org/en-US/docs/Web/CSS/::slotted

original

/deep/ being deprecated in any browser is entirely irrelevant to Angular.

Angular rewrites the selector so that it doesn't use /deep/ or it's newer replacement ::ng-deep when the application is loaded.

/deep/ and ::ng-deep are just hints for Angular to not include the unique class (like _ngcontent-1), Angular adds to each component host element, in the CSS selector.

See also https://blog.thoughtram.io/angular/2015/06/29/shadow-dom-strategies-in-angular2.html

like image 196
Günter Zöchbauer Avatar answered Nov 19 '22 19:11

Günter Zöchbauer