transition-behavior

Class Description

transition-normal

Sets transition-behavior to normal, so transitions do not interpolate discrete properties.

CSS Rules

.transition-normal {
  transition-behavior: normal;
}

Usage

<element class="transition-normal" />

Responsive

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

<element class="md:transition-normal" />

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="transition-normal: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="transition-normal: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 transition-normal::before" />

<element class="content-after transition-normal::after" />
.transition-normal Sets transition-behavior to normal, so transitions do not interpolate discrete properties.

transition-discrete

Sets transition-behavior: allow-discrete. Enables animation of discrete properties like display.

CSS Rules

.transition-discrete {
  transition-behavior: allow-discrete;
}

Usage

<element class="transition-discrete" />

Responsive

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

<element class="md:transition-discrete" />

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="transition-discrete: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="transition-discrete: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 transition-discrete::before" />

<element class="content-after transition-discrete::after" />
.transition-discrete Sets transition-behavior: allow-discrete. Enables animation of discrete properties like display.