gap

Class Description

gap

Sets gap between flex/grid children via --gap. Scaled.

CSS Rules

.gap {
  gap: calc(var(--spacing) * var(--gap));
}

Usage

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

Responsive

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

<element class="md:gap" style="--md-gap: /* 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="gap:hover" style="--gap-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="gap: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 gap::before" style="--gap-before: /* value */;" />

<element class="content-after gap::after" style="--gap-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="gap=value" />

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

CLS Alert

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

.gap Sets gap between flex/grid children via --gap. Scaled.

gap-x

Sets column-gap via --gap-x. Scaled.

CSS Rules

.gap-x {
  column-gap: calc(var(--spacing) * var(--gap-x));
}

Usage

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

Responsive

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

<element class="md:gap-x" style="--md-gap-x: /* 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="gap-x:hover" style="--gap-x-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="gap-x: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 gap-x::before" style="--gap-x-before: /* value */;" />

<element class="content-after gap-x::after" style="--gap-x-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="gap-x=value" />

<!-- Output -->
<element class="gap-x" style="--gap-x: value;" />

CLS Alert

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

.gap-x Sets column-gap via --gap-x. Scaled.

gap-y

Sets row-gap via --gap-y. Scaled.

CSS Rules

.gap-y {
  row-gap: calc(var(--spacing) * var(--gap-y));
}

Usage

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

Responsive

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

<element class="md:gap-y" style="--md-gap-y: /* 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="gap-y:hover" style="--gap-y-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="gap-y: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 gap-y::before" style="--gap-y-before: /* value */;" />

<element class="content-after gap-y::after" style="--gap-y-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="gap-y=value" />

<!-- Output -->
<element class="gap-y" style="--gap-y: value;" />

CLS Alert

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

.gap-y Sets row-gap via --gap-y. Scaled.

[gap]

Applies raw --gap directly as gap between flex/grid children. Use for custom, unscaled spacing.

CSS Rules

.\[gap\] {
  gap: var(--gap);
}

Usage

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

Responsive

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

<element class="md:[gap]" style="--md-gap: /* 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="[gap]:hover" style="--gap-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="[gap]: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 [gap]::before" style="--gap-before: /* value */;" />

<element class="content-after [gap]::after" style="--gap-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="[gap]=value" />

<!-- Output -->
<element class="[gap]" style="--gap: value;" />

CLS Alert

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

.[gap] Applies raw --gap directly as gap between flex/grid children. Use for custom, unscaled spacing.

[gap-x]

Applies raw --gap-x directly as column-gap. Controls horizontal space between grid/flex items.

CSS Rules

.\[gap-x\] {
  column-gap: var(--gap-x);
}

Usage

The .[gap-x] class is flagged as a value-driven selector. The variable --gap-x is required.
<element class="[gap-x]" style="--gap-x: /* value */;" />

Responsive

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

<element class="md:[gap-x]" style="--md-gap-x: /* 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="[gap-x]:hover" style="--gap-x-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="[gap-x]: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 [gap-x]::before" style="--gap-x-before: /* value */;" />

<element class="content-after [gap-x]::after" style="--gap-x-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="[gap-x]=value" />

<!-- Output -->
<element class="[gap-x]" style="--gap-x: value;" />

CLS Alert

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

.[gap-x] Applies raw --gap-x directly as column-gap. Controls horizontal space between grid/flex items.

[gap-y]

Applies raw --gap-y directly as row-gap. Controls vertical space between grid/flex items.

CSS Rules

.\[gap-y\] {
  row-gap: var(--gap-y);
}

Usage

The .[gap-y] class is flagged as a value-driven selector. The variable --gap-y is required.
<element class="[gap-y]" style="--gap-y: /* value */;" />

Responsive

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

<element class="md:[gap-y]" style="--md-gap-y: /* 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="[gap-y]:hover" style="--gap-y-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="[gap-y]: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 [gap-y]::before" style="--gap-y-before: /* value */;" />

<element class="content-after [gap-y]::after" style="--gap-y-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="[gap-y]=value" />

<!-- Output -->
<element class="[gap-y]" style="--gap-y: value;" />

CLS Alert

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

.[gap-y] Applies raw --gap-y directly as row-gap. Controls vertical space between grid/flex items.