background-clip

Class Description

bg-clip-border

Sets background-clip: border-box. Background extends under the border.

CSS Rules

.bg-clip-border {
  background-clip: border-box;
}

Usage

<element class="bg-clip-border" />

Responsive

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

<element class="md:bg-clip-border" />

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="bg-clip-border: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="bg-clip-border: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 bg-clip-border::before" />

<element class="content-after bg-clip-border::after" />
.bg-clip-border Sets background-clip: border-box. Background extends under the border.

bg-clip-padding

Sets background-clip: padding-box. Background is clipped to the padding edge.

CSS Rules

.bg-clip-padding {
  background-clip: padding-box;
}

Usage

<element class="bg-clip-padding" />

Responsive

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

<element class="md:bg-clip-padding" />

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="bg-clip-padding: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="bg-clip-padding: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 bg-clip-padding::before" />

<element class="content-after bg-clip-padding::after" />
.bg-clip-padding Sets background-clip: padding-box. Background is clipped to the padding edge.

bg-clip-content

Clips the background to the content box.

CSS Rules

.bg-clip-content {
  background-clip: content-box;
}

Usage

<element class="bg-clip-content" />

Responsive

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

<element class="md:bg-clip-content" />

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="bg-clip-content: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="bg-clip-content: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 bg-clip-content::before" />

<element class="content-after bg-clip-content::after" />
.bg-clip-content Clips the background to the content box.

bg-clip-text

Clips the background to the text shape. Use with bg to create gradient text.

CSS Rules

.bg-clip-text {
  background-clip: text;
}

Usage

<element class="bg-clip-text" />

Responsive

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

<element class="md:bg-clip-text" />

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="bg-clip-text: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="bg-clip-text: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 bg-clip-text::before" />

<element class="content-after bg-clip-text::after" />
.bg-clip-text Clips the background to the text shape. Use with bg to create gradient text.