The mask-mode property is set on the element being masked. It decides whether the mask-image is read as an alpha mask or a luminance mask.
It is not inherited. The initial value is match-source. You need a mask-image first — mask-mode alone does nothing.
Limited availability.
Not deprecated, but not Baseline Widely available. Safari 15.4+ support is partial (especially luminance). Prefer alpha when soft transparency from PNGs or gradients is enough.
Default value.match-source is the initial setting.
Gradient source. CSS images resolve to alpha, so this matches Example 1.
SVG exception. An SVG <mask> defaults to luminance via its mask-type.
Override anytime. Set alpha or luminance explicitly when you need a fixed rule.
Edge Cases & Pitfalls
Most confusion comes from opaque colors looking identical until luminance is on.
need
Needs mask-image
Without a mask layer, changing mask-mode has no visible effect.
alpha
Opaque colors look the same in alpha
Black, green, and white are all fully opaque. Only luminance treats them differently.
svg
SVG <mask> defaults to luminance
With match-source, SVG masks follow mask-type (default luminance). Set mask-mode: alpha to force transparency-only.
safari
Safari luminance is partial
Test luminance carefully in Safari. Prefer alpha masks when you need reliable cross-browser fades.
Compatibility
Browser Support
mask-mode is a browser CSS property. Node.js, Deno, and Bun do not apply it.
✓ Limited availability
mask-mode
Chrome 120+, Edge 120+, Firefox 53+, Opera 106+, Samsung Internet 25+. Safari 15.4+ has partial support. Internet Explorer has no support.
76%Full support reach
Google Chrome120+
Full support
Mozilla Firefox53+
Full support
Apple Safari15.4+
Partial support
Microsoft Edge120+
Full support
Opera106+
Full support
Samsung Internet25.0+
Full support
Internet ExplorerNo support
Not supported
mask-modeLimited / partial in Safari
Bottom line: Use with progressive enhancement. Prefer alpha for the widest reliable effect. Not a server runtime API.
Remember
Key Takeaways
Role: choose how mask-image is interpreted — alpha or luminance.
Values:alpha, luminance, match-source.
Initial value:match-source. Not inherited.
Tip: white shows, black hides — but only when luminance is active.
One line:mask-mode picks whether the mask listens to transparency only, or to brightness too.
Frequently Asked Questions
It tells the browser whether to read a mask as alpha (transparency only) or luminance (brightness × alpha). It is set on the element being masked.
The initial value is match-source. Image and gradient masks resolve to alpha; SVG <mask> sources default to luminance unless mask-type says otherwise.
Alpha ignores color and uses only transparency. Luminance also uses brightness: white shows, black hides, and mid colors partially show.
No. mask-mode only changes how an existing mask-image (or mask layer) is interpreted.
Use luminance for grayscale or colored masks where brightness should control visibility—especially SVG <mask> artwork.
Limited availability: Chrome 120+, Edge 120+, Firefox 53+, Opera 106+, Samsung Internet 25+. Safari 15.4+ has partial support (luminance can be unreliable). Internet Explorer does not support it. It is a browser CSS property, not a Node.js feature.