doorman doorman - 1 year ago 173
Sass (Sass) Question

Shadow piercing inside scss

I am using shadow piercing css for one of my styles. But I have color codes inside scss which I want to use in the style. Is it possible to have the shadow piercing inside a scss file?

selector: 'my-selector',
styles: [
':host >>> .mystyle { background-color: green }'
templateUrl: './my.template.html'

Answer Source

AFAIK >>> is not supported in SASS because this combinator didn't make it into the CSS standard. Angular has it's own implementation to emulate it's support. AFAIR just using a space instead of >>> has the same effect in Angular2 with ViewEncapsulation.Emulated (default).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download