mask-border-repeat

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The mask-border-repeat CSS property sets how the edge regions of a source image are adjusted to fit the dimensions of an element's mask border.

Syntax

/* Keyword value */
mask-border-repeat: stretch;
mask-border-repeat: repeat;
mask-border-repeat: round;
mask-border-repeat: space;

/* vertical | horizontal */
mask-border-repeat: round stretch;

/* Global values */
mask-border-repeat: inherit;
mask-border-repeat: initial;
mask-border-repeat: unset;

The mask-border-repeat property may be specified using one or two values chosen from the list of values below.

  • When one value is specified, it applies the same behavior on all four sides.
  • When two values are specified, the first applies to the top and bottom, the second to the left and right.

Values

stretch
The source image's edge regions are stretched to fill the gap between each border.
repeat
The source image's edge regions are tiled (repeated) to fill the gap between each border. Tiles may be clipped to achieve the proper fit.
round
The source image's edge regions are tiled (repeated) to fill the gap between each border. Tiles may be stretched to achieve the proper fit.
space
The source image's edge regions are tiled (repeated) to fill the gap between each border. Extra space will be distributed in between tiles to achieve the proper fit.

Formal syntax

[ stretch | repeat | round | space ]{1,2}

Specifications

Specification Status Comment
CSS Masking Module Level 1
The definition of 'mask-border-repeat' in that specification.
Candidate Recommendation Initial definition
Initial valuestretch
Applies toall elements; In SVG, it applies to container elements excluding the <defs> element and all graphics elements
Inheritedno
Mediavisual
Computed valueas specified
Animation typediscrete
Canonical orderper grammar

Browser compatibility

TBD

Document Tags and Contributors

Contributors to this page: ddbeck, mfluehr
Last updated by: ddbeck,