I'm trying to define some style on the :before
pseudo-element of a custom element host.
I've been trying variations around the sample below, but nothing seems to work and I can't find information about it. Is that possible at all? If so, what am I doing wrong?
:host(.open):before{
background: grey;
opacity:.4;
position: absolute;
left:0;
top:0;
width:100%;
height:100%;
}
Here's a fiddle to show the issue: https://jsfiddle.net/8uzjb7ew/ . The custom element should have greyish background, but the :before
pseudoelement is not rendered.