Tailwind CSS Cheat Sheet

/ By Sam Kent

A comprehensive Tailwind CSS cheat sheet featuring the most popular utility classes for fast and efficient development. This is a working progress, mainly used for my own projects. If you stumble across this, let me know and help me improve it!

Spacing

Class (e.g. p-)Pixelsrem
00px0rem
0.52px0.125rem
14px0.25rem
1.56px0.375rem
28px0.5rem
2.510px0.625rem
312px0.75rem
3.514px0.875rem
416px1rem
520px1.25rem
624px1.5rem
728px1.75rem
832px2rem
936px2.25rem
1040px2.5rem
1144px2.75rem
1248px3rem
1456px3.5rem
1664px4rem
2080px5rem
2496px6rem
28112px7rem
32128px8rem
36144px9rem
40160px10rem
44176px11rem
48192px12rem
52208px13rem
56224px14rem
60240px15rem
64256px16rem
72288px18rem
80320px20rem
96384px24rem

CSS Flexbox

ClassDescription
flexApplies display: flex
inline-flexApplies display: inline-flex
flex-rowItems laid out in a row (default)
flex-row-reverseItems laid out in reverse row order
flex-colItems laid out in a column
flex-col-reverseItems laid out in reverse column order
justify-startAlign items to the start of the main axis
justify-centerCenter items along the main axis
justify-endAlign items to the end of the main axis
justify-betweenDistribute items with space between
justify-aroundDistribute items with space around
justify-evenlyDistribute items with equal space
items-startAlign items to the start of the cross axis
items-centerAlign items to the center of the cross axis
items-endAlign items to the end of the cross axis
items-stretchStretch items to fill cross axis
flex-wrapAllow items to wrap to multiple lines
flex-nowrapPrevent items from wrapping
gap-{n}Set gap between flex items (e.g. gap-4)

CSS Grid

ClassDescription
gridApplies display: grid
inline-gridApplies display: inline-grid
grid-cols-{n}Set number of columns (e.g. grid-cols-3)
grid-rows-{n}Set number of rows (e.g. grid-rows-2)
gap-{n}Set gap between grid items (e.g. gap-4)
gap-x-{n}Set horizontal gap only
gap-y-{n}Set vertical gap only
col-span-{n}Set item to span n columns
row-span-{n}Set item to span n rows
col-start-{n}Start item at column line n
col-end-{n}End item at column line n
place-items-centerCenter items in both axes
justify-items-startAlign items horizontally to start
justify-items-centerCenter items horizontally
items-startAlign items vertically to start
items-centerCenter items vertically

Font Families & Text Sizes

ClassDescriptionDefault Size
font-sansSans-serif (e.g. Inter, system-ui)
font-serifSerif (e.g. Georgia)
font-monoMonospace (e.g. Menlo, Courier)
text-xsExtra small text0.75rem / 12px
text-smSmall text0.875rem / 14px
text-baseBase text (default)1rem / 16px
text-lgLarge text1.125rem / 18px
text-xlExtra large1.25rem / 20px
text-2xl2× large1.5rem / 24px
text-3xl3× large1.875rem / 30px
text-4xl4× large2.25rem / 36px
text-5xl5× large3rem / 48px
text-6xl6× large3.75rem / 60px
text-7xl7× large4.5rem / 72px
text-8xl8× large6rem / 96px
text-9xl9× large8rem / 128px

Media Query Breakpoints

BreakpointPrefixMin-WidthCommon Usage
Smallsm:640pxPhones in landscape, small tablets
Mediummd:768pxTablets, small laptops
Largelg:1024pxLaptops and desktops
Extra Largexl:1280pxLarge desktops
2XL2xl:1536pxExtra-large screens

Leave a comment