flex-grow

Class Description

grow

Lets a flex item grow by the --grow factor when extra space is available.

CSS Rules

.grow {
  flex-grow: var(--grow);
}

Usage

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

Responsive

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

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

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

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

CLS Alert

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

.grow Lets a flex item grow by the --grow factor when extra space is available.

grow-1

Sets flex-grow: 1. Item grows to fill available space.

CSS Rules

.grow-1 {
  flex-grow: 1;
}

Usage

<element class="grow-1" />

Responsive

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

<element class="md:grow-1" />

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="grow-1: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="grow-1: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 grow-1::before" />

<element class="content-after grow-1::after" />
.grow-1 Sets flex-grow: 1. Item grows to fill available space.

grow-0

Sets flex-grow: 0. Item will not grow.

CSS Rules

.grow-0 {
  flex-grow: 0;
}

Usage

<element class="grow-0" />

Responsive

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

<element class="md:grow-0" />

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="grow-0: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="grow-0: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 grow-0::before" />

<element class="content-after grow-0::after" />
.grow-0 Sets flex-grow: 0. Item will not grow.