I\'m trying to style an element placed by the router outlet in angular and want to make sure that the element generated gets a width of 100%
From most of the replies
This is not a general replacement for ::ng-deep, but for the use case described by the question author:
In the special case where you want to style the element inserted by a router-outlet, there is an elegant solution using the adjacent neighbor selector in CSS:
router-outlet+* {
/* styling here... */
}
This will apply to all elements which are direct neighbors of a router-outlet.
Further reading:
https://developer.mozilla.org/en-US/docs/Web/CSS/Adjacent_sibling_combinator
https://angular.io/guide/router#router-outlet