mask-position

Class Description

mask-position

Positions the mask layer that controls which parts of an element are visible.

CSS Rules

.mask-position {
  mask-position: var(--mask-position);
}

Usage

The .mask-position class is flagged as a value-driven selector. The variable --mask-position is required.
<element class="mask-position" style="--mask-position: /* value */;" />

Responsive

Prefix .mask-position utility with a breakpoint variant (e.g., md:) to apply styles at specific screen sizes (Supported breakpoints are xm through 2xl).

<element class="md:mask-position" style="--md-mask-position: /* value */;" />

States

States are generated dynamically at runtime and always come last. Append a state like :hover or :focus to the end of the class. This works in conjunction with breakpoints .

Supported pseudo-classes: :hover, :active, :focus, :focus-visible, :focus-within, :target, :checked, :disabled, and :group-hover.

<element class="mask-position:hover" style="--mask-position-hover: /* value */;" />

Group Hover Example

The :group-hover state applies styles when a parent element with the .group class is hovered.

<element class="group">
  <element class="mask-position:group-hover">...</element>
</element>

Pseudo-Elements

The ::before and ::after utility classes are supported too. Granted that you add the mandatory content-before or content-after class in order for them to work.

<element class="content-before mask-position::before" style="--mask-position-before: /* value */;" />

<element class="content-after mask-position::after" style="--mask-position-after: /* value */;" />

Shorthand

Value-driven classes support a shorthand syntax like bg=pink or p=4. The runtime processes this for you. Unlike :hover that is generating CSS on the fly, shorthand only splits it and appends the corresponding style.

<!-- Input -->
<element class="mask-position=value" />

<!-- Output -->
<element class="mask-position" style="--mask-position: value;" />

CLS Alert

This feature may cause CLS (Cumulative Layout Shift). Make sure to include a z-not-ready class in your <head> tag.

.mask-position Positions the mask layer that controls which parts of an element are visible.

mask-top-left

Positions the mask image at the top-left corner via mask-position.

CSS Rules

.mask-top-left {
  mask-position: top left;
}

Usage

<element class="mask-top-left" />

Responsive

Prefix .mask-top-left utility with a breakpoint variant (e.g., md:) to apply styles at specific screen sizes (Supported breakpoints are xm through 2xl).

<element class="md:mask-top-left" />

States

States are generated dynamically at runtime and always come last. Append a state like :hover or :focus to the end of the class. This works in conjunction with breakpoints .

Supported pseudo-classes: :hover, :active, :focus, :focus-visible, :focus-within, :target, :checked, :disabled, and :group-hover.

<element class="mask-top-left:hover" />

Group Hover Example

The :group-hover state applies styles when a parent element with the .group class is hovered.

<element class="group">
  <element class="mask-top-left:group-hover">...</element>
</element>

Pseudo-Elements

The ::before and ::after utility classes are supported too. Granted that you add the mandatory content-before or content-after class in order for them to work.

<element class="content-before mask-top-left::before" />

<element class="content-after mask-top-left::after" />
.mask-top-left Positions the mask image at the top-left corner via mask-position.

mask-top

Positions the mask image at the top-center via mask-position.

CSS Rules

.mask-top {
  mask-position: top;
}

Usage

<element class="mask-top" />

Responsive

Prefix .mask-top utility with a breakpoint variant (e.g., md:) to apply styles at specific screen sizes (Supported breakpoints are xm through 2xl).

<element class="md:mask-top" />

States

States are generated dynamically at runtime and always come last. Append a state like :hover or :focus to the end of the class. This works in conjunction with breakpoints .

Supported pseudo-classes: :hover, :active, :focus, :focus-visible, :focus-within, :target, :checked, :disabled, and :group-hover.

<element class="mask-top:hover" />

Group Hover Example

The :group-hover state applies styles when a parent element with the .group class is hovered.

<element class="group">
  <element class="mask-top:group-hover">...</element>
</element>

Pseudo-Elements

The ::before and ::after utility classes are supported too. Granted that you add the mandatory content-before or content-after class in order for them to work.

<element class="content-before mask-top::before" />

<element class="content-after mask-top::after" />
.mask-top Positions the mask image at the top-center via mask-position.

mask-top-right

Positions the mask image at the top-right corner via mask-position.

CSS Rules

.mask-top-right {
  mask-position: top right;
}

Usage

<element class="mask-top-right" />

Responsive

Prefix .mask-top-right utility with a breakpoint variant (e.g., md:) to apply styles at specific screen sizes (Supported breakpoints are xm through 2xl).

<element class="md:mask-top-right" />

States

States are generated dynamically at runtime and always come last. Append a state like :hover or :focus to the end of the class. This works in conjunction with breakpoints .

Supported pseudo-classes: :hover, :active, :focus, :focus-visible, :focus-within, :target, :checked, :disabled, and :group-hover.

<element class="mask-top-right:hover" />

Group Hover Example

The :group-hover state applies styles when a parent element with the .group class is hovered.

<element class="group">
  <element class="mask-top-right:group-hover">...</element>
</element>

Pseudo-Elements

The ::before and ::after utility classes are supported too. Granted that you add the mandatory content-before or content-after class in order for them to work.

<element class="content-before mask-top-right::before" />

<element class="content-after mask-top-right::after" />
.mask-top-right Positions the mask image at the top-right corner via mask-position.

mask-left

Positions the mask image at the center-left via mask-position.

CSS Rules

.mask-left {
  mask-position: left;
}

Usage

<element class="mask-left" />

Responsive

Prefix .mask-left utility with a breakpoint variant (e.g., md:) to apply styles at specific screen sizes (Supported breakpoints are xm through 2xl).

<element class="md:mask-left" />

States

States are generated dynamically at runtime and always come last. Append a state like :hover or :focus to the end of the class. This works in conjunction with breakpoints .

Supported pseudo-classes: :hover, :active, :focus, :focus-visible, :focus-within, :target, :checked, :disabled, and :group-hover.

<element class="mask-left:hover" />

Group Hover Example

The :group-hover state applies styles when a parent element with the .group class is hovered.

<element class="group">
  <element class="mask-left:group-hover">...</element>
</element>

Pseudo-Elements

The ::before and ::after utility classes are supported too. Granted that you add the mandatory content-before or content-after class in order for them to work.

<element class="content-before mask-left::before" />

<element class="content-after mask-left::after" />
.mask-left Positions the mask image at the center-left via mask-position.

mask-center

Positions the mask image at the center via mask-position.

CSS Rules

.mask-center {
  mask-position: center;
}

Usage

<element class="mask-center" />

Responsive

Prefix .mask-center utility with a breakpoint variant (e.g., md:) to apply styles at specific screen sizes (Supported breakpoints are xm through 2xl).

<element class="md:mask-center" />

States

States are generated dynamically at runtime and always come last. Append a state like :hover or :focus to the end of the class. This works in conjunction with breakpoints .

Supported pseudo-classes: :hover, :active, :focus, :focus-visible, :focus-within, :target, :checked, :disabled, and :group-hover.

<element class="mask-center:hover" />

Group Hover Example

The :group-hover state applies styles when a parent element with the .group class is hovered.

<element class="group">
  <element class="mask-center:group-hover">...</element>
</element>

Pseudo-Elements

The ::before and ::after utility classes are supported too. Granted that you add the mandatory content-before or content-after class in order for them to work.

<element class="content-before mask-center::before" />

<element class="content-after mask-center::after" />
.mask-center Positions the mask image at the center via mask-position.

mask-right

Positions the mask image at the center-right via mask-position.

CSS Rules

.mask-right {
  mask-position: right;
}

Usage

<element class="mask-right" />

Responsive

Prefix .mask-right utility with a breakpoint variant (e.g., md:) to apply styles at specific screen sizes (Supported breakpoints are xm through 2xl).

<element class="md:mask-right" />

States

States are generated dynamically at runtime and always come last. Append a state like :hover or :focus to the end of the class. This works in conjunction with breakpoints .

Supported pseudo-classes: :hover, :active, :focus, :focus-visible, :focus-within, :target, :checked, :disabled, and :group-hover.

<element class="mask-right:hover" />

Group Hover Example

The :group-hover state applies styles when a parent element with the .group class is hovered.

<element class="group">
  <element class="mask-right:group-hover">...</element>
</element>

Pseudo-Elements

The ::before and ::after utility classes are supported too. Granted that you add the mandatory content-before or content-after class in order for them to work.

<element class="content-before mask-right::before" />

<element class="content-after mask-right::after" />
.mask-right Positions the mask image at the center-right via mask-position.

mask-bottom-left

Positions the mask image at the bottom-left corner via mask-position.

CSS Rules

.mask-bottom-left {
  mask-position: bottom left;
}

Usage

<element class="mask-bottom-left" />

Responsive

Prefix .mask-bottom-left utility with a breakpoint variant (e.g., md:) to apply styles at specific screen sizes (Supported breakpoints are xm through 2xl).

<element class="md:mask-bottom-left" />

States

States are generated dynamically at runtime and always come last. Append a state like :hover or :focus to the end of the class. This works in conjunction with breakpoints .

Supported pseudo-classes: :hover, :active, :focus, :focus-visible, :focus-within, :target, :checked, :disabled, and :group-hover.

<element class="mask-bottom-left:hover" />

Group Hover Example

The :group-hover state applies styles when a parent element with the .group class is hovered.

<element class="group">
  <element class="mask-bottom-left:group-hover">...</element>
</element>

Pseudo-Elements

The ::before and ::after utility classes are supported too. Granted that you add the mandatory content-before or content-after class in order for them to work.

<element class="content-before mask-bottom-left::before" />

<element class="content-after mask-bottom-left::after" />
.mask-bottom-left Positions the mask image at the bottom-left corner via mask-position.

mask-bottom

Positions the mask image at the bottom-center via mask-position.

CSS Rules

.mask-bottom {
  mask-position: bottom;
}

Usage

<element class="mask-bottom" />

Responsive

Prefix .mask-bottom utility with a breakpoint variant (e.g., md:) to apply styles at specific screen sizes (Supported breakpoints are xm through 2xl).

<element class="md:mask-bottom" />

States

States are generated dynamically at runtime and always come last. Append a state like :hover or :focus to the end of the class. This works in conjunction with breakpoints .

Supported pseudo-classes: :hover, :active, :focus, :focus-visible, :focus-within, :target, :checked, :disabled, and :group-hover.

<element class="mask-bottom:hover" />

Group Hover Example

The :group-hover state applies styles when a parent element with the .group class is hovered.

<element class="group">
  <element class="mask-bottom:group-hover">...</element>
</element>

Pseudo-Elements

The ::before and ::after utility classes are supported too. Granted that you add the mandatory content-before or content-after class in order for them to work.

<element class="content-before mask-bottom::before" />

<element class="content-after mask-bottom::after" />
.mask-bottom Positions the mask image at the bottom-center via mask-position.

mask-bottom-right

Positions the mask image at the bottom-right corner via mask-position.

CSS Rules

.mask-bottom-right {
  mask-position: bottom right;
}

Usage

<element class="mask-bottom-right" />

Responsive

Prefix .mask-bottom-right utility with a breakpoint variant (e.g., md:) to apply styles at specific screen sizes (Supported breakpoints are xm through 2xl).

<element class="md:mask-bottom-right" />

States

States are generated dynamically at runtime and always come last. Append a state like :hover or :focus to the end of the class. This works in conjunction with breakpoints .

Supported pseudo-classes: :hover, :active, :focus, :focus-visible, :focus-within, :target, :checked, :disabled, and :group-hover.

<element class="mask-bottom-right:hover" />

Group Hover Example

The :group-hover state applies styles when a parent element with the .group class is hovered.

<element class="group">
  <element class="mask-bottom-right:group-hover">...</element>
</element>

Pseudo-Elements

The ::before and ::after utility classes are supported too. Granted that you add the mandatory content-before or content-after class in order for them to work.

<element class="content-before mask-bottom-right::before" />

<element class="content-after mask-bottom-right::after" />
.mask-bottom-right Positions the mask image at the bottom-right corner via mask-position.