Sizing
Width and height on the 4px scale (w-12 is 48px, h-64 is 256px), in fractions (w-1/2) or to fill (w-full). size-10 sets both at once.
Widths
w-full
w-2/3
w-1/2
w-1/3
w-48 (12rem)
<div class="space-y-2">
<div class="box p-2 w-full">w-full</div>
<div class="box p-2 w-2/3">w-2/3</div>
<div class="box p-2 w-1/2">w-1/2</div>
<div class="box p-2 w-1/3">w-1/3</div>
<div class="box p-2 w-48">w-48 (12rem)</div>
</div>Readable lines and panels
Long text reads best around 65 characters a line: max-w-prose. Panels and forms: max-w-sm (24rem) up to max-w-7xl (80rem).
Momo keeps paragraphs at a comfortable width with max-w-prose, so eyes don't have to travel across a wide screen to find the start of the next line.
<p class="max-w-prose">Momo keeps paragraphs at a comfortable width with max-w-prose, so eyes don't have to travel across a wide screen to find the start of the next line.</p>Squares
<span class="size-8 bg-violet rounded"></span>
<span class="size-12 bg-yellow rounded-md"></span>
<span class="size-16 bg-green rounded-lg"></span>
<span class="size-20 bg-pink rounded-full"></span>Width
| Class | CSS |
|---|---|
w-full | width: 100%; |
w-auto | width: auto; |
w-fit | width: fit-content; |
w-min | width: min-content; |
w-max | width: max-content; |
w-1/2 | width: 50%; |
w-1/3 | width: 33.3333%; |
w-2/3 | width: 66.6667%; |
w-1/4 | width: 25%; |
w-3/4 | width: 75%; |
w-1/5 | width: 20%; |
w-2/5 | width: 40%; |
w-3/5 | width: 60%; |
w-4/5 | width: 80%; |
w-0 | width: 0; |
w-0.5 | width: 0.125rem; |
w-1 | width: 0.25rem; |
w-1.5 | width: 0.375rem; |
w-2 | width: 0.5rem; |
w-2.5 | width: 0.625rem; |
w-3 | width: 0.75rem; |
w-4 | width: 1rem; |
w-5 | width: 1.25rem; |
w-6 | width: 1.5rem; |
w-7 | width: 1.75rem; |
w-8 | width: 2rem; |
w-9 | width: 2.25rem; |
w-10 | width: 2.5rem; |
w-11 | width: 2.75rem; |
w-12 | width: 3rem; |
w-14 | width: 3.5rem; |
w-16 | width: 4rem; |
w-20 | width: 5rem; |
w-24 | width: 6rem; |
w-28 | width: 7rem; |
w-32 | width: 8rem; |
w-36 | width: 9rem; |
w-40 | width: 10rem; |
w-44 | width: 11rem; |
w-48 | width: 12rem; |
w-52 | width: 13rem; |
w-56 | width: 14rem; |
w-60 | width: 15rem; |
w-64 | width: 16rem; |
w-72 | width: 18rem; |
w-80 | width: 20rem; |
w-96 | width: 24rem; |
w-112 | width: 28rem; |
w-128 | width: 32rem; |
Height
h-screen and min-h-screen use the real visible height of phones (the bar that comes and goes is counted). There is no w-screen: w-full is what you want (the screen width counts the scrollbar and makes pages scroll sideways).
| Class | CSS |
|---|---|
h-full | height: 100%; |
h-auto | height: auto; |
h-screen | height: 100dvh; |
h-fit | height: fit-content; |
h-min | height: min-content; |
h-max | height: max-content; |
h-0 | height: 0; |
h-0.5 | height: 0.125rem; |
h-1 | height: 0.25rem; |
h-1.5 | height: 0.375rem; |
h-2 | height: 0.5rem; |
h-2.5 | height: 0.625rem; |
h-3 | height: 0.75rem; |
h-4 | height: 1rem; |
h-5 | height: 1.25rem; |
h-6 | height: 1.5rem; |
h-7 | height: 1.75rem; |
h-8 | height: 2rem; |
h-9 | height: 2.25rem; |
h-10 | height: 2.5rem; |
h-11 | height: 2.75rem; |
h-12 | height: 3rem; |
h-14 | height: 3.5rem; |
h-16 | height: 4rem; |
h-20 | height: 5rem; |
h-24 | height: 6rem; |
h-28 | height: 7rem; |
h-32 | height: 8rem; |
h-36 | height: 9rem; |
h-40 | height: 10rem; |
h-44 | height: 11rem; |
h-48 | height: 12rem; |
h-52 | height: 13rem; |
h-56 | height: 14rem; |
h-60 | height: 15rem; |
h-64 | height: 16rem; |
h-72 | height: 18rem; |
h-80 | height: 20rem; |
h-96 | height: 24rem; |
h-112 | height: 28rem; |
h-128 | height: 32rem; |
Width and height together
| Class | CSS |
|---|---|
size-0 | width: 0; height: 0; |
size-0.5 | width: 0.125rem; height: 0.125rem; |
size-1 | width: 0.25rem; height: 0.25rem; |
size-1.5 | width: 0.375rem; height: 0.375rem; |
size-2 | width: 0.5rem; height: 0.5rem; |
size-2.5 | width: 0.625rem; height: 0.625rem; |
size-3 | width: 0.75rem; height: 0.75rem; |
size-4 | width: 1rem; height: 1rem; |
size-5 | width: 1.25rem; height: 1.25rem; |
size-6 | width: 1.5rem; height: 1.5rem; |
size-7 | width: 1.75rem; height: 1.75rem; |
size-8 | width: 2rem; height: 2rem; |
size-9 | width: 2.25rem; height: 2.25rem; |
size-10 | width: 2.5rem; height: 2.5rem; |
size-11 | width: 2.75rem; height: 2.75rem; |
size-12 | width: 3rem; height: 3rem; |
size-14 | width: 3.5rem; height: 3.5rem; |
size-16 | width: 4rem; height: 4rem; |
size-20 | width: 5rem; height: 5rem; |
size-24 | width: 6rem; height: 6rem; |
size-28 | width: 7rem; height: 7rem; |
size-32 | width: 8rem; height: 8rem; |
size-36 | width: 9rem; height: 9rem; |
size-40 | width: 10rem; height: 10rem; |
size-44 | width: 11rem; height: 11rem; |
size-48 | width: 12rem; height: 12rem; |
size-52 | width: 13rem; height: 13rem; |
size-56 | width: 14rem; height: 14rem; |
size-60 | width: 15rem; height: 15rem; |
size-64 | width: 16rem; height: 16rem; |
size-72 | width: 18rem; height: 18rem; |
size-80 | width: 20rem; height: 20rem; |
size-96 | width: 24rem; height: 24rem; |
size-112 | width: 28rem; height: 28rem; |
size-128 | width: 32rem; height: 32rem; |
size-full | width: 100%; height: 100%; |
Min and max
Also on the whole size scale: min-w-64, max-h-96 and so on.
| Class | CSS |
|---|---|
min-w-0 | min-width: 0; |
min-w-full | min-width: 100%; |
min-w-min | min-width: min-content; |
min-w-max | min-width: max-content; |
min-w-fit | min-width: fit-content; |
min-h-0 | min-height: 0; |
min-h-full | min-height: 100%; |
min-h-screen | min-height: 100dvh; |
min-h-fit | min-height: fit-content; |
max-h-full | max-height: 100%; |
max-h-screen | max-height: 100dvh; |
max-h-none | max-height: none; |
max-w-xs | max-width: 20rem; |
max-w-sm | max-width: 24rem; |
max-w-md | max-width: 28rem; |
max-w-lg | max-width: 32rem; |
max-w-xl | max-width: 36rem; |
max-w-2xl | max-width: 42rem; |
max-w-3xl | max-width: 48rem; |
max-w-4xl | max-width: 56rem; |
max-w-5xl | max-width: 64rem; |
max-w-6xl | max-width: 72rem; |
max-w-7xl | max-width: 80rem; |
max-w-full | max-width: 100%; |
max-w-prose | max-width: 65ch; |
max-w-none | max-width: none; |