When providing a background image for an element, everything works fine:
<div [style.background-image]="sanitizedStyleValue"></div>
But how can I provide a mask-image for an element? This:
<div [style.mask-image]="sanitizedStyleValue"></div>
is not working. Also
<div [ngStyle]="{ 'mask-image': 'url( mymaskimage.svg )' }"></div>
does not work. I don't even get a warning in the console.
Is this due to DomSanitizer's ignorance of mask images' right for existance, or is there another way to achieve this?
Context
I want to create an IconComponent where I can Input()
an icon name which will be used as part of an url for the mask image. Another Input()
holds the background color. This way, I can combine different icons with different colors.
I would like to prevent creating CSS-classes for every possible icon.