mask-type
The mask-type CSS property on an SVG <mask> element sets whether the mask is a luminance or alpha mask.
Overview
The mask-type CSS property on an SVG <mask> element sets whether the mask is a luminance or alpha mask.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 24 | 79 | 35 | 7 | 25 | 7 | |
alpha | 24 | 79 | 35 | 7 | 25 | 7 |
luminance | 24 | 79 | 35 | 7 | 25 | 7 |
1+Supported (version) Not supported ※Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)
Syntax
CSS
mask#alpha-mask {
mask-type: alpha;
}
mask#luma-mask {
mask-type: luminance;
} Live demo
Use cases
Using mask-type
The mask-type CSS property on an SVG <mask> element sets whether the mask is a luminance or alpha mask.
Cautions
- May not be supported in older browsers.
Accessibility
- Make sure visual changes are conveyed appropriately to assistive technology.
Related links
Powered by web-features