The :host selector in CSS is used to select the element that is hosting the component that the CSS is applied to. When you set the ViewEncapsulation property of a component to ViewEncapsulation.None, it disables the mechanism that Angular uses to scope styles to that component, which can cause issues when trying to use the :host selector.
When the ViewEncapsulation is set to ViewEncapsulation.None, Angular will not add any special attribute or class to the elements inside the component's template. This means that any styles you apply to the :host selector will also be applied to any other elements on the page that match the same selector, which can lead to unintended styling.
If you still want to use the :host selector, you can use ViewEncapsulation.Emulated instead of ViewEncapsulation.None. This will enable Angular to emulate the behavior of the shadow DOM and scope your styles to the component, but still allow you to use the :host selector.
Also, you can use element selector with the attribute you added on the host element.
my-comp-name {
/* styles go here */
}
Instead of
:host {
/* styles go here */
}