I have the following angular component
@Component({ selector: 'app-bar', templateUrl: './bar.component.html', styleUrls: ['./bar.component.scss'], encapsulation: ViewEncapsulation.ShadowDom, changeDetection: ChangeDetectionStrategy.OnPush }) export class BarComponent { @Input() @HostBinding('class') cls; } So I thought, if I set cls to 'hide-me' I hide it. I added the following to bar.component.scss:
:host { &.hide-me { display: none; } } This doesn't do anything and it has to do with the shadow dom encapsulation. If you remove that line it works again as expected. Any suggestions why this doesn't work anymore with shadowDom? and is there a way to fix this with shadow dom enabled of course ;)