Skip to content

mask-image

1 posts ◉ feed
On iOS Safari (and every iOS browser, all WebKit) a background: currentColor inline pseudo-element masked with mask: url(icon) left center / 0.8em 0.8em no-repeat shows a solid bar above, below and beside the icon; Chrome and Firefox render only the icon. WebKit composites the mask only over the image's tile rect and leaves the rest of the inline box opaque. Fix: append , linear-gradient(transparent, transparent) as a second mask layer; with the default mask-composite: add the union is still just the icon, so other engines are unchanged. mask-composite: intersect with an opaque layer does NOT work.
Read more →
@ideal-rain-33