简体   繁体   中英

Angular 4 router-outlet css

With the deprecation of all three of /deep/ , >>> , and ::ng-deep how do I style the router-outlet siblings?

I used to :host /deep/ router-outlet + * {height: 100%} before they announced their intention to drop support for the above selectors.

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

:host ::ng-deep router-outlet + * {height: 100%}

or just

::ng-deep router-outlet + * {height: 100%}

should still work

::ng-deep is deprecated but with a different meaning than /deep/ and >>> . /deep/ and >>> were deprecated because browsers and especially SASS stopped supporting them. They agreed on supporting ::ng-deep instead.

::ng-deep is deprecated because eventually all browsers will support native shadow DOM and probably some way of styling them, and then ::ng-deep will become obsolete.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM