How to produce a single-color icon with a CSS mask
Answer in brief
Use the icon as a mask on an element painted with the desired color. For an alpha mask, opaque areas reveal the paint while transparent areas hide it.
Tint a bookmark with the link color
Apply background-color: currentColor to a square and use a transparent bookmark as its mask image. Size the mask to contain, center it and disable repetition. Compare normal and hover colors alongside the link text.
Diagnose a solid square where a glyph should be
View the mask asset on a transparency checkerboard. An opaque white background reveals paint just like an opaque black shape in an alpha mask. Remove the backdrop in the asset or supply a mask with the intended alpha silhouette, then inspect the inside opening as well as the outer edge.
Sources
- [1] mask-image CSS property - CSS — MDN Web Docs, accessed November 23, 2026
Frequently asked questions
Will the original material colors survive?
A mask controls visibility. Use the original colored image when the metal, glaze or gradients convey meaning.