{"id":335415,"date":"2021-03-02T07:56:01","date_gmt":"2021-03-02T15:56:01","guid":{"rendered":"https:\/\/css-tricks.com\/?page_id=335415"},"modified":"2021-05-13T10:21:33","modified_gmt":"2021-05-13T17:21:33","slug":"mask-type","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/almanac\/properties\/m\/mask-type\/","title":{"rendered":"mask-type"},"content":{"rendered":"\n

The mask-type<\/code> CSS property indicates whether the SVG <mask><\/code> element is treated as an alpha mask or a luminance mask.<\/p>\n\n\n\n

mask {\n  mask-type: alpha;\n}<\/code><\/pre>\n\n\n\n

When the mask layer is an image or a gradient, a mask-mode<\/code><\/a> property can be set on the HTML element to specify the type of masking. However, if an SVG <mask><\/code> element is used as the mask layer, the mask-type<\/code> can be set on the <mask><\/code> element itself. The mask-mode<\/code> property can override this preference.<\/p>\n\n\n

Syntax<\/h3>\n\n\n
mask-type: alpha | luminance<\/code><\/pre>\n\n\n\n

The property accepts one keyword value of the alpha and luminance values.<\/p>\n\n\n\n