mask-type
The mask-type CSS property applies to the SVG <mask> element. It defines whether to use the luminance (brightness) or alpha (transparency) content of the mask. This property may be overridden by the mask-mode property. The mask-type property has no effect on image or gradient masks.
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 applies to the SVG <mask> element.
Cautions
- May not be supported in older browsers.
Accessibility
- Make sure visual changes are conveyed appropriately to assistive technology.