amorenew
amorenew

Reputation: 10906

CSS :host alternative for normal dom

I am using a shadow DOM in angular and I style the host in CSS by :host selector.

In Angular if I make encapsulation:ViewEncapsulation.None then I will be in normal DOM and :host selector will not work

What is alternative in CSS or SASS, etc to :host selector in normal DOM?

Why I need a workaround?

Because if I activate ViewEncapsulation.None for debugging purpose the :host in styles is ignored

Upvotes: 1

Views: 417

Answers (1)

Günter Zöchbauer
Günter Zöchbauer

Reputation: 657821

"I am using a shadow DOM in angular " does mean what exactly? You're in normal DOM by default. There is no shadow DOM unless you use ViewEncapsulation.Native. The default merely emulates the shadow DOM.

There is nothing like a :host selector if you use ViewEncapsulation.None

You would need to explain what exact problem you try to solve for more concrete suggestions how to work around.

Upvotes: 1

Related Questions