flex-basis

Class Description

basis

Sets flex-basis via --basis. Scaled. Use [basis] for raw values.

CSS Rules

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

Usage

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

Responsive

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

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

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

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

CLS Alert

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

.basis Sets flex-basis via --basis. Scaled. Use [basis] for raw values.

[basis]

Applies raw --basis directly to flex-basis. Controls the starting size of a flex item.

CSS Rules

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

Usage

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

Responsive

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

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

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

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

CLS Alert

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

.[basis] Applies raw --basis directly to flex-basis. Controls the starting size of a flex item.

basis-3xs

Sets flex-basis to 3xs container width.

CSS Rules

.basis-3xs {
  flex-basis: var(--container-3xs);
}

Usage

<element class="basis-3xs" />

Responsive

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

<element class="md:basis-3xs" />

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="basis-3xs: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="basis-3xs: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 basis-3xs::before" />

<element class="content-after basis-3xs::after" />
.basis-3xs Sets flex-basis to 3xs container width.

basis-2xs

Sets flex-basis to 2xs container width.

CSS Rules

.basis-2xs {
  flex-basis: var(--container-2xs);
}

Usage

<element class="basis-2xs" />

Responsive

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

<element class="md:basis-2xs" />

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="basis-2xs: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="basis-2xs: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 basis-2xs::before" />

<element class="content-after basis-2xs::after" />
.basis-2xs Sets flex-basis to 2xs container width.

basis-xs

Sets flex-basis to extra small container width.

CSS Rules

.basis-xs {
  flex-basis: var(--container-xs);
}

Usage

<element class="basis-xs" />

Responsive

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

<element class="md:basis-xs" />

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="basis-xs: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="basis-xs: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 basis-xs::before" />

<element class="content-after basis-xs::after" />
.basis-xs Sets flex-basis to extra small container width.

basis-sm

Sets flex-basis to small container width.

CSS Rules

.basis-sm {
  flex-basis: var(--container-sm);
}

Usage

<element class="basis-sm" />

Responsive

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

<element class="md:basis-sm" />

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="basis-sm: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="basis-sm: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 basis-sm::before" />

<element class="content-after basis-sm::after" />
.basis-sm Sets flex-basis to small container width.

basis-md

Sets flex-basis to medium container width.

CSS Rules

.basis-md {
  flex-basis: var(--container-md);
}

Usage

<element class="basis-md" />

Responsive

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

<element class="md:basis-md" />

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="basis-md: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="basis-md: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 basis-md::before" />

<element class="content-after basis-md::after" />
.basis-md Sets flex-basis to medium container width.

basis-lg

Sets flex-basis to large container width.

CSS Rules

.basis-lg {
  flex-basis: var(--container-lg);
}

Usage

<element class="basis-lg" />

Responsive

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

<element class="md:basis-lg" />

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="basis-lg: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="basis-lg: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 basis-lg::before" />

<element class="content-after basis-lg::after" />
.basis-lg Sets flex-basis to large container width.

basis-xl

Sets flex-basis to extra large container width.

CSS Rules

.basis-xl {
  flex-basis: var(--container-xl);
}

Usage

<element class="basis-xl" />

Responsive

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

<element class="md:basis-xl" />

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="basis-xl: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="basis-xl: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 basis-xl::before" />

<element class="content-after basis-xl::after" />
.basis-xl Sets flex-basis to extra large container width.

basis-2xl

Sets flex-basis to 2xl container width.

CSS Rules

.basis-2xl {
  flex-basis: var(--container-2xl);
}

Usage

<element class="basis-2xl" />

Responsive

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

<element class="md:basis-2xl" />

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="basis-2xl: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="basis-2xl: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 basis-2xl::before" />

<element class="content-after basis-2xl::after" />
.basis-2xl Sets flex-basis to 2xl container width.

basis-3xl

Sets flex-basis to 3xl container width.

CSS Rules

.basis-3xl {
  flex-basis: var(--container-3xl);
}

Usage

<element class="basis-3xl" />

Responsive

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

<element class="md:basis-3xl" />

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="basis-3xl: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="basis-3xl: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 basis-3xl::before" />

<element class="content-after basis-3xl::after" />
.basis-3xl Sets flex-basis to 3xl container width.

basis-4xl

Sets flex-basis to 4xl container width.

CSS Rules

.basis-4xl {
  flex-basis: var(--container-4xl);
}

Usage

<element class="basis-4xl" />

Responsive

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

<element class="md:basis-4xl" />

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="basis-4xl: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="basis-4xl: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 basis-4xl::before" />

<element class="content-after basis-4xl::after" />
.basis-4xl Sets flex-basis to 4xl container width.

basis-5xl

Sets flex-basis to 5xl container width.

CSS Rules

.basis-5xl {
  flex-basis: var(--container-5xl);
}

Usage

<element class="basis-5xl" />

Responsive

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

<element class="md:basis-5xl" />

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="basis-5xl: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="basis-5xl: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 basis-5xl::before" />

<element class="content-after basis-5xl::after" />
.basis-5xl Sets flex-basis to 5xl container width.

basis-6xl

Sets flex-basis to 6xl container width.

CSS Rules

.basis-6xl {
  flex-basis: var(--container-6xl);
}

Usage

<element class="basis-6xl" />

Responsive

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

<element class="md:basis-6xl" />

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="basis-6xl: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="basis-6xl: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 basis-6xl::before" />

<element class="content-after basis-6xl::after" />
.basis-6xl Sets flex-basis to 6xl container width.

basis-7xl

Sets flex-basis to 7xl container width.

CSS Rules

.basis-7xl {
  flex-basis: var(--container-7xl);
}

Usage

<element class="basis-7xl" />

Responsive

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

<element class="md:basis-7xl" />

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="basis-7xl: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="basis-7xl: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 basis-7xl::before" />

<element class="content-after basis-7xl::after" />
.basis-7xl Sets flex-basis to 7xl container width.

basis-auto

Sets flex-basis to auto, basing its size on the element's content.

CSS Rules

.basis-auto {
  flex-basis: auto;
}

Usage

<element class="basis-auto" />

Responsive

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

<element class="md:basis-auto" />

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="basis-auto: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="basis-auto: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 basis-auto::before" />

<element class="content-after basis-auto::after" />
.basis-auto Sets flex-basis to auto, basing its size on the element's content.

basis-full

Sets flex-basis to 100%.

CSS Rules

.basis-full {
  flex-basis: 100%;
}

Usage

<element class="basis-full" />

Responsive

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

<element class="md:basis-full" />

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="basis-full: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="basis-full: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 basis-full::before" />

<element class="content-after basis-full::after" />
.basis-full Sets flex-basis to 100%.