In an Angular application, using Angular Material for themes, I'm trying to update a css class in a component when my theme changes to dark.
This would work, but it would affect all components, loosing the encapsulation:
::ng-deep .dark-theme { // must have ::ng-deep to see .dark-theme on body
.action-button:hover {
color: #ffffff;
}
}
How can I have same result, but only for one component?
I've tried this as mentioned here but doesn't seems to work for me:
::ng-deep .dark-theme {
:host .action-button:hover {
color: #ffffff;
}
}
// OR
:host ::ng-deep .dark-theme .action-button:hover {
color: #ffffff;
}