Sizing

min-width

Setting the minimum width of an element.

Overview

ClassDeclarations
min-vhmin-height: 100vh;
min-w:fullmin-width: 100%;
min-w:fitmin-width: fit-content;
min-w:minmin-width: min-content;
min-w:maxmin-width: max-content;
min-w:3xsmin-width: var(--container-3xs);
min-w:2xsmin-width: var(--container-2xs);
min-w:xsmin-width: var(--container-xs);
min-w:smmin-width: var(--container-sm);
min-w:mdmin-width: var(--container-md);
min-w:lgmin-width: var(--container-lg);
min-w:xlmin-width: var(--container-xl);
min-w:2xlmin-width: var(--container-2xl);
min-w:3xlmin-width: var(--container-3xl);
min-w:4xlmin-width: var(--container-4xl);
min-w:5xlmin-width: var(--container-5xl);
min-w:6xlmin-width: var(--container-6xl);
min-w:7xlmin-width: var(--container-7xl);
min-w:<size>min-width: <size>;

Examples

Preserve a minimum inline size

Use min-w:* to keep an element from shrinking below a usable width. It is useful for buttons, sidebars, table columns, and controls with fixed affordances.

<button class="min-w:32x px:md">    Continue</button>
Generated CSS
@layer utilities {    .min-w\:32x {        min-width: 8rem    }}

Allow flexible children to shrink

In flex and grid layouts, min-w:0 is often the fix for text or media that refuses to shrink inside a constrained container.

<article class="flex gap:md">    <img class="size:12x flex:0" alt="" />    <div class="min-w:0 overflow:hidden">        Long content can truncate instead of widening the row.    </div></article>

Combine with width and max-width

Use min-w:* as a lower bound, then let w:* or max-w:* describe the preferred or upper size.

<aside class="w:50% min-w:40x max-w:4xl">    ...</aside>

Use intrinsic keywords

Use min-w:fit, min-w:min, or min-w:max when content sizing should drive the lower bound.

<nav class="min-w:max">    ...</nav>

Apply conditionally

Apply styles based on different states using selectors and conditional queries.

<div class="min-w:0 min-w:32x@sm min-w:fit:hover min-w:0@print">...</div>

Use max-width for upper bounds and width for the preferred size.


  • Master UI


© 2026 Aoyue Design LLC.MIT License
Trademark Policy