Tailwind CSS

Complete Utility Class Reference & Cheatsheet

v3.x · All Core Utilities
📐 Layout
Display
ClassCSS
blockdisplay: block
inline-blockdisplay: inline-block
inlinedisplay: inline
flexdisplay: flex
inline-flexdisplay: inline-flex
griddisplay: grid
inline-griddisplay: inline-grid
tabledisplay: table
table-celldisplay: table-cell
table-rowdisplay: table-row
flow-rootdisplay: flow-root
contentsdisplay: contents
list-itemdisplay: list-item
hiddendisplay: none
Position
ClassCSS
staticposition: static
fixedposition: fixed
absoluteposition: absolute
relativeposition: relative
stickyposition: sticky
Inset — top / right / bottom / left / inset-x / inset-y / inset
top-0top: 0px
top-pxtop: 1px
top-{n}top: {n × 0.25rem}
top-1/2top: 50%
top-fulltop: 100%
-top-{n}top: -{n × 0.25rem}
inset-0top/right/bottom/left: 0
inset-x-0left: 0; right: 0
inset-y-0top: 0; bottom: 0
Z-Index
ClassCSS
z-0z-index: 0
z-10z-index: 10
z-20z-index: 20
z-30z-index: 30
z-40z-index: 40
z-50z-index: 50
z-autoz-index: auto
-z-10z-index: -10
Overflow / Visibility / Float
ClassCSS
overflow-autooverflow: auto
overflow-hiddenoverflow: hidden
overflow-clipoverflow: clip
overflow-visibleoverflow: visible
overflow-scrolloverflow: scroll
overflow-x-autooverflow-x: auto
overflow-y-hiddenoverflow-y: hidden
Visibility
visiblevisibility: visible
invisiblevisibility: hidden
collapsevisibility: collapse
Float / Clear
float-rightfloat: right
float-leftfloat: left
float-nonefloat: none
clear-bothclear: both
clearfix::after { clear: both }
Container / Box Sizing
ClassCSS
containermax-width at each breakpoint
box-borderbox-sizing: border-box
box-contentbox-sizing: content-box
Isolation / Object Fit
isolateisolation: isolate
isolation-autoisolation: auto
object-containobject-fit: contain
object-coverobject-fit: cover
object-fillobject-fit: fill
object-noneobject-fit: none
object-scale-downobject-fit: scale-down
Object Position
object-centerobject-position: center
object-topobject-position: top
object-bottomobject-position: bottom
object-leftobject-position: left
object-rightobject-position: right
Aspect Ratio / Columns
ClassCSS
aspect-autoaspect-ratio: auto
aspect-squareaspect-ratio: 1 / 1
aspect-videoaspect-ratio: 16 / 9
Columns
columns-1 … 12columns: 1 … 12
columns-autocolumns: auto
columns-3xscolumns: 16rem
columns-2xlcolumns: 42rem
Break
break-after-autobreak-after: auto
break-before-pagebreak-before: page
break-inside-avoidbreak-inside: avoid
⟷ Flexbox
Flex Direction & Wrap
ClassCSS
flex-rowflex-direction: row
flex-row-reverseflex-direction: row-reverse
flex-colflex-direction: column
flex-col-reverseflex-direction: column-reverse
flex-wrapflex-wrap: wrap
flex-wrap-reverseflex-wrap: wrap-reverse
flex-nowrapflex-wrap: nowrap
Justify & Align
ClassCSS
justify-startjustify-content: flex-start
justify-endjustify-content: flex-end
justify-centerjustify-content: center
justify-betweenjustify-content: space-between
justify-aroundjustify-content: space-around
justify-evenlyjustify-content: space-evenly
justify-stretchjustify-content: stretch
items-startalign-items: flex-start
items-endalign-items: flex-end
items-centeralign-items: center
items-baselinealign-items: baseline
items-stretchalign-items: stretch
content-startalign-content: flex-start
content-centeralign-content: center
content-betweenalign-content: space-between
self-autoalign-self: auto
self-startalign-self: flex-start
self-centeralign-self: center
self-stretchalign-self: stretch
justify-self-autojustify-self: auto
justify-self-centerjustify-self: center
Flex Grow / Shrink / Basis / Order
ClassCSS
flex-1flex: 1 1 0%
flex-autoflex: 1 1 auto
flex-initialflex: 0 1 auto
flex-noneflex: none
growflex-grow: 1
grow-0flex-grow: 0
shrinkflex-shrink: 1
shrink-0flex-shrink: 0
basis-0flex-basis: 0px
basis-1/2flex-basis: 50%
basis-fullflex-basis: 100%
basis-autoflex-basis: auto
order-firstorder: -9999
order-lastorder: 9999
order-noneorder: 0
order-1 … 12order: 1 … 12
gap-{n}gap: {n × 0.25rem}
gap-x-{n}column-gap: {n × 0.25rem}
gap-y-{n}row-gap: {n × 0.25rem}
Place Content / Items / Self
ClassCSS
place-content-centerplace-content: center
place-content-startplace-content: start
place-content-endplace-content: end
place-content-betweenplace-content: space-between
place-content-aroundplace-content: space-around
place-content-evenlyplace-content: space-evenly
place-content-baselineplace-content: baseline
place-content-stretchplace-content: stretch
place-items-startplace-items: start
place-items-centerplace-items: center
place-items-stretchplace-items: stretch
place-self-autoplace-self: auto
place-self-centerplace-self: center
⊞ Grid
Grid Template Columns
ClassCSS
grid-cols-1grid-template-columns: repeat(1, minmax(0,1fr))
grid-cols-2 … 12repeat(2…12, minmax(0,1fr))
grid-cols-nonegrid-template-columns: none
grid-cols-subgridgrid-template-columns: subgrid
Column Span
col-autogrid-column: auto
col-span-1 … 12grid-column: span 1…12 / span 1…12
col-span-fullgrid-column: 1 / -1
col-start-1 … 13grid-column-start: 1…13
col-start-autogrid-column-start: auto
col-end-1 … 13grid-column-end: 1…13
Grid Template Rows
ClassCSS
grid-rows-1 … 6grid-template-rows: repeat(1…6, minmax(0,1fr))
grid-rows-nonegrid-template-rows: none
grid-rows-subgridgrid-template-rows: subgrid
Row Span
row-autogrid-row: auto
row-span-1 … 6grid-row: span 1…6 / span 1…6
row-span-fullgrid-row: 1 / -1
row-start-1 … 7grid-row-start: 1…7
row-end-1 … 7grid-row-end: 1…7
Auto Flow
grid-flow-rowgrid-auto-flow: row
grid-flow-colgrid-auto-flow: column
grid-flow-densegrid-auto-flow: dense
grid-flow-row-densegrid-auto-flow: row dense
Auto Cols / Rows
auto-cols-autogrid-auto-columns: auto
auto-cols-mingrid-auto-columns: min-content
auto-cols-maxgrid-auto-columns: max-content
auto-cols-frgrid-auto-columns: minmax(0,1fr)
auto-rows-frgrid-auto-rows: minmax(0,1fr)
↕ Spacing
Padding — p / px / py / ps / pe / pt / pr / pb / pl
Scalerempx
p-00rem0px
p-px1px
p-0.50.125rem2px
p-10.25rem4px
p-1.50.375rem6px
p-20.5rem8px
p-2.50.625rem10px
p-30.75rem12px
p-3.50.875rem14px
p-41rem16px
p-51.25rem20px
p-61.5rem24px
p-71.75rem28px
p-82rem32px
p-92.25rem36px
p-102.5rem40px
p-112.75rem44px
p-123rem48px
p-143.5rem56px
p-164rem64px
p-205rem80px
p-246rem96px
p-287rem112px
p-328rem128px
p-369rem144px
p-4010rem160px
p-44 … 9611 … 24rem
Margin — m / mx / my / ms / me / mt / mr / mb / ml
ClassNotes
m-automargin: auto
mx-automargin-left/right: auto (centering)
-m-{n}Negative margin (all sides)
-mx-{n}Negative horizontal margin
Same scale as padding (0 → 96)
m-0 … m-960px → 384px (steps above)
mt-{n}margin-top
mr-{n}margin-right
mb-{n}margin-bottom
ml-{n}margin-left
ms-{n}margin-inline-start
me-{n}margin-inline-end
Space Between (adds margin to children)
space-x-{n}margin-left on children
space-y-{n}margin-top on children
space-x-reverseReverses space-x direction
space-y-reverseReverses space-y direction
↔ Sizing
Width
ClassValue
w-00px
w-px1px
w-0.5 … w-960.125rem … 24rem (spacing scale)
w-autowidth: auto
w-1/250%
w-1/333.333333%
w-2/366.666667%
w-1/4 … w-3/425% … 75%
w-1/5 … w-4/520% … 80%
w-1/6 … w-5/616.666% … 83.333%
w-1/12 … w-11/128.333% … 91.667%
w-full100%
w-screen100vw
w-svw100svw
w-dvw100dvw
w-minmin-content
w-maxmax-content
w-fitfit-content
Height / Min / Max
ClassValue
h-0 … h-960px … 384px (spacing scale)
h-autoheight: auto
h-px1px
h-1/2 … h-full50% … 100%
h-screen100vh
h-svh100svh
h-dvh100dvh
h-minmin-content
h-maxmax-content
h-fitfit-content
Min Width
min-w-0min-width: 0px
min-w-fullmin-width: 100%
min-w-minmin-width: min-content
min-w-maxmin-width: max-content
Max Width
max-w-nonemax-width: none
max-w-xs20rem (320px)
max-w-sm24rem (384px)
max-w-md28rem (448px)
max-w-lg32rem (512px)
max-w-xl36rem (576px)
max-w-2xl … 7xl42rem … 80rem
max-w-full100%
max-w-screen-sm…2xl640px … 1536px
max-w-prose65ch
Min Height
min-h-0min-height: 0px
min-h-fullmin-height: 100%
min-h-screenmin-height: 100vh
min-h-svh / dvh / lvh100svh / 100dvh / 100lvh
Aa Typography
Font Size
ClassSizeLine Height
text-xs0.75rem1rem
text-sm0.875rem1.25rem
text-base1rem1.5rem
text-lg1.125rem1.75rem
text-xl1.25rem1.75rem
text-2xl1.5rem2rem
text-3xl1.875rem2.25rem
text-4xl2.25rem2.5rem
text-5xl3rem1
text-6xl3.75rem1
text-7xl4.5rem1
text-8xl6rem1
text-9xl8rem1
Font Weight / Style / Family
ClassCSS
font-thinfont-weight: 100
font-extralightfont-weight: 200
font-lightfont-weight: 300
font-normalfont-weight: 400
font-mediumfont-weight: 500
font-semiboldfont-weight: 600
font-boldfont-weight: 700
font-extraboldfont-weight: 800
font-blackfont-weight: 900
italicfont-style: italic
not-italicfont-style: normal
font-sansui-sans-serif, system-ui…
font-serifui-serif, Georgia…
font-monoui-monospace, SFMono…
antialiased-webkit-font-smoothing: antialiased
subpixel-antialiased-webkit-font-smoothing: auto
Text Alignment / Transform / Decoration
ClassCSS
text-lefttext-align: left
text-centertext-align: center
text-righttext-align: right
text-justifytext-align: justify
text-starttext-align: start
text-endtext-align: end
uppercasetext-transform: uppercase
lowercasetext-transform: lowercase
capitalizetext-transform: capitalize
normal-casetext-transform: none
underlinetext-decoration-line: underline
overlinetext-decoration-line: overline
line-throughtext-decoration-line: line-through
no-underlinetext-decoration-line: none
decoration-solidtext-decoration-style: solid
decoration-dottedtext-decoration-style: dotted
decoration-dashedtext-decoration-style: dashed
decoration-wavytext-decoration-style: wavy
decoration-0 … 8text-decoration-thickness
underline-offset-0…8text-underline-offset
Line Height / Letter Spacing / Whitespace
ClassCSS
leading-noneline-height: 1
leading-tightline-height: 1.25
leading-snugline-height: 1.375
leading-normalline-height: 1.5
leading-relaxedline-height: 1.625
leading-looseline-height: 2
leading-3 … 10.75rem … 2.5rem
Letter Spacing (tracking)
tracking-tighterletter-spacing: -0.05em
tracking-tightletter-spacing: -0.025em
tracking-normalletter-spacing: 0em
tracking-wideletter-spacing: 0.025em
tracking-widerletter-spacing: 0.05em
tracking-widestletter-spacing: 0.1em
Whitespace / Word Break / Overflow
whitespace-normalwhite-space: normal
whitespace-nowrapwhite-space: nowrap
whitespace-prewhite-space: pre
whitespace-pre-linewhite-space: pre-line
whitespace-pre-wrapwhite-space: pre-wrap
whitespace-break-spaceswhite-space: break-spaces
break-normaloverflow-wrap: normal; word-break: normal
break-wordsoverflow-wrap: break-word
break-allword-break: break-all
break-keepword-break: keep-all
truncateoverflow: hidden; text-overflow: ellipsis; white-space: nowrap
text-ellipsistext-overflow: ellipsis
text-cliptext-overflow: clip
hyphens-nonehyphens: none
hyphens-manualhyphens: manual
hyphens-autohyphens: auto
Vertical Align
align-baselinevertical-align: baseline
align-topvertical-align: top
align-middlevertical-align: middle
align-bottomvertical-align: bottom
align-text-topvertical-align: text-top
align-subvertical-align: sub
align-supervertical-align: super
🎨 Colors
Usage Pattern: text-{color}-{shade} · bg-{color}-{shade} · border-{color}-{shade} · ring-{color}-{shade} · shadow-{color}/{opacity}
Color Palette — All Colors × All Shades
50
100
200
300
400
500
600
700
800
900
950
slate
gray
zinc
neutral
stone
red
orange
amber
yellow
lime
green
emerald
teal
cyan
sky
blue
indigo
violet
purple
fuchsia
pink
rose
Text & Background Color
ClassNotes
text-{color}-{shade}e.g. text-blue-500
text-transparentcolor: transparent
text-currentcolor: currentColor
text-blackcolor: #000
text-whitecolor: #fff
text-inheritcolor: inherit
text-{color}/{opacity}e.g. text-blue-500/50
bg-{color}-{shade}e.g. bg-red-100
bg-transparentbackground-color: transparent
bg-inheritbackground-color: inherit
bg-{color}/{opacity}e.g. bg-black/50
Opacity
ClassCSS
opacity-0opacity: 0
opacity-5opacity: 0.05
opacity-10opacity: 0.1
opacity-20opacity: 0.2
opacity-25opacity: 0.25
opacity-30opacity: 0.3
opacity-40opacity: 0.4
opacity-50opacity: 0.5
opacity-60opacity: 0.6
opacity-70opacity: 0.7
opacity-75opacity: 0.75
opacity-80opacity: 0.8
opacity-90opacity: 0.9
opacity-95opacity: 0.95
opacity-100opacity: 1
◈ Backgrounds
Background Properties
ClassCSS
bg-fixedbackground-attachment: fixed
bg-localbackground-attachment: local
bg-scrollbackground-attachment: scroll
bg-clip-borderbackground-clip: border-box
bg-clip-paddingbackground-clip: padding-box
bg-clip-contentbackground-clip: content-box
bg-clip-textbackground-clip: text
bg-origin-borderbackground-origin: border-box
bg-origin-paddingbackground-origin: padding-box
bg-origin-contentbackground-origin: content-box
bg-repeatbackground-repeat: repeat
bg-no-repeatbackground-repeat: no-repeat
bg-repeat-xbackground-repeat: repeat-x
bg-repeat-ybackground-repeat: repeat-y
bg-repeat-roundbackground-repeat: round
bg-repeat-spacebackground-repeat: space
bg-autobackground-size: auto
bg-coverbackground-size: cover
bg-containbackground-size: contain
bg-centerbackground-position: center
bg-topbackground-position: top
bg-bottombackground-position: bottom
bg-leftbackground-position: left
bg-rightbackground-position: right
bg-left-topbackground-position: left top
bg-right-bottombackground-position: right bottom
bg-nonebackground-image: none
Gradients
ClassCSS
bg-gradient-to-tto top
bg-gradient-to-trto top right
bg-gradient-to-rto right
bg-gradient-to-brto bottom right
bg-gradient-to-bto bottom
bg-gradient-to-blto bottom left
bg-gradient-to-lto left
bg-gradient-to-tlto top left
Gradient Color Stops
from-{color}-{shade}--tw-gradient-from: ...
from-transparentfrom transparent
via-{color}-{shade}--tw-gradient-via: ...
to-{color}-{shade}--tw-gradient-to: ...
from-{color}/{opacity}e.g. from-blue-500/50
from-0% … from-100%Start position stop
via-50%Via position stop
to-100%End position stop
<!-- Example gradient text --> <div class="bg-gradient-to-r from-sky-400 to-violet-600 bg-clip-text text-transparent font-bold"> Gradient Text </div>
□ Borders
Border Width & Color
ClassCSS
borderborder-width: 1px
border-0border-width: 0px
border-2border-width: 2px
border-4border-width: 4px
border-8border-width: 8px
border-t-{n}border-top-width
border-r-{n}border-right-width
border-b-{n}border-bottom-width
border-l-{n}border-left-width
border-x-{n}border-left + right width
border-y-{n}border-top + bottom width
border-{color}-{shade}e.g. border-blue-500
border-{color}/{opacity}e.g. border-black/10
border-solidborder-style: solid
border-dashedborder-style: dashed
border-dottedborder-style: dotted
border-doubleborder-style: double
border-hiddenborder-style: hidden
border-noneborder-style: none
divide-x-{n}border between children (x)
divide-y-{n}border between children (y)
divide-{color}-{shade}Color for divide
divide-solid / dashedStyle for divide
Border Radius
ClassCSS
rounded-noneborder-radius: 0px
rounded-smborder-radius: 0.125rem (2px)
roundedborder-radius: 0.25rem (4px)
rounded-mdborder-radius: 0.375rem (6px)
rounded-lgborder-radius: 0.5rem (8px)
rounded-xlborder-radius: 0.75rem (12px)
rounded-2xlborder-radius: 1rem (16px)
rounded-3xlborder-radius: 1.5rem (24px)
rounded-fullborder-radius: 9999px
Directional — t / r / b / l / tl / tr / br / bl / ss / se / es / ee
rounded-t-{size}top-left + top-right
rounded-r-{size}top-right + bottom-right
rounded-b-{size}bottom-left + bottom-right
rounded-l-{size}top-left + bottom-left
rounded-tl-{size}border-top-left-radius
rounded-tr-{size}border-top-right-radius
rounded-br-{size}border-bottom-right-radius
rounded-bl-{size}border-bottom-left-radius
Outline / Ring
ClassCSS
outline-noneoutline: 2px solid transparent; outline-offset: 2px
outlineoutline-style: solid
outline-dashedoutline-style: dashed
outline-dottedoutline-style: dotted
outline-0outline-width: 0px
outline-1 … 8outline-width: 1px … 8px
outline-{color}outline-color
outline-offset-0 … 8outline-offset
Ring (box-shadow based)
ring-0box-shadow: 0 0 0 0px
ring-1box-shadow: 0 0 0 1px
ring-2box-shadow: 0 0 0 2px
ringbox-shadow: 0 0 0 3px
ring-4box-shadow: 0 0 0 4px
ring-8box-shadow: 0 0 0 8px
ring-insetinset box-shadow
ring-{color}Ring color
ring-offset-0 … 8Ring offset width
ring-offset-{color}Ring offset color
✦ Effects & Shadows
Box Shadow
ClassNotes
shadow-sm0 1px 2px 0 rgb(0 0 0 / 0.05)
shadow0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)
shadow-md0 4px 6px -1px rgb(0 0 0 / 0.1)…
shadow-lg0 10px 15px -3px rgb(0 0 0 / 0.1)…
shadow-xl0 20px 25px -5px rgb(0 0 0 / 0.1)…
shadow-2xl0 25px 50px -12px rgb(0 0 0 / 0.25)
shadow-innerinset 0 2px 4px 0 rgb(0 0 0 / 0.05)
shadow-nonebox-shadow: 0 0 #0000
shadow-{color}/{opacity}e.g. shadow-blue-500/50
Mix Blend / Background Blend
ClassCSS
mix-blend-normalmix-blend-mode: normal
mix-blend-multiplymix-blend-mode: multiply
mix-blend-screenmix-blend-mode: screen
mix-blend-overlaymix-blend-mode: overlay
mix-blend-darkenmix-blend-mode: darken
mix-blend-lightenmix-blend-mode: lighten
mix-blend-color-dodgemix-blend-mode: color-dodge
mix-blend-color-burnmix-blend-mode: color-burn
mix-blend-hard-lightmix-blend-mode: hard-light
mix-blend-soft-lightmix-blend-mode: soft-light
mix-blend-differencemix-blend-mode: difference
mix-blend-exclusionmix-blend-mode: exclusion
mix-blend-huemix-blend-mode: hue
mix-blend-saturationmix-blend-mode: saturation
mix-blend-colormix-blend-mode: color
mix-blend-luminositymix-blend-mode: luminosity
mix-blend-plus-lightermix-blend-mode: plus-lighter
bg-blend-* — same modes, for background-blend-mode
◉ Filters
Filter Utilities
ClassCSS
blur-nonefilter: blur(0)
blur-smfilter: blur(4px)
blurfilter: blur(8px)
blur-mdfilter: blur(12px)
blur-lgfilter: blur(16px)
blur-xlfilter: blur(24px)
blur-2xlfilter: blur(40px)
blur-3xlfilter: blur(64px)
brightness-0 … 200filter: brightness(0 … 2)
contrast-0 … 200filter: contrast(0 … 2)
grayscale-0filter: grayscale(0)
grayscalefilter: grayscale(100%)
hue-rotate-0 … 180filter: hue-rotate(0deg … 180deg)
-hue-rotate-180filter: hue-rotate(-180deg)
invert-0filter: invert(0)
invertfilter: invert(100%)
saturate-0 … 200filter: saturate(0 … 2)
sepia-0filter: sepia(0)
sepiafilter: sepia(100%)
drop-shadow-smfilter: drop-shadow(…)
drop-shadowfilter: drop-shadow(0 1px 2px …)
drop-shadow-mdfilter: drop-shadow(0 4px 3px …)
drop-shadow-lgfilter: drop-shadow(0 10px 8px …)
drop-shadow-xlfilter: drop-shadow(0 20px 13px …)
drop-shadow-2xlfilter: drop-shadow(0 25px 25px …)
drop-shadow-nonefilter: drop-shadow(0 0 #0000)
Backdrop Filters
ClassCSS
backdrop-blur-nonebackdrop-filter: blur(0)
backdrop-blur-smbackdrop-filter: blur(4px)
backdrop-blurbackdrop-filter: blur(8px)
backdrop-blur-mdbackdrop-filter: blur(12px)
backdrop-blur-lgbackdrop-filter: blur(16px)
backdrop-blur-xlbackdrop-filter: blur(24px)
backdrop-blur-2xlbackdrop-filter: blur(40px)
backdrop-blur-3xlbackdrop-filter: blur(64px)
backdrop-brightness-0…200backdrop-filter: brightness(…)
backdrop-contrast-0…200backdrop-filter: contrast(…)
backdrop-grayscalebackdrop-filter: grayscale(100%)
backdrop-hue-rotate-0…180backdrop-filter: hue-rotate(…)
backdrop-invertbackdrop-filter: invert(100%)
backdrop-opacity-0…100backdrop-filter: opacity(…)
backdrop-saturate-0…200backdrop-filter: saturate(…)
backdrop-sepiabackdrop-filter: sepia(100%)
⟳ Transforms
Scale / Rotate / Translate / Skew
ClassCSS
scale-0transform: scale(0)
scale-50transform: scale(.5)
scale-75transform: scale(.75)
scale-90transform: scale(.9)
scale-95transform: scale(.95)
scale-100transform: scale(1)
scale-105transform: scale(1.05)
scale-110transform: scale(1.1)
scale-125transform: scale(1.25)
scale-150transform: scale(1.5)
scale-x-{n}scaleX only
scale-y-{n}scaleY only
rotate-0transform: rotate(0deg)
rotate-1 … 180rotate(1deg … 180deg)
-rotate-{n}negative rotation
translate-x-{n}translateX (spacing scale)
translate-y-{n}translateY (spacing scale)
translate-x-1/2translateX(50%)
-translate-x-fulltranslateX(-100%)
skew-x-0 … 12skewX(0deg … 12deg)
skew-y-0 … 12skewY(0deg … 12deg)
-skew-x-{n}negative skewX
transform-nonetransform: none
transform-gputranslateZ(0) (GPU acceleration)
Transform Origin
origin-centertransform-origin: center
origin-toptransform-origin: top
origin-top-righttransform-origin: top right
origin-righttransform-origin: right
origin-bottom-righttransform-origin: bottom right
origin-bottomtransform-origin: bottom
origin-bottom-lefttransform-origin: bottom left
origin-lefttransform-origin: left
origin-top-lefttransform-origin: top left
⟡ Transitions & Animation
Transitions
ClassCSS
transition-nonetransition-property: none
transition-alltransition-property: all
transitioncolor, bg, border, opacity, shadow, transform…
transition-colorscolor, bg-color, border-color, text-decoration-color, fill, stroke
transition-opacitytransition-property: opacity
transition-shadowtransition-property: box-shadow
transition-transformtransition-property: transform
Duration
duration-0transition-duration: 0ms
duration-75transition-duration: 75ms
duration-100transition-duration: 100ms
duration-150transition-duration: 150ms
duration-200transition-duration: 200ms
duration-300transition-duration: 300ms
duration-500transition-duration: 500ms
duration-700transition-duration: 700ms
duration-1000transition-duration: 1000ms
Easing
ease-lineartransition-timing-function: linear
ease-incubic-bezier(0.4, 0, 1, 1)
ease-outcubic-bezier(0, 0, 0.2, 1)
ease-in-outcubic-bezier(0.4, 0, 0.2, 1)
Delay
delay-0 … delay-1000transition-delay: 0ms … 1000ms
Animation
ClassCSS
animate-noneanimation: none
animate-spinspin 1s linear infinite
animate-pingping 1s cubic-bezier(0,0,0.2,1) infinite
animate-pulsepulse 2s cubic-bezier(0.4,0,0.6,1) infinite
animate-bouncebounce 1s infinite
/* Custom animation in tailwind.config.js */ theme: { extend: { keyframes: { wiggle: { '0%, 100%': { transform: 'rotate(-3deg)' }, '50%': { transform: 'rotate(3deg)' } } }, animation: { wiggle: 'wiggle 1s ease-in-out infinite' } } }
⟩ Interactivity
Cursor / Pointer / User Select
ClassCSS
cursor-autocursor: auto
cursor-defaultcursor: default
cursor-pointercursor: pointer
cursor-waitcursor: wait
cursor-textcursor: text
cursor-movecursor: move
cursor-helpcursor: help
cursor-not-allowedcursor: not-allowed
cursor-nonecursor: none
cursor-context-menucursor: context-menu
cursor-crosshaircursor: crosshair
cursor-grabcursor: grab
cursor-grabbingcursor: grabbing
cursor-zoom-incursor: zoom-in
cursor-zoom-outcursor: zoom-out
Pointer Events
pointer-events-nonepointer-events: none
pointer-events-autopointer-events: auto
User Select
select-noneuser-select: none
select-textuser-select: text
select-alluser-select: all
select-autouser-select: auto
Resize / Scroll
resize-noneresize: none
resizeresize: both
resize-xresize: horizontal
resize-yresize: vertical
scroll-autoscroll-behavior: auto
scroll-smoothscroll-behavior: smooth
scroll-m-{n}scroll-margin (all sides)
scroll-p-{n}scroll-padding (all sides)
snap-startscroll-snap-align: start
snap-centerscroll-snap-align: center
snap-endscroll-snap-align: end
snap-nonescroll-snap-align: none
snap-xscroll-snap-type: x var(…)
snap-yscroll-snap-type: y var(…)
snap-mandatory--tw-scroll-snap-strictness: mandatory
snap-proximity--tw-scroll-snap-strictness: proximity
snap-alwaysscroll-snap-stop: always
snap-normalscroll-snap-stop: normal
touch-autotouch-action: auto
touch-nonetouch-action: none
touch-pan-xtouch-action: pan-x
touch-pan-ytouch-action: pan-y
touch-pinch-zoomtouch-action: pinch-zoom
touch-manipulationtouch-action: manipulation
will-change-autowill-change: auto
will-change-scrollwill-change: scroll-position
will-change-contentswill-change: contents
will-change-transformwill-change: transform
appearance-noneappearance: none
appearance-autoappearance: auto
caret-{color}caret-color: …
accent-{color}accent-color: …
📱 Responsive Breakpoints
Default Breakpoints (Mobile First)
0 → 639px
sm:
≥ 640px
md:
≥ 768px
lg:
≥ 1024px
xl:
≥ 1280px
2xl:
≥ 1536px
PrefixMin WidthExample
sm:640pxsm:flex
md:768pxmd:grid-cols-3
lg:1024pxlg:text-xl
xl:1280pxxl:px-8
2xl:1536px2xl:max-w-7xl
max-sm:< 640pxmax-sm:hidden (v3.2+)
max-md:< 768pxmax-md:text-sm
Pseudo-Class & State Variants
VariantTriggers When
hover::hover
focus::focus
focus-within::focus-within
focus-visible::focus-visible
active::active
visited::visited
target::target
first::first-child
last::last-child
only::only-child
odd::nth-child(odd)
even::nth-child(even)
first-of-type::first-of-type
last-of-type::last-of-type
only-of-type::only-of-type
empty::empty
disabled::disabled
enabled::enabled
checked::checked
indeterminate::indeterminate
default::default
required::required
valid::valid
invalid::invalid
in-range::in-range
out-of-range::out-of-range
placeholder-shown::placeholder-shown
autofill::autofill
read-only::read-only
before:::before
after:::after
placeholder:::placeholder
file:::file-selector-button
marker:::marker
selection:::selection
first-line:::first-line
first-letter:::first-letter
backdrop:::backdrop
print:@media print
motion-safe:prefers-reduced-motion: no-preference
motion-reduce:prefers-reduced-motion: reduce
contrast-more:prefers-contrast: more
contrast-less:prefers-contrast: less
portrait:orientation: portrait
landscape:orientation: landscape
ltr:[dir="ltr"]
rtl:[dir="rtl"]
open:[open]
◐ Dark Mode & Group/Peer
Dark Mode
VariantUsage
dark:Applied in dark mode
<!-- In tailwind.config.js --> darkMode: 'class', // or 'media' <!-- In HTML --> <div class="bg-white dark:bg-gray-900 text-black dark:text-white"> Adapts to dark mode </div> <!-- Toggle by adding 'dark' to <html> --> <html class="dark">
Group & Peer Variants
PatternNotes
groupAdd to parent element
group-hover:Style child when parent hovered
group-focus:Style child when parent focused
group-active:Style child when parent active
group-disabled:Style child when parent disabled
group/{name}Named groups (e.g. group/sidebar)
group-hover/{name}:Scoped to named group
peerAdd to sibling (must come before)
peer-hover:Style when peer hovered
peer-focus:Style when peer focused
peer-checked:Style when peer checked
peer-disabled:Style when peer disabled
peer/{name}Named peer
<div class="group"> <p class="group-hover:text-blue-500"> Changes on parent hover </p> </div> <input class="peer" type="checkbox" /> <label class="peer-checked:text-green-500"> Styled when checkbox checked </label>
[ ] Arbitrary Values
Arbitrary Value Syntax
ExampleResult
w-[247px]width: 247px
w-[calc(100%-2rem)]width: calc(100% - 2rem)
h-[50vh]height: 50vh
text-[14px]font-size: 14px
text-[#FF0000]color: #FF0000
bg-[url('/img.png')]background-image: url('/img.png')
top-[117px]top: 117px
grid-cols-[1fr_auto]grid-template-columns: 1fr auto
p-[5px_10px]Use _ for spaces
font-[900]font-weight: 900
leading-[3.5rem]line-height: 3.5rem
tracking-[0.2em]letter-spacing: 0.2em
rotate-[17deg]rotate(17deg)
translate-x-[10vw]translateX(10vw)
skew-y-[8deg]skewY(8deg)
shadow-[0_35px_60px_rgba(0,0,0,0.3)]Custom shadow
inset-[10%]inset: 10%
Arbitrary Properties & Variants
/* Arbitrary CSS property */ <div class="[mask-type:alpha]"> <div class="[--my-var:theme(colors.blue.500)]"> /* Arbitrary variants */ <div class="[&:nth-child(3)]:opacity-0"> <div class="[@media(min-width:900px)]:flex"> /* Modifier stacking */ <div class="dark:hover:md:text-white"> <div class="group-hover:focus:text-blue-500">
⚙ Configuration
tailwind.config.js — Full Reference
/** @type {import('tailwindcss').Config} */ module.exports = { content: [ './src/**/*.{html,js,jsx,ts,tsx,vue,svelte}', './public/index.html' ], darkMode: 'class', // 'media' | 'class' | ['class', '[data-theme="dark"]'] theme: { screens: { // Override breakpoints sm: '640px', md: '768px', lg: '1024px', xl: '1280px', '2xl': '1536px' }, extend: { // Extend without overriding colors: { brand: { 500: '#FF6B6B', 600: '#FF5252' }, primary: 'var(--color-primary)', }, fontFamily: { display: ['Playfair Display', 'serif'], body: ['Inter', 'sans-serif'] }, spacing: { '128': '32rem', '4.5': '1.125rem' }, borderRadius: { '4xl': '2rem' }, animation: { 'spin-slow': 'spin 3s linear infinite', 'wiggle': 'wiggle 1s ease-in-out infinite' }, keyframes: { wiggle: { '0%, 100%': { transform: 'rotate(-3deg)' }, '50%': { transform: 'rotate(3deg)' } } }, backgroundImage: { 'hero-pattern': 'url("/img/hero-pattern.svg")', }, gridTemplateColumns: { 'sidebar': '200px minmax(900px, 1fr) 100px' }, transitionTimingFunction: { 'spring': 'cubic-bezier(0.175, 0.885, 0.32, 1.275)' }, zIndex: { '60': 60, '70': 70 }, maxWidth: { '8xl': '96rem' }, typography: { // @tailwindcss/typography plugin DEFAULT: { css: { color: '#fff' } } } } }, plugins: [ require('@tailwindcss/typography'), require('@tailwindcss/forms'), require('@tailwindcss/aspect-ratio'), require('@tailwindcss/container-queries'), // Custom plugin function({ addUtilities, addComponents, addBase, theme }) { addUtilities({ '.text-shadow': { textShadow: '0 2px 4px rgba(0,0,0,.5)' } }) } ] }
Directives & Functions
/* CSS Directives */ @tailwind base; @tailwind components; @tailwind utilities; /* Layer custom styles */ @layer base { h1 { @apply text-4xl font-bold; } * { @apply border-border; } } @layer components { .btn-primary { @apply px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition; } } @layer utilities { .content-auto { content-visibility: auto; } } /* theme() function */ .element { background: theme(colors.blue.500); padding: theme(spacing.4); font-size: theme(fontSize.xl); } /* screen() function */ @media screen(sm) { .element { display: flex; } }
@apply & Useful Patterns
/* Center a div */ <div class="flex items-center justify-center"> /* Absolute center */ <div class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2"> /* Truncate text */ <p class="truncate w-48"> /* Responsive sidebar layout */ <div class="flex flex-col md:flex-row"> /* Card hover lift */ <div class="transition hover:-translate-y-1 hover:shadow-xl duration-200"> /* Frosted glass */ <div class="bg-white/10 backdrop-blur-md border border-white/20 rounded-xl"> /* CSS Grid auto-fill */ <div class="grid grid-cols-[repeat(auto-fill,minmax(200px,1fr))]">
≡ Tables & Lists
Tables
ClassCSS
table-autotable-layout: auto
table-fixedtable-layout: fixed
border-collapseborder-collapse: collapse
border-separateborder-collapse: separate
border-spacing-0border-spacing: 0px
border-spacing-{n}border-spacing (spacing scale)
caption-topcaption-side: top
caption-bottomcaption-side: bottom
Lists & SVG
ClassCSS
list-nonelist-style-type: none
list-disclist-style-type: disc
list-decimallist-style-type: decimal
list-insidelist-style-position: inside
list-outsidelist-style-position: outside
list-image-nonelist-style-image: none
SVG
fill-nonefill: none
fill-{color}fill: color value
fill-inheritfill: inherit
stroke-nonestroke: none
stroke-{color}stroke: color value
stroke-0stroke-width: 0
stroke-1stroke-width: 1
stroke-2stroke-width: 2
♿ Accessibility & Screen Readers
Screen Readers
ClassNotes
sr-onlyVisually hidden but accessible to screen readers
not-sr-onlyUndoes sr-only — makes element visible again
<span class="sr-only">Close menu</span> <svg aria-hidden="true" />
CSS sr-only definition
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0; }