height

Class Description

h

Sets height via --h. Scaled by spacing unit. Use [h] for raw values.

CSS Rules

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

Usage

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

Responsive

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

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

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

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

CLS Alert

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

.h Sets height via --h. Scaled by spacing unit. Use [h] for raw values.

[h]

Applies raw --h directly to height. Use for custom, unscaled sizing.

CSS Rules

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

Usage

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

Responsive

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

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

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

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

CLS Alert

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

.[h] Applies raw --h directly to height. Use for custom, unscaled sizing.

h-auto

Sets height: auto.

CSS Rules

.h-auto {
  height: auto;
}

Usage

<element class="h-auto" />

Responsive

Prefix .h-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:h-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="h-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="h-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 h-auto::before" />

<element class="content-after h-auto::after" />
.h-auto Sets height: auto.

h-full

Sets height: 100%.

CSS Rules

.h-full {
  height: 100%;
}

Usage

<element class="h-full" />

Responsive

Prefix .h-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:h-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="h-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="h-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 h-full::before" />

<element class="content-after h-full::after" />
.h-full Sets height: 100%.

h-screen

Sets height: 100vh.

CSS Rules

.h-screen {
  height: 100vh;
}

Usage

<element class="h-screen" />

Responsive

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

<element class="md:h-screen" />

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="h-screen: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="h-screen: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 h-screen::before" />

<element class="content-after h-screen::after" />
.h-screen Sets height: 100vh.

h-dvh

Sets height: 100dvh (dynamic viewport height, accounts for mobile chrome).

CSS Rules

.h-dvh {
  height: 100dvh;
}

Usage

<element class="h-dvh" />

Responsive

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

<element class="md:h-dvh" />

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="h-dvh: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="h-dvh: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 h-dvh::before" />

<element class="content-after h-dvh::after" />
.h-dvh Sets height: 100dvh (dynamic viewport height, accounts for mobile chrome).

h-dvw

Sets height to 100% of the dynamic viewport width (100dvw).

CSS Rules

.h-dvw {
  height: 100dvw;
}

Usage

<element class="h-dvw" />

Responsive

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

<element class="md:h-dvw" />

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="h-dvw: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="h-dvw: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 h-dvw::before" />

<element class="content-after h-dvw::after" />
.h-dvw Sets height to 100% of the dynamic viewport width (100dvw).

h-lvh

Sets height to 100% of the large viewport height (100lvh).

CSS Rules

.h-lvh {
  height: 100lvh;
}

Usage

<element class="h-lvh" />

Responsive

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

<element class="md:h-lvh" />

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="h-lvh: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="h-lvh: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 h-lvh::before" />

<element class="content-after h-lvh::after" />
.h-lvh Sets height to 100% of the large viewport height (100lvh).

h-lvw

Sets height to 100% of the large viewport width (100lvw).

CSS Rules

.h-lvw {
  height: 100lvw;
}

Usage

<element class="h-lvw" />

Responsive

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

<element class="md:h-lvw" />

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="h-lvw: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="h-lvw: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 h-lvw::before" />

<element class="content-after h-lvw::after" />
.h-lvw Sets height to 100% of the large viewport width (100lvw).

h-svh

Sets height to 100% of the small viewport height (100svh).

CSS Rules

.h-svh {
  height: 100svh;
}

Usage

<element class="h-svh" />

Responsive

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

<element class="md:h-svh" />

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="h-svh: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="h-svh: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 h-svh::before" />

<element class="content-after h-svh::after" />
.h-svh Sets height to 100% of the small viewport height (100svh).

h-svw

Sets height to 100% of the small viewport width (100svw).

CSS Rules

.h-svw {
  height: 100svw;
}

Usage

<element class="h-svw" />

Responsive

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

<element class="md:h-svw" />

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="h-svw: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="h-svw: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 h-svw::before" />

<element class="content-after h-svw::after" />
.h-svw Sets height to 100% of the small viewport width (100svw).

h-min

Sets height to the intrinsic min-content size of the element.

CSS Rules

.h-min {
  height: min-content;
}

Usage

<element class="h-min" />

Responsive

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

<element class="md:h-min" />

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="h-min: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="h-min: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 h-min::before" />

<element class="content-after h-min::after" />
.h-min Sets height to the intrinsic min-content size of the element.

h-max

Sets height to the intrinsic max-content size of the element.

CSS Rules

.h-max {
  height: max-content;
}

Usage

<element class="h-max" />

Responsive

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

<element class="md:h-max" />

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="h-max: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="h-max: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 h-max::before" />

<element class="content-after h-max::after" />
.h-max Sets height to the intrinsic max-content size of the element.

h-fit

Sets height to fit-content, sizing based on the element's content within constraints.

CSS Rules

.h-fit {
  height: fit-content;
}

Usage

<element class="h-fit" />

Responsive

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

<element class="md:h-fit" />

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="h-fit: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="h-fit: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 h-fit::before" />

<element class="content-after h-fit::after" />
.h-fit Sets height to fit-content, sizing based on the element's content within constraints.

h-lh

Sets height to one line-height unit (1lh).

CSS Rules

.h-lh {
  height: 1lh;
}

Usage

<element class="h-lh" />

Responsive

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

<element class="md:h-lh" />

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="h-lh: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="h-lh: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 h-lh::before" />

<element class="content-after h-lh::after" />
.h-lh Sets height to one line-height unit (1lh).