Reputation: 945
Unless the component has encapsulation: ViewEncapsulation.Native
all the <style>
tags in the template are placed inside the <head>
section of the main DOM. Is there any trick to crack this?
My use case is:
<link href="url">
with <style>@import "url"</style>
, but their are always moved to the root <head>
and affect to the whole app.Any idea? If there is no way to solve this, I should have try to fix point 3.
Thanks!
Upvotes: 1
Views: 820
Reputation: 657741
The styles are rewritten so that the selectors contain the unique _ngcontent-xxx
attributes that are added to each element and to only match these elements.
There is nothing you can do about styles being added to <head>
.
If these styles affect other elements it might be a bug or you might use it in a way that emulation doesn't cover.
Upvotes: 1