docs.rodeo

MDN Web Docs mirror

mask-composite

{{CSSRef}} 

The mask-composite CSS property represents a compositing operation used on the current mask layer with the mask layers below it.

Syntax

/* Keyword values */
mask-composite: add;
mask-composite: subtract;
mask-composite: intersect;
mask-composite: exclude;

/* Global values */
mask-composite: inherit;
mask-composite: initial;
mask-composite: revert;
mask-composite: revert-layer;
mask-composite: unset;

One or more of the keyword values listed below, separated by commas.

Values

For the composition the current mask layer is referred to as source, while all layers below it are referred to as destination.

Formal definition

{{cssinfo}} 

Formal syntax

{{csssyntax}} 

Examples

Compositing mask layers with addition

<div class="masked"></div>
.masked {
  width: 100px;
  height: 100px;
  background-color: red;

  mask-image:
    url(https://mdn.github.io/shared-assets/images/examples/mdn.svg),
    url(https://mdn.github.io/shared-assets/images/examples/mask-star.svg);
  mask-size: 100% 100%;
  mask-composite: subtract;
}

{{EmbedLiveSample("mask-composite-example", "", "150px")}} 

Specifications

{{Specifications}} 

Browser compatibility

{{Compat}} 

See also

In this article

View on MDN