sdxc

[ @sdxc/u/size ]

min-height

Applies the physical min-height property.

import { minHeight } from "@sdxc/u/size";

Quick reference

Every documented call, beside the CSS it emits.

CallCSS
u.minHeight("full")css({ minHeight: "100%" })

Examples

Basic example

Use minHeight(n) to give an element a minimum height; content taller than the minimum still grows past it:

One line.

Several lines of text, more than the minimum holds, so the card grows.

<div mix={[hstack({ gap: 4, align: "start" })]}>
	<div mix={[minHeight(32), width(48), ...]}>
		<p mix={[...]}>One line.</p>
	</div>
	<div mix={[minHeight(32), width(48), ...]}>
		<p mix={[...]}>
			Several lines of text, more than the minimum holds, so the card grows.
		</p>
	</div>
</div>

Combine minHeight() with a stack that spreads its children to keep a card's footer at its bottom edge, however short the content:

A short note.

Updated today

<div mix={[vstack({ justify: "between" }), minHeight(48), width(64), ...]}>
	<p mix={[...]}>A short note.</p>
	<p mix={[...]}>Updated today</p>
</div>

Applying on a state

Wrap the call in a state utility to scope it to one selector.

u.hover(u.minHeight("full"))

Responsive design

Wrap the call in a container query to scope it to one width.

u.at("md", u.minHeight("full"))

Customizing your theme

Customizing spacing

Every numeric step multiplies --ui-spacing, so redefining it rescales every spacing and sizing utility at once:

:root {
	--ui-spacing: 0.25rem;
}

Every call that names the step now reads the new value:

minHeight(4)

Signature

u.minHeight(value: SizeValue)

Written by Sergio Xalambrí. Follow @sergiodxa for new packages, or sponsor the work.