Mask-border-mode - CSS Property
Summary of characteristics of the mask-border-mode property
SVG: containers except defs, graphic elements, use.
alpha | luminancealphaDiscrète: during an animation, the mask-border-mode property passes from one value to another without transition.Single: single value (no order).Syntax diagram of mask-border-mode.
mask-border-mode property.The links in the diagram provide more details about the values.
Download the diagram.
Description of the mask-border-mode property.
-webkit-mask-box-image-..., but for mask-border-mode there isn’t even an equivalent.This page will be updated soon.
Edge masking is an operation that involves masking the perimeter of an element using a mask, which is often an image. This mask is divided into nine areas: four for the corners, four for the edges, and one for the center of the element.
The mask can work through its opacity (or its transparency): when it's transparent, the element is hidden, and when it's visible, the element is too. Of course, all shades are possible depending on the mask's transparency. It's also possible to create masks that work based on their luminance.
The property mask-border-mode indicates whether the mask works through its alpha channel (transparency) or its luminance.
Here are the properties that come into play in edge masks:
mask-border-mode:Values for mask-border-mode.
- mask-border-mode: alpha;
It's the alpha channel (the mask transparency) that's used to mask or not the element.
- mask-border-mode: luminance;
With the
luminancevalue, it's the luminance of the mask that's used to decide whether to mask the element or not. - mask-border-mode: initial; (
alpha) mask-border-mode: inherit; mask-border-mode: revert; mask-border-mode: revert-layer; mask-border-mode: revert-rule; mask-border-mode: unset;See the following pages for more details:
initial,inherit,revert,revert-layer,revert-rule,unset.
Animation of the mask-border-mode property.
The animations of mask-border-mode are theoretically possible but don't work for now, as browsers still don't recognize the property.
Simulator.
The mask used to hide the element is as follows. It is cut into nine equal parts, each 20 pixels on a side, by mask-border-slice.
The transparent parts of the mask show up on a blue background. The masking difference between white and black doesn't show in alpha mode.
However, in luminance mode, that's what makes the difference.
The sky blue background is there to clearly visualize the effect of the
mask-border-mode property.
Browsers compatibility with mask-border-mode.
For now, browsers don't handle the edge masking technique well enough (2026).
For the mask-border-mode property, there is no equivalent, even with a vendor prefix.
Historic of the mask-border-mode property.
-
CSS Masking Module Level 1
This specification module describes two ways to partially or completely hide portions of visual elements: masking and clipping.
Masking involves using another graphic element or an image as a mask.
Clipping describes the visible region of visual elements. The region can be described using certain SVG graphic elements or simple shapes. Anything outside this region is not rendered.Regardingmask-border-modeIntroduction of themask-border-modeproperty in this first version of the specification.November 15, 2012Working Draft.August 26, 2014Candidate Recommendation.
See also, about masking techniques.
The specification that standardizes everything related to masking is called CSS Masking Module.
The property mask-border-mode is described there, as well as the ones below:
Properties:













