background-origin

Class Description

bg-origin-border

Positions the background relative to the border box.

CSS Rules

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

Usage

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

Responsive

Prefix .bg-origin-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-origin-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-origin-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-origin-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-origin-border::before" />

<element class="content-after bg-origin-border::after" />
.bg-origin-border Positions the background relative to the border box.

bg-origin-padding

Positions the background relative to the padding box.

CSS Rules

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

Usage

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

Responsive

Prefix .bg-origin-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-origin-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-origin-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-origin-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-origin-padding::before" />

<element class="content-after bg-origin-padding::after" />
.bg-origin-padding Positions the background relative to the padding box.

bg-origin-content

Positions the background relative to the content box.

CSS Rules

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

Usage

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

Responsive

Prefix .bg-origin-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-origin-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-origin-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-origin-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-origin-content::before" />

<element class="content-after bg-origin-content::after" />
.bg-origin-content Positions the background relative to the content box.