CSS - -webkit-mask-composite

The -webkit-mask-composite property specifies the manner in which multiple mask images applied to the same element are composited with one another. Mask images are composited in the opposite order that they are declared with the -webkit-mask-image property.

Example

 

CSS
.example {
  -webkit-mask-image: url(mask1.png), url('mask2.png');
  -webkit-mask-composite: xor, source-over;
}

Syntax  

CSS
/* Keyword values */
-webkit-mask-composite: clear;
-webkit-mask-composite: copy;
-webkit-mask-composite: source-over;
-webkit-mask-composite: source-in;
-webkit-mask-composite: source-out;
-webkit-mask-composite: source-atop;
-webkit-mask-composite: destination-over;
-webkit-mask-composite: destination-in;
-webkit-mask-composite: destination-out;
-webkit-mask-composite: destination-atop;
-webkit-mask-composite: xor;

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

Description  

Non-standard
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

The -webkit-mask-composite property specifies the manner in which multiple mask images applied to the same element are composited with one another. Mask images are composited in the opposite order that they are declared with the -webkit-mask-image property.

There is a standardized mask-composite property covering parts of this non-standard property using different keywords.

Initial valuesource-over
Applies toall elements
Inheritedno
Mediavisual
Computed valueas specified
Animatableno
Canonical orderorder of appearance in the formal grammar of the values

Browser Compatibility  

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 1.0 No support No support No support 4.0
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support 2.1 No support No support No support 3.2

Specifications  

This property is specified as mask-composite using different values.

 

clear
Overlapping pixels in the source mask image and the destination mask image are cleared.
copy
The source mask image replaces the destination mask image.
source-over
The source mask image is rendered over the destination mask image.
source-in
Overlapping pixels in the source mask image and the destination mask image are replaced by the pixels of the source mask image; all other pixels are cleared.
source-out
Overlapping pixels in the source mask image and the destination mask image are cleared; all remaining pixels of the source mask image are rendered.
source-atop
The pixels of the destination mask image are rendered. The pixels of the source mask image are rendered only if they overlap a nontransparent portion of the destination mask image. This causes the source mask image to have no effect.
destination-over
The destination mask image is rendered over the source mask image.
destination-in
Overlapping pixels in the source mask image and the destination mask image remain the pixels of the destination mask image; all other pixels are cleared.
destination-out
Overlapping pixels in the source mask image and the destination mask image are cleared; all remaining pixels of the source mask image are rendered.
destination-atop
The pixels of the source mask image are rendered. The pixels of the destination mask image are rendered only if they overlap a nontransparent portion of the destination mask image. This causes the destination mask image to have no effect.
xor
Overlapping pixels in the source mask image and the destination mask image become fully transparent if they are both fully opaque.

Formal syntax

CSS
<a href="css/-webkit-mask-composite#composite-style"><composite-style></a> <a title="Brackets" href="css/value_definition_syntax#brackets">[</a> , <a href="css/-webkit-mask-composite#composite-style"><composite-style></a> <a title="Brackets" href="css/value_definition_syntax#brackets">]</a><a title="Asterisk" href="css/value_definition_syntax#asterisk_(*)">*</a><p>where <br><code><composite-style> = clear <a title="Single bar" href="css/value_definition_syntax#single_bar">|</a> copy <a title="Single bar" href="css/value_definition_syntax#single_bar">|</a> source-over <a title="Single bar" href="css/value_definition_syntax#single_bar">|</a> source-in <a title="Single bar" href="css/value_definition_syntax#single_bar">|</a> source-out <a title="Single bar" href="css/value_definition_syntax#single_bar">|</a> source-atop <a title="Single bar" href="css/value_definition_syntax#single_bar">|</a> destination-over <a title="Single bar" href="css/value_definition_syntax#single_bar">|</a> destination-in <a title="Single bar" href="css/value_definition_syntax#single_bar">|</a> destination-out <a title="Single bar" href="css/value_definition_syntax#single_bar">|</a> destination-atop <a title="Single bar" href="css/value_definition_syntax#single_bar">|</a> xor</code></p>

License

© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/css/-webkit-mask-composite

CSS CSS Masks CSS Property Non-standard Reference