coderef

mask-typeBaseline · Widely available

The mask-type CSS property on an SVG <mask> element sets whether the mask is a luminance or alpha mask.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Jan 15, 2020. Widely available since Jul 15, 2022.

Browser support

DesktopChrome
1–23Not supported
24+Supportedsince Jan 10, 2013
Current: 155
Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154
Firefox
1–34Not supported
35+Supportedsince Jan 13, 2015
Current: 157
Safari
1–6Not supported
7+Supportedsince Oct 22, 2013
Current: 27
MobileChrome Android
18–18Not supported
25+Supportedsince Feb 27, 2013
Current: 155
Firefox Android
4–34Not supported
35+Supportedsince Jan 13, 2015
Current: 157
Safari iOS
1–6Not supported
7+Supportedsince Sep 18, 2013
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: mask-type.

Feature detection

CSS · check before using
@supports (mask-type: initial) {
  /* styles that rely on mask-type */
}

/* or in JavaScript */
if (CSS.supports("mask-type", "initial")) {
  // use it
}

Documentation (MDN)

Specification

Sub-features

Support for each part of the feature (3). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
mask-type247935725357
mask-type.alpha247935725357
mask-type.luminance247935725357