I have an application developed in Angular with Material components. I'm using Material Theme to have a few different themes to my app (Dark, Light, Colorful).
My main component - app.component
html look like this:
<div [ngClass]="appTheme">
<router-outlet></router-outlet>
</div>
The value of appTheme
can be 'Light', 'Dark' or 'Colorful'. According to this different @mixin
is being executed, that will color my app in different colors (you can read more about it on the official Material site).
My problem is that some 3rd party components, and event some Material components are floating pop-ups. These pop-ups are being attached to the BODY tag. So the html look like this:
<body>
<app-root>
<div class="dark">
...
</div>
</app-root>
<some-3rd-party-component>
...
</some-3rd-party-component>
</body>
As you can see the class dark
will not effect the some-3rd-party-component
- since it isn't a child element.
How can I set the [ngClass] on the body element. so I could control 3rd party components??