0

I would like to have a url for an angular project which has no CSS inherited from the main CSS file. I have looked into it but when I try I keep getting the inherited CSS.

I only want to use the CSS provided on the component itself.

Travis Knight
  • 301
  • 1
  • 4
  • 18
  • Are you talking about AngularJS or Angular 5? – Tsvetan Ganev Mar 02 '18 at 11:15
  • Please provide more concrete information. Where is the main CSS added? What styles do you not have to be applied? How is that related to the router? https://stackoverflow.com/questions/958170/how-do-i-prevent-css-inheritance – Günter Zöchbauer Mar 02 '18 at 11:17

1 Answers1

1

This is not related to Angular, that's just normal browser behavior.

You can use shadow DOM where supported

@Component({
  selector: '...',
  viewEncapsulation: ViewEncapsulation.Native,
})
export class MyComponent {}

I don't know which browsers already support that.

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567