Tailwind CSS

Spacing (p/m)

p-4 / m-4Padding / margin 1rem
px-4 / py-4Horizontal / vertical
pt-2 / pb-2Top / bottom
pl-2 / pr-2Left / right
space-x-4Horizontal child gap
space-y-4Vertical child gap
p-0 / m-0Zero spacing
-mt-4Negative margin

Width & Height

w-full / h-full100% width/height
w-screen / h-screen100vw / 100vh
w-1/2 / w-1/3Fractional width
w-64 / h-6416rem (256px)
max-w-md / max-w-lgMax width breakpoints
min-h-screenMin height 100vh
w-auto / h-autoAuto sizing
w-fit / h-fitFit content

Flexbox

flexDisplay flex
flex-row / flex-colDirection
items-centerAlign items center
justify-centerJustify center
justify-betweenSpace between
flex-wrapWrap items
flex-1Grow to fill
flex-noneNo grow/shrink
gap-4Gap between items
self-start / self-endAlign self

Grid

gridDisplay grid
grid-cols-33 columns
grid-rows-22 rows
col-span-2Span 2 columns
row-span-2Span 2 rows
gap-4Grid gap
place-items-centerCenter all items
grid-cols-[1fr_2fr]Custom columns

Typography

text-sm / text-base / text-lgFont size
text-xl / text-2xl / text-4xlLarger font sizes
font-bold / font-semiboldFont weight
font-light / font-normalLighter weights
italic / not-italicFont style
text-center / text-rightText alignment
leading-tight / leading-looseLine height
tracking-wide / tracking-tightLetter spacing
uppercase / lowercaseText transform
truncateTruncate with ellipsis
line-clamp-3Clamp to 3 lines
underline / line-throughText decoration

Colors

text-gray-500Text color (gray)
bg-blue-500Background blue
border-red-300Border color
text-white / text-blackWhite / black text
bg-transparentNo background
text-slate-900Dark slate text
bg-gradient-to-rGradient direction
from-blue-500 to-purple-500Gradient colors

Borders & Effects

border / border-2Border width
border-t / border-bTop / bottom border
rounded / rounded-lgBorder radius
rounded-fullCircle / pill shape
shadow / shadow-lgBox shadow
opacity-5050% opacity
ring-2 ring-blue-500Focus ring
divide-yDividers between children

Layout & Position

relative / absolutePositioning
fixed / stickyFixed / sticky position
top-0 / right-0Position offsets
inset-0All edges to 0
z-10 / z-50Z-index layers
overflow-hiddenHide overflow
overflow-autoScroll on overflow
hidden / block / inlineDisplay types

Responsive & States

sm: / md: / lg: / xl:Breakpoint prefixes
hover:Hover state
focus:Focus state
active:Active/pressed state
dark:Dark mode
first: / last:First/last child
group-hover:Parent hover state
disabled:Disabled state

Transitions & Animations

transitionDefault transition
transition-colorsColor transitions
duration-300300ms duration
ease-in-outEasing function
animate-spinSpinning animation
animate-bounceBounce animation
animate-pulsePulse animation
transform hover:scale-105Scale on hover
allprintabledoc.com