I am using angular 12 and I want to apply some styling to input field which is a shadow root element of group-search-field element.
I tried using ng-deep like below but it didn't work
:host ::ng-deep input {
background: red !important;
}
I am using angular 12 and I want to apply some styling to input field which is a shadow root element of group-search-field element.
I tried using ng-deep like below but it didn't work
:host ::ng-deep input {
background: red !important;
}
Copyright © 2021 Jogjafile Inc.

Because of the isolation of styles, which is a feature of Shadow DOM, you cannot define a global CSS rule that will be applied in the Shadow DOM scope. In your case I think
background:reddoes not propagate to be inherited by the elements in the shadow root that's why:hostis not working.https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM