backface-visibility

Class Description

backface-hidden

Sets backface-visibility: hidden. Hides the back face of flipped elements.

CSS Rules

.backface-hidden {
  backface-visibility: hidden;
}

Usage

<element class="backface-hidden" />

Responsive

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

<element class="md:backface-hidden" />

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="backface-hidden: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="backface-hidden: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 backface-hidden::before" />

<element class="content-after backface-hidden::after" />
.backface-hidden Sets backface-visibility: hidden. Hides the back face of flipped elements.

backface-visible

Sets backface-visibility: visible.

CSS Rules

.backface-visible {
  backface-visibility: visible;
}

Usage

<element class="backface-visible" />

Responsive

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

<element class="md:backface-visible" />

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="backface-visible: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="backface-visible: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 backface-visible::before" />

<element class="content-after backface-visible::after" />
.backface-visible Sets backface-visibility: visible.