Skip to main content

Tailwind CSS Cheatsheet — 100+ Utility Classes with Live Preview

Tailwind CSS cheat sheet — 100+ utility classes (spacing, color, flex, grid, typography, responsive) with live preview.

  • Runs locally
  • Category Developer & DevOps
  • Best for Formatting, validating, shrinking, or inspecting code-adjacent text.
190 classes
Spacing (17)
p-4
Aa text

What it does:Padding on all four sides. Scale is 4 = 1rem (16px). The numeric step is 0.25rem so p-1 = 4px, p-2 = 8px, p-4 = 16px, p-8 = 32px.

Examples:p-2p-4p-8p-px
px-4 py-2
Aa text

What it does:Horizontal (left + right) padding and vertical (top + bottom) padding separately. The classic button padding combo.

Examples:px-3 py-1px-4 py-2px-6 py-3
pt-6
Aa text

What it does:Padding on a single side. Variants: pt- (top), pr- (right), pb- (bottom), pl- (left), and the 3.3+ logical-property ps- / pe-.

Examples:pt-4pr-2pb-8pl-0
m-4
Aa text

What it does:Margin on all four sides. Same numeric scale as padding. m-auto centers a block with a defined width. Negative margins use -m-4.

Examples:m-4m-auto-m-2
mx-auto
Aa text

What it does:Horizontal auto margin — centers a block-level element with a defined width inside its container. The standard "center the page" trick.

Examples:mx-automy-autom-auto
space-x-2

What it does:Adds horizontal margin between adjacent children (skips the first). The flexbox-friendly way to space items without writing gap on the parent.

Examples:space-x-1space-x-2space-x-4space-y-3
space-y-4

What it does:Adds vertical margin between stacked children. Pair with flex flex-col or a plain block container. Replaces "margin-bottom on every item except the last".

Examples:space-y-2space-y-4space-y-8
gap-4

What it does:Gap between flex / grid children. Modern alternative to space-x / space-y — works in both axes and does not affect the outer margin of edge children.

Examples:gap-2gap-4gap-x-6 gap-y-2
p-px

What it does:Single pixel padding — the smallest non-zero step. Useful for 1px gradient borders, hair-thin dividers, or precision spacing inside inputs.

Examples:p-pxm-pxpt-px
p-0
Aa text

What it does:Zero padding — resets browser default or overrides an inherited value. The escape hatch when an upstream component injects padding you do not want.

Examples:p-0m-0pt-0
p-[13px]
Aa text

What it does:Arbitrary value — bracket syntax lets you escape the design scale for a one-off pixel-perfect value. Use sparingly; consistent scale wins long-term.

Examples:p-[13px]mt-[2.5rem]gap-[7px]
-mt-2
Aa text

What it does:Negative margin — pulls the element by the given amount in the opposite direction. Use for overlap effects (avatars, badge offsets, pulling a card up over its header).

Examples:-mt-2-mx-4-mb-1
ps-4
Aa text

What it does:Padding inline-start — the logical-property version of pl- that flips to the right edge in RTL languages. ps- / pe- / ms- / me- are the i18n-safe way to write directional spacing.

Examples:ps-4pe-2ms-autome-3
space-x-reverse

What it does:Flips which side space-x adds its margin to — needed when the row is flex-row-reverse, otherwise the gap lands on the wrong edge. Pair: flex flex-row-reverse space-x-4 space-x-reverse.

Examples:space-x-reversespace-y-reverse
gap-x-4

What it does:Column gap only — sets the horizontal spacing between flex / grid tracks while leaving row spacing untouched. Pair with gap-y- to control the two axes independently.

Examples:gap-x-4gap-y-2gap-x-6 gap-y-3
scroll-mt-16
Aa text

What it does:scroll-margin-top — reserves space above an anchor target so a sticky header does not cover it after a jump-link scroll. The fix for "#section lands under my fixed navbar".

Examples:scroll-mt-16scroll-mt-24scroll-pt-8
indent-8
Aa text

What it does:text-indent on the first line of a block — classic paragraph indentation. Uses the spacing scale; indent-8 = 2rem. Arbitrary works too: indent-[2ch].

Examples:indent-4indent-8indent-[2ch]
Sizing (14)
w-full

What it does:Width 100% of parent. Other handy widths: w-1/2, w-1/3, w-2/3, w-1/4, w-screen (viewport width), w-min (min-content), w-max (max-content), w-fit.

Examples:w-fullw-1/2w-screenw-fit
h-10

What it does:Fixed height in the spacing scale. h-10 = 2.5rem (40px). For viewport: h-screen. For min-content: h-min. The 3.4+ size-10 sets w-10 AND h-10 in one class.

Examples:h-8h-10h-screenh-fit
size-8

What it does:Tailwind 3.4+ shorthand that sets BOTH width and height — saves writing w-8 h-8 a hundred times for avatars, icons, and square buttons.

Examples:size-6size-8size-12
min-w-0
Aa text

What it does:Resets min-width to 0. The fix for "flex child refuses to shrink and overflows" — flex items have min-width: auto by default which prevents shrinking past intrinsic content size.

Examples:min-w-0min-w-fullmin-w-fit
max-w-md
Aa text

What it does:Max-width cap. Named scale: sm(384), md(448), lg(512), xl(576), 2xl…7xl, prose (65ch — readable line length), full, screen-md (= md breakpoint). The "readable column" goes max-w-prose.

Examples:max-w-smmax-w-mdmax-w-prosemax-w-screen-lg
max-w-prose
Aa text

What it does:Width ≈ 65 characters — the typographic sweet spot for body copy. Use on article / blog / docs columns so lines stay readable on wide screens.

Examples:max-w-prosemax-w-[65ch]
h-screen
Aa text

What it does:Height = 100vh (full viewport). On mobile Safari this includes the URL bar area, which can cause jumping. The newer h-dvh (dynamic viewport height) is the modern fix.

Examples:h-screenh-dvhh-svhh-lvh
aspect-square

What it does:Lock aspect ratio. Built-ins: aspect-square (1:1), aspect-video (16:9), aspect-auto. Arbitrary: aspect-[4/3]. Combine with object-cover on an img for crops.

Examples:aspect-squareaspect-videoaspect-[4/3]
w-1/2

What it does:Fractional width — w-1/2 is 50%, and the scale runs through halves, thirds, quarters, fifths, sixths, and twelfths (w-1/12 … w-11/12). The pre-grid way to split a flex row into proportional columns.

Examples:w-1/2w-1/3w-2/3w-5/12
min-h-screen
Aa text

What it does:min-height: 100vh — the page fills at least the full viewport even with little content, so a footer sticks to the bottom. The modern h-dvh-aware variant is min-h-dvh.

Examples:min-h-screenmin-h-dvhmin-h-fullmin-h-0
max-h-96
Aa text

What it does:max-height cap — combine with overflow-y-auto to build a scrollable panel that grows with content up to a limit, then scrolls. The standard dropdown / log-viewer pattern.

Examples:max-h-96max-h-screenmax-h-[60vh]
w-fit
Aa text

What it does:width: fit-content — the box shrinks to wrap its content but will not exceed the parent. Handy for centering a pill or auto-sizing a button row with mx-auto w-fit.

Examples:w-fith-fitw-maxw-min
size-full
Aa text

What it does:Sets width AND height to 100% in one class (Tailwind 3.4+). The cleanest way to make an img or video fill its positioned wrapper: absolute inset-0 size-full object-cover.

Examples:size-fullsize-fitsize-min
basis-1/3

What it does:flex-basis — sets a flex item's initial main-axis size before grow / shrink kick in. basis-1/3 ≈ 33.3%, basis-64 uses the spacing scale, basis-auto reads from content / width.

Examples:basis-1/3basis-64basis-autobasis-full
Color (22)
bg-cyan-500

What it does:Background color from the Tailwind palette. Format: bg-{color}-{shade}. Shades go 50 / 100 / 200 … 900 / 950. Lower = lighter. The default brand cyan.

Examples:bg-cyan-500bg-cyan-600bg-cyan-100
bg-violet-500

What it does:Violet from the palette. Pairs well with cyan (cool-cool) for the Aurora aesthetic and with pink/rose (cool-warm) for dramatic gradients.

Examples:bg-violet-500bg-violet-600bg-violet-200
bg-pink-500

What it does:Pink — the warm anchor of the Aurora trio (cyan / violet / pink). Use sparingly for accents (CTAs, highlights); flooding a UI in 500 pink fatigues quickly.

Examples:bg-pink-500bg-rose-500bg-fuchsia-500
bg-emerald-500

What it does:Emerald — the canonical success / positive color. Slightly cooler than green-500; modern UI work tends to prefer emerald over the older "green".

Examples:bg-emerald-500bg-emerald-600bg-teal-500
bg-amber-500

What it does:Amber — the canonical warning color. Pairs with text-amber-50 inside it or text-amber-900 alongside it. More readable than yellow at the same shade.

Examples:bg-amber-500bg-amber-400bg-yellow-500
bg-red-500

What it does:Red — destructive / error. Use 500 for buttons, 600 on hover, 50 / 100 for soft alert backgrounds, 700+ for high-contrast text on light backgrounds.

Examples:bg-red-500bg-red-600bg-red-50
text-slate-400
Aa text

What it does:Foreground color. Slate is the modern neutral — slightly cooler than gray, slightly warmer than zinc. text-slate-400 is the canonical "secondary text" shade on dark UI.

Examples:text-slate-300text-slate-400text-slate-500
text-white
Aa text

What it does:Plain white text (#ffffff). For "almost white" with a hint of warmth use text-slate-50 or text-zinc-50 — easier on the eyes on long reads.

Examples:text-whitetext-slate-50text-black
border-violet-500

What it does:Border color. Pairs with a border-width class (border = 1px, border-2 = 2px). Without an explicit width, no border renders. Common: border border-slate-700.

Examples:border border-slate-700border-2 border-cyan-500border-l-4 border-pink-500
bg-cyan-500/20

What it does:Color with opacity — the /N suffix sets alpha (0–100). bg-cyan-500/20 = cyan-500 at 20% opacity. Works on bg-, text-, border-, ring-, divide-, and many more.

Examples:bg-cyan-500/20text-pink-500/80border-violet-500/40
bg-transparent
Aa text

What it does:Fully transparent background — useful to clear a parent style, build invisible-but-clickable hit zones, or reset on hover.

Examples:bg-transparentbg-black/0border-transparent
bg-black/40

What it does:Black with 40% opacity — the canonical modal backdrop / scrim shade. Stronger than bg-black/20 (too faint on light pages), softer than bg-black/60 (too dark for hovering toolbars).

Examples:bg-black/40bg-black/60bg-white/10
ring-2 ring-cyan-500

What it does:Ring = a "border" rendered as a box-shadow so it does NOT add to layout size. Perfect for focus rings: focus:ring-2 ring-cyan-500. Adjust with ring-offset-2 to inset.

Examples:ring-2 ring-cyan-500ring-4 ring-pink-500/50ring-inset ring-violet-500
divide-y divide-slate-700

What it does:Divide utilities add a border between adjacent children — divide-y for horizontal lines, divide-x for vertical. Pair with a divide color. No more "last:border-b-0" hacks.

Examples:divide-y divide-slate-700divide-x divide-cyan-500/40
text-[#06e6d7]
Aa text

What it does:Arbitrary color via bracket syntax — accept a raw hex / rgb / oklch / var(). Use only when the palette truly does not cover what you need (brand colors, design-token bridges).

Examples:text-[#06e6d7]bg-[oklch(72%_0.18_270)]bg-[var(--brand)]
bg-sky-500

What it does:Sky — a brighter, more saturated blue than the muted slate / indigo. Common for info banners and links. Sits between cyan and blue on the palette wheel.

Examples:bg-sky-500bg-blue-500bg-indigo-500
bg-zinc-800

What it does:Zinc — the coolest, most neutral of the five Tailwind grays (gray, slate, zinc, neutral, stone). zinc-800 / 900 make clean dark-UI surfaces with no color cast.

Examples:bg-zinc-800bg-neutral-800bg-stone-800
text-transparent bg-clip-text
Aa text

What it does:Gradient text trick — paint a gradient as the background, clip it to the glyph shapes with bg-clip-text, then hide the fill with text-transparent. Pair with bg-gradient-to-r from-X to-X.

Examples:bg-clip-text text-transparentbg-clip-borderbg-clip-padding
accent-cyan-500

What it does:accent-color — tints native form controls (checkbox, radio, range, progress) without custom markup. accent-cyan-500 makes a checked box cyan in one class. Browser-rendered, very lightweight.

Examples:accent-cyan-500accent-pink-500accent-violet-600
caret-pink-500
Aa text

What it does:caret-color — sets the blinking text-cursor color inside inputs and textareas. A tiny detail that makes a branded input feel polished. Independent from the text color.

Examples:caret-pink-500caret-cyan-400caret-transparent
placeholder:text-slate-500
Aa text

What it does:Styles the placeholder text of an input via the placeholder: variant. placeholder:text-slate-500 keeps hint text dim against real input. Also takes placeholder:italic, placeholder:text-sm.

Examples:placeholder:text-slate-500placeholder:italicplaceholder:text-xs
fill-cyan-500

What it does:SVG fill color — colors the fill of an inline SVG icon from the palette. Pair with stroke-X for outlined icons. fill-current reads the surrounding text color so icons inherit it.

Examples:fill-cyan-500fill-currentstroke-pink-500
Flex (15)
flex

What it does:display: flex on the container. Direct children become flex items, laid out in a row by default with stretch alignment. The starting point for 80% of modern layouts.

Examples:flexinline-flexflex flex-col
flex-col

What it does:flex-direction: column — stack items vertically. Combine with items-x for cross-axis (now horizontal) alignment, justify-x for main-axis (now vertical) alignment.

Examples:flex-colflex-rowflex-row-reverse
items-center

What it does:align-items: center — cross-axis centering. In a flex-row container this centers items vertically; in flex-col it centers them horizontally. The most-typed flex class.

Examples:items-startitems-centeritems-enditems-baseline
justify-between

What it does:justify-content: space-between — first and last items hug the edges, equal space between the rest. The standard pattern for "logo left, nav right" headers.

Examples:justify-startjustify-centerjustify-endjustify-between
flex-1

What it does:flex: 1 1 0% — grow to fill, shrink if needed, ignore intrinsic size. The "fill the rest" class. flex-auto keeps intrinsic size, flex-initial only shrinks, flex-none never grows or shrinks.

Examples:flex-1flex-autoflex-initialflex-none
shrink-0

What it does:flex-shrink: 0 — prevents an item from shrinking when the container is too narrow. Apply to icons / labels you do NOT want squished while sibling text truncates.

Examples:shrink-0shrinkgrowgrow-0
flex-wrap

What it does:flex-wrap: wrap — items overflow to a new line instead of squishing. Pair with gap- for grid-like rows that adapt to width. Default is nowrap.

Examples:flex-wrapflex-nowrapflex-wrap-reverse
gap-2

What it does:Gap between flex items (also works on grid). Same numeric scale as spacing — gap-1 = 4px, gap-4 = 16px. Cleaner than space-x / space-y for most cases.

Examples:gap-1gap-2gap-4gap-x-3 gap-y-1
self-end

What it does:align-self override — lets a single flex item ignore the container's items-x. Use to push one button to the bottom of a flex-col card while the rest stay at top.

Examples:self-startself-centerself-endself-stretch
order-last

What it does:Reorders a flex item without changing DOM order. Useful for swapping the visual order of two columns on mobile vs desktop (md:order-first).

Examples:order-firstorder-lastorder-1md:order-2
justify-center

What it does:justify-content: center — packs items toward the main-axis center. Combine flex items-center justify-center for the one-line "center a thing both ways" pattern.

Examples:justify-centerjustify-evenlyjustify-around
items-stretch

What it does:align-items: stretch — the flex default; items grow to fill the cross axis so columns in a row reach equal height. Override with items-start when you do not want the stretch.

Examples:items-stretchitems-baselineitems-start
content-center

What it does:align-content — controls spacing BETWEEN wrapped flex / grid lines (only matters with flex-wrap and multiple rows). Different from items-center, which aligns within a single line.

Examples:content-centercontent-betweencontent-start
grow

What it does:flex-grow: 1 — the item expands to absorb leftover main-axis space. grow-0 disables growing. Use grow on the middle column of a toolbar so it eats the gap between fixed-size ends.

Examples:growgrow-0flex-1
flex-row-reverse

What it does:flex-direction: row-reverse — lays items right-to-left while keeping DOM order. Useful for mirroring a layout in RTL contexts or putting the primary action on the right.

Examples:flex-row-reverseflex-col-reverseflex-wrap-reverse
Grid (13)
grid

What it does:display: grid on the container. Combine with grid-cols-N to define columns. Grid is the right tool for 2D layouts (rows AND columns matter); use flex for 1D.

Examples:gridgrid grid-cols-2 gap-2inline-grid
grid-cols-3

What it does:Defines 3 equal-width columns (1fr 1fr 1fr). grid-cols-N goes 1–12 by default. For variable widths use grid-cols-[200px_1fr] arbitrary syntax.

Examples:grid-cols-2grid-cols-3grid-cols-12grid-cols-[200px_1fr]
grid-rows-2

What it does:Defines explicit row tracks. Less common than grid-cols because rows usually flow from content; use when you need explicit row sizing (e.g. fixed-height dashboard cells).

Examples:grid-rows-2grid-rows-3grid-rows-[auto_1fr_auto]
col-span-2

What it does:A grid item spans 2 columns. col-span-full spans every column. Combine with grid-cols-3 to make one "wide cell" in a 3-col grid.

Examples:col-span-2col-span-3col-span-fullrow-span-2
grid-cols-[200px_1fr]

What it does:Arbitrary grid template — first column fixed at 200px, second takes the rest. The "sidebar + content" pattern in one class. Underscores stand for spaces.

Examples:grid-cols-[200px_1fr]grid-cols-[repeat(auto-fit,minmax(160px,1fr))]
place-items-center

What it does:Shorthand for align-items + justify-items — every grid cell centers its child both ways. The fastest way to center one item: grid place-items-center.

Examples:place-items-centerplace-items-startplace-content-center
auto-rows-fr

What it does:Implicit row sizing — every auto-generated row takes 1 fraction of available height (equal). Pairs with explicit grid-cols + variable-height content to keep rows aligned.

Examples:auto-rows-frauto-rows-minauto-rows-max
grid-flow-col

What it does:Items flow into columns first instead of rows. Useful for "fill horizontally before vertically" — a left-to-right keyboard layout, a calendar with weeks as columns.

Examples:grid-flow-rowgrid-flow-colgrid-flow-dense
grid-cols-subgrid

What it does:subgrid — a nested grid adopts the parent grid's column tracks instead of defining its own, so deep children line up to the outer columns. Tailwind 3.4+, modern browsers only.

Examples:grid-cols-subgridgrid-rows-subgridcol-span-3 grid grid-cols-subgrid
col-start-2

What it does:Places a grid item to start at line 2 — pair col-start-N with col-end-N for explicit placement instead of relying on auto-flow. col-start-2 col-end-4 spans columns 2 and 3.

Examples:col-start-2col-end-4col-start-1 col-end-3
row-span-2

What it does:A grid item spans 2 rows tall — the vertical counterpart of col-span. Combine with col-span-2 to make a 2×2 hero cell in a masonry-style dashboard. row-span-full spans every row.

Examples:row-span-2row-span-3row-span-full
justify-items-start

What it does:justify-items — sets the default inline-axis (horizontal) alignment of every item WITHIN its grid cell. Different from justify-content, which distributes the whole track set.

Examples:justify-items-startjustify-items-centerjustify-items-stretch
grid-cols-[repeat(auto-fill,minmax(120px,1fr))]

What it does:Responsive auto-grid — columns auto-fill at a minimum 120px each, growing to share the row. No media queries needed; the grid reflows columns purely by available width. auto-fit collapses empty tracks.

Examples:grid-cols-[repeat(auto-fill,minmax(120px,1fr))]grid-cols-[repeat(auto-fit,minmax(200px,1fr))]
Typography (19)
text-sm
Aa text

What it does:font-size: 0.875rem (14px), line-height: 1.25rem. Scale: xs(12), sm(14), base(16), lg(18), xl(20), 2xl(24), 3xl(30), 4xl(36), 5xl(48), 6xl(60), 7xl(72), 8xl(96), 9xl(128).

Examples:text-xstext-smtext-basetext-lgtext-3xl
font-bold
Aa text

What it does:font-weight: 700. Scale: thin(100), extralight(200), light(300), normal(400), medium(500), semibold(600), bold(700), extrabold(800), black(900). The font must actually ship the weight to render it.

Examples:font-normalfont-mediumfont-semiboldfont-bold
leading-relaxed
Aa text

What it does:line-height: 1.625 — comfortable for long-form reading. Named scale: none(1), tight(1.25), snug(1.375), normal(1.5), relaxed(1.625), loose(2). For UI use tight–normal; for prose, relaxed.

Examples:leading-noneleading-tightleading-normalleading-relaxed
tracking-wide
Aa text

What it does:letter-spacing scale: tighter(-0.05em), tight(-0.025em), normal(0), wide(0.025em), wider(0.05em), widest(0.1em). Wide / wider on uppercase short text reads cleanly; never on body copy.

Examples:tracking-tighttracking-normaltracking-widetracking-widest
text-center
Aa text

What it does:text-align: center. Variants: text-left, text-right, text-justify, text-start (logical), text-end (logical). RTL-friendly forms are start/end.

Examples:text-lefttext-centertext-righttext-justify
underline
Aa text

What it does:text-decoration: underline. Customize with decoration-{color}, decoration-2, underline-offset-4, decoration-wavy. Pair with hover:no-underline for clean link interactions.

Examples:underlineno-underlineline-throughunderline decoration-wavy
italic
Aa text

What it does:font-style: italic. Pair with not-italic to reset. On most UI fonts italic is heavier visually than a font-weight bump — use sparingly.

Examples:italicnot-italic
uppercase
Aa text

What it does:text-transform: uppercase. Set lowercase, capitalize, normal-case for the others. Pair uppercase with tracking-wide for labels / eyebrow text.

Examples:uppercaselowercasecapitalizenormal-case
truncate
Aa text

What it does:Single-line truncate with ellipsis (overflow: hidden + text-overflow: ellipsis + whitespace: nowrap). Needs an explicit width on the element or a flex / grid parent with min-w-0.

Examples:truncatetext-ellipsisoverflow-hidden whitespace-nowrap
line-clamp-3
Aa text

What it does:Multi-line truncate — show N lines then ellipsis. Replaces the old WebKit -webkit-line-clamp hack. line-clamp-none removes the clamp.

Examples:line-clamp-1line-clamp-2line-clamp-3line-clamp-none
text-balance
Aa text

What it does:text-wrap: balance — browser balances line lengths for prettier headings (no orphans). Best on h1 / h2 / hero copy. text-pretty is the softer version for body text (modern browsers only).

Examples:text-balancetext-prettytext-wraptext-nowrap
font-mono
Aa text

What it does:Monospace font stack — code, numerics, tabular data. Pair with text-xs / text-sm for code snippets. Custom mono fonts go through your theme (e.g. JetBrains Mono).

Examples:font-sansfont-monofont-serif
whitespace-nowrap
Aa text

What it does:white-space: nowrap — keeps text on a single line, no wrapping. The half of truncate that prevents line breaks; pair with overflow-hidden + text-ellipsis for the full clip. whitespace-pre keeps literal spaces and newlines.

Examples:whitespace-nowrapwhitespace-prewhitespace-pre-wrapwhitespace-normal
break-words
Aa text

What it does:overflow-wrap: break-word — lets long unbroken strings (URLs, hashes) wrap inside the box instead of overflowing. break-all is more aggressive; break-keep avoids breaking CJK words.

Examples:break-wordsbreak-allbreak-keepbreak-normal
tabular-nums
Aa text

What it does:font-variant-numeric: tabular-nums — every digit takes equal width so columns of numbers line up. Essential for tables, timers, and counters where digits change but should not jitter. lining-nums, slashed-zero are siblings.

Examples:tabular-numslining-numsslashed-zerooldstyle-nums
align-middle

What it does:vertical-align: middle — aligns an inline / inline-block element (like an icon) to the middle of the surrounding text. The classic fix for an SVG icon sitting too low next to a label.

Examples:align-middlealign-baselinealign-topalign-text-bottom
decoration-cyan-500
Aa text

What it does:text-decoration-color — colors an underline / line-through independently of the text. Pair with underline decoration-2 underline-offset-4 to build a branded link underline that does not touch the descenders.

Examples:decoration-cyan-500decoration-wavydecoration-dottedunderline-offset-4
list-disc
Aa text

What it does:list-style-type: disc — restores bullet points (Tailwind's preflight resets lists to none). Pair with list-inside / list-outside for marker position. list-decimal gives numbered lists.

Examples:list-disclist-decimallist-insidelist-none
antialiased
Aa text

What it does:-webkit-font-smoothing: antialiased — renders thinner, smoother text on WebKit / macOS, often preferred for light-on-dark UI. subpixel-antialiased restores the default crisper rendering.

Examples:antialiasedsubpixel-antialiased
Responsive (13)
md:flex-row

What it does:Apply flex-row from medium width up (≥ 768px). Tailwind is MOBILE-FIRST: no prefix = all widths, sm: = ≥ 640, md: = ≥ 768, lg: = ≥ 1024, xl: = ≥ 1280, 2xl: = ≥ 1536.

Examples:md:flex-rowsm:hidden md:blocklg:grid-cols-3
sm:hidden
Aa text

What it does:Hidden from sm up (≥ 640px) — only visible on screens narrower than 640. To do the opposite ("only show on desktop"), use hidden md:block (hidden by default, shown from md).

Examples:sm:hiddenhidden md:blocklg:flex
lg:text-2xl
Aa text

What it does:Font size jumps to 2xl from lg width up. Standard responsive heading pattern: text-2xl md:text-3xl lg:text-4xl scales gracefully across devices.

Examples:lg:text-2xlmd:text-base lg:text-lg2xl:text-5xl
md:grid-cols-2

What it does:Switch to 2-column grid on md and up. Stack mobile (no prefix), 2-col tablet (md:), 3-col desktop (lg:) — the canonical responsive card grid.

Examples:md:grid-cols-2lg:grid-cols-3xl:grid-cols-4
sm:p-6
Aa text

What it does:Spacing scales with viewport — tight padding on mobile, generous on desktop. Pattern: p-4 sm:p-6 lg:p-8.

Examples:sm:p-6md:p-8lg:px-12
max-sm:flex-col

What it does:Tailwind 3.2+ "max-" prefix — apply UP TO this breakpoint (mobile-only override). max-sm:flex-col = "be column on screens smaller than sm". Inverts the mobile-first default when you need.

Examples:max-sm:flex-colmax-md:hiddenmax-lg:text-sm
sm:py-2 md:py-3 lg:py-4
Aa text

What it does:Chained responsive overrides — vertical padding scales in three steps. Last-prefix wins by specificity? No — by ORDER in CSS. Tailwind generates them so the larger breakpoint comes later.

Examples:sm:py-2 md:py-3 lg:py-4
@container
Aa text

What it does:Tailwind 4 container queries — mark a parent with @container, then children use @sm: @md: @lg: prefixes that react to the parent's width, not the viewport. Game-changer for components in sidebars.

Examples:@container@sm:flex-row@md:text-base
print:hidden
Aa text

What it does:print: variant — applies only when the page is printed (or saved as PDF). print:hidden drops nav / buttons from printouts; print:block reveals a print-only header. A real media query, not a breakpoint.

Examples:print:hiddenprint:blockprint:text-black
portrait:flex-col

What it does:Orientation variant — portrait: applies when the device is taller than wide, landscape: when wider than tall. Useful for tablets and phones that rotate, independent of pixel breakpoints.

Examples:portrait:flex-collandscape:flex-rowlandscape:hidden
min-[900px]:grid-cols-4

What it does:Arbitrary breakpoint — min-[900px]: fires at any custom min-width without registering a named screen. Use for a one-off breakpoint between md and lg. max-[480px]: is the upper-bound twin.

Examples:min-[900px]:grid-cols-4max-[480px]:hiddenmin-[1440px]:px-16
rtl:text-right
Aa text

What it does:Direction variant — rtl: applies under dir="rtl", ltr: under left-to-right. Use to flip a chevron or push text the other way for Arabic / Hebrew layouts without duplicating components.

Examples:rtl:text-rightltr:ml-2rtl:rotate-180
supports-[backdrop-filter]:bg-white/10
Aa text

What it does:CSS @supports feature query as a variant — applies only if the browser supports the named property. supports-[backdrop-filter]: lets you give a frosted look where possible and a solid fallback elsewhere.

Examples:supports-[backdrop-filter]:bg-white/10supports-[display:grid]:grid
State (20)
hover:bg-cyan-600
Aa text

What it does:Background changes on mouse hover. Combine: hover:bg-cyan-600 hover:text-white hover:scale-105. On touch devices hover briefly fires after tap — keep that in mind for animations.

Examples:hover:bg-cyan-600hover:text-whitehover:scale-105
focus:ring-2
Aa text

What it does:Adds a focus ring (box-shadow). Pair with focus:outline-none to remove the browser default and ring-cyan-500 / ring-offset-2 to style it. For a11y, prefer focus-visible: instead.

Examples:focus:ring-2focus:outline-nonefocus:border-cyan-500
focus-visible:ring-2
Aa text

What it does:Focus ring ONLY for keyboard focus — mouse clicks do not get the ring, keyboard Tab does. The a11y-correct way to style focus. Should be your default over plain focus:.

Examples:focus-visible:ring-2focus-visible:ring-cyan-500
active:scale-95
Aa text

What it does:Style on mouse-down (or touch-down). active:scale-95 with a transition gives buttons a satisfying "press" feel without writing keyframes.

Examples:active:scale-95active:bg-cyan-700
disabled:opacity-50
Aa text

What it does:Applies when [disabled] attribute is on the element. Standard combo: disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none.

Examples:disabled:opacity-50disabled:cursor-not-alloweddisabled:pointer-events-none
group-hover:translate-x-1
Aa text

What it does:Style child when an ancestor with class="group" is hovered. Add `group` to the parent, then `group-hover:` to any descendant. Classic pattern: arrow icon slides on card hover.

Examples:group-hover:translate-x-1group-hover:opacity-100group/card-hover:bg-cyan-500
peer-checked:bg-cyan-500

What it does:Sibling-based — a sibling element with class="peer" being :checked styles this one. The CSS-only way to build a custom checkbox / toggle: hide native input as peer, style the next div.

Examples:peer-checked:bg-cyan-500peer-focus:ring-2
dark:bg-slate-900
Aa text

What it does:Applies in dark mode. Configure dark mode strategy in CSS: @custom-variant dark (&:where(.dark, .dark *)) for class-based, or media query by default. Then pair every light style with a dark: override.

Examples:dark:bg-slate-900dark:text-slate-100dark:border-slate-700
motion-reduce:transition-none
Aa text

What it does:Applies when the user has set prefers-reduced-motion. Use to disable transitions / animations for accessibility. Pair with motion-safe: when an animation should ONLY play if the user allows.

Examples:motion-reduce:transition-nonemotion-safe:animate-pulse
aria-expanded:rotate-180
Aa text

What it does:Tailwind 3.2+ — style based on ARIA attribute. Built-ins: aria-checked, aria-disabled, aria-expanded, aria-hidden, aria-pressed, aria-readonly, aria-required, aria-selected. Custom: aria-[sort=ascending]:.

Examples:aria-expanded:rotate-180aria-pressed:bg-cyan-500aria-selected:bg-violet-500
data-[state=open]:bg-cyan-500
Aa text

What it does:Style based on data-* attribute value. The bridge to headless UI libraries (Radix, Headless UI, Ariakit) that expose state via data attributes — data-state="open", data-side="bottom".

Examples:data-[state=open]:bg-cyan-500data-[orientation=vertical]:flex-col
has-[:checked]:bg-cyan-500/10
Aa text

What it does:Tailwind 3.4+ — :has() parent selector. Style parent when a descendant matches. has-[:checked]:bg-cyan-500/10 = "tint card when its checkbox inside is checked". Modern browsers only.

Examples:has-[:checked]:bg-cyan-500/10has-[input:focus]:ring-2
first:pt-0
Aa text

What it does:Targets the first child via :first-child. Pair first:pt-0 / last:pb-0 to trim the outer padding of a divided list, or first:rounded-t-lg last:rounded-b-lg to round only the ends of a stack.

Examples:first:pt-0last:pb-0first:rounded-t-lglast:border-b-0
odd:bg-slate-800/40
Aa text

What it does:Zebra striping — odd: / even: target alternating children via :nth-child. odd:bg-slate-800/40 tints every other table row, no JavaScript and no index bookkeeping needed.

Examples:odd:bg-slate-800/40even:bg-slate-900/40nth-3:font-bold
group-focus-within:opacity-100
Aa text

What it does::focus-within on a group — style descendants when any element inside the group container has focus. Pattern: reveal a search-clear button only while the input wrapper holds focus.

Examples:group-focus-within:opacity-100focus-within:ring-2group-focus-within:text-cyan-300
peer-placeholder-shown:top-2
Aa text

What it does:Floating-label trick — peer-placeholder-shown: targets a label sibling while the peer input still shows its placeholder (empty). Combine with peer-focus: to float the label up once the user types.

Examples:peer-placeholder-shown:top-2peer-focus:-top-3peer-invalid:text-red-400
invalid:border-red-500
Aa text

What it does:Form-validation pseudo-class — invalid: styles an input that fails its HTML constraint (type=email, required, pattern). Pair with valid:border-emerald-500 for live inline feedback, no JS.

Examples:invalid:border-red-500valid:border-emerald-500required:border-amber-500
checked:bg-cyan-500

What it does::checked variant on the element itself — style a checkbox / radio when it is checked. Combine with appearance-none to fully restyle a native control into a custom toggle.

Examples:checked:bg-cyan-500checked:border-cyan-500indeterminate:bg-amber-500
target:ring-2
Aa text

What it does::target variant — styles the element whose id matches the current URL hash. target:ring-2 ring-cyan-500 highlights the section you just jumped to from a same-page anchor link. Pure CSS, no JS.

Examples:target:ring-2target:bg-cyan-500/10
not-first:border-t
Aa text

What it does:Tailwind 3.4+ not-* variant — negates another variant. not-first:border-t adds a top border to every child except the first, the cleaner replacement for the old [&:not(:first-child)] arbitrary selector.

Examples:not-first:border-tnot-last:mb-2not-disabled:hover:bg-cyan-600
Effect (19)
shadow-md

What it does:box-shadow scale: shadow-sm, shadow (default), shadow-md, shadow-lg, shadow-xl, shadow-2xl, shadow-inner, shadow-none. Color: shadow-cyan-500/40 tints the shadow.

Examples:shadowshadow-mdshadow-xlshadow-cyan-500/40
rounded-lg

What it does:border-radius scale: rounded-none, rounded-sm(2px), rounded(4), rounded-md(6), rounded-lg(8), rounded-xl(12), rounded-2xl(16), rounded-3xl(24), rounded-full(9999px). Side variants: rounded-t-lg, rounded-l-lg.

Examples:roundedrounded-lgrounded-2xlrounded-full
rounded-full

What it does:border-radius: 9999px — fully rounded ends. On a square element it makes a circle; on a wide pill it makes a capsule. The avatar / chip / pill standard.

Examples:rounded-fullrounded-l-fullrounded-tr-full
opacity-50

What it does:opacity scale: 0, 5, 10, 20, 25, 30, 40, 50, 60, 70, 75, 80, 90, 95, 100. opacity-50 = 0.5. Affects the whole element including children — use color/N alpha (bg-cyan-500/50) to tint just one property.

Examples:opacity-0opacity-50opacity-100hover:opacity-100
blur-sm

What it does:CSS blur filter. Scale: blur-none, blur-sm(4px), blur(8), blur-md(12), blur-lg(16), blur-xl(24), blur-2xl(40), blur-3xl(64). Use on backgrounds / decorative orbs, not on text.

Examples:blur-smblurblur-2xlbackdrop-blur-md
backdrop-blur-md

What it does:Blurs what is BEHIND the element — the iOS / macOS frosted glass look. Pair with bg-white/10 or bg-black/30 for the typical glass card. Performance cost — use sparingly.

Examples:backdrop-blurbackdrop-blur-mdbackdrop-blur-xl
transition-colors

What it does:Enables smooth transitions on color-related props. Variants: transition (all), transition-all, transition-colors, transition-opacity, transition-shadow, transition-transform. Add duration-N and ease-N.

Examples:transitiontransition-colorstransition-transformtransition-all
duration-300

What it does:transition-duration in ms. Common scale: 75, 100, 150, 200, 300, 500, 700, 1000. Default if you only write `transition` is 150ms. For UI feedback < 200ms feels snappy; > 400ms feels sluggish.

Examples:duration-150duration-300duration-500
animate-pulse

What it does:Built-in keyframe animation — opacity pulsing. Built-ins: animate-spin, animate-ping, animate-pulse, animate-bounce, animate-none. Custom: define @keyframes + @theme to extend.

Examples:animate-spinanimate-pinganimate-pulseanimate-bounce
animate-spin

What it does:360° rotation loop, 1s linear infinite. The canonical loading spinner — wrap a circle SVG with this class and you have a spinner in one line.

Examples:animate-spinanimate-spin duration-700
shadow-cyan-500/40

What it does:Colored shadow — the shadow takes a palette tint at the given opacity. shadow-lg shadow-cyan-500/40 gives a glowing card lift on dark UI. Works on any shadow size class.

Examples:shadow-cyan-500/40shadow-pink-500/50shadow-violet-500/30
ring-offset-2

What it does:ring-offset — inserts a gap (in the ring-offset color, default bg) between the element and its ring, so the ring floats just outside the edge. The polished focus-ring look: ring-2 ring-cyan-500 ring-offset-2 ring-offset-slate-900.

Examples:ring-offset-2ring-offset-slate-900ring-inset
grayscale

What it does:filter: grayscale(100%) — desaturates an element to black-and-white. Pair with hover:grayscale-0 to color a logo on hover. Other filters: sepia, invert, brightness-N, contrast-N, saturate-N.

Examples:grayscalegrayscale-0sepiainvert
brightness-110

What it does:filter: brightness() — scales luminance. brightness-110 lightens 10%, brightness-90 darkens. The cheap, GPU-friendly way to do a hover lift on an image without swapping assets.

Examples:brightness-110brightness-90contrast-125saturate-150
drop-shadow-lg

What it does:filter: drop-shadow — unlike box-shadow it follows the element's actual alpha shape, so it shadows transparent PNGs and SVG icons correctly. Scale: drop-shadow-sm … drop-shadow-2xl.

Examples:drop-shadowdrop-shadow-lgdrop-shadow-2xldrop-shadow-none
mix-blend-screen

What it does:mix-blend-mode — blends an element with what is behind it. screen lightens (great for glow orbs over dark backgrounds), multiply darkens, overlay boosts contrast. Heavy on GPU at full-screen sizes.

Examples:mix-blend-screenmix-blend-multiplymix-blend-overlay
scale-105

What it does:transform: scale — scale-105 grows to 105%, scale-95 shrinks. The hover-lift / press-down standard: hover:scale-105 active:scale-95 transition-transform. Axis variants scale-x-, scale-y- exist.

Examples:scale-105scale-95scale-x-110scale-0
rotate-45

What it does:transform: rotate — degrees. rotate-45 tilts 45°, -rotate-45 the other way. Combine with transition-transform for spinning chevrons (open/close) and tilted badges. Scale: 0,1,2,3,6,12,45,90,180.

Examples:rotate-45-rotate-45rotate-90rotate-180
cursor-pointer
Aa text

What it does:cursor — the mouse pointer shape. cursor-pointer for clickable non-button elements, cursor-not-allowed for disabled, cursor-grab / cursor-grabbing for drag UIs, cursor-wait during loading.

Examples:cursor-pointercursor-not-allowedcursor-grabcursor-wait
Position (13)
absolute

What it does:position: absolute — taken out of normal flow, positioned relative to the nearest positioned ancestor. Pair with top-N / right-N / bottom-N / left-N or inset-N.

Examples:absoluterelativeabsolute top-0 right-0
relative
Aa text

What it does:position: relative — stays in flow but becomes the positioning context for absolute children. The most common pattern: relative parent, absolute decorative children.

Examples:relativerelative isolate
fixed
Aa text

What it does:position: fixed — relative to the viewport, ignores scroll. Used for headers, FABs, modals. fixed inset-0 = full-screen overlay.

Examples:fixedfixed top-0 left-0fixed inset-0
sticky top-0
Aa text

What it does:position: sticky — element is relative until it hits the offset (top-0 here), then sticks. Needs a scrollable parent. Standard for table headers, section nav, sticky CTAs.

Examples:sticky top-0sticky bottom-0sticky top-4
inset-0

What it does:Shorthand for top-0 right-0 bottom-0 left-0 — stretches an absolute / fixed element to fill its parent / viewport. The "make this a full overlay" class.

Examples:inset-0inset-x-0 bottom-0inset-y-0 left-0
top-2 right-2

What it does:Offsets for positioned elements. Standard pattern for a close button: absolute top-2 right-2. Negative values for overhang: -top-2 -right-2 pulls out of the corner.

Examples:top-0 right-0top-2 right-2-top-2 -right-2
z-50
Aa text

What it does:z-index scale: z-0, z-10, z-20, z-30, z-40, z-50, z-auto. Tailwind keeps the stack low on purpose — most pages should not exceed z-50. Modals z-50, dropdowns z-40, sticky headers z-30.

Examples:z-10z-50z-auto-z-10
overflow-hidden

What it does:Clips content outside the box. Pair with rounded-* to make rounded images / cards (otherwise inner content draws over the rounded corners). Also: overflow-auto, overflow-x-scroll.

Examples:overflow-hiddenoverflow-autooverflow-x-scrolloverflow-y-clip
inset-x-0

What it does:Shorthand for left-0 right-0 — stretches a positioned element across the full width while leaving vertical offsets free. Pattern: absolute inset-x-0 bottom-0 for a bottom bar pinned across the parent.

Examples:inset-x-0inset-y-0inset-x-4
isolate
Aa text

What it does:isolation: isolate — creates a new stacking context so z-index inside this element can not interfere with the rest of the page. The clean fix for "my modal's z-50 fights a sibling's z-index".

Examples:isolateisolation-auto
object-cover

What it does:object-fit: cover — an img / video fills its box and crops the overflow, keeping aspect ratio. object-contain fits fully (may letterbox), object-fill stretches. Pair with object-center to control the crop focus.

Examples:object-coverobject-containobject-fillobject-center
float-right

What it does:float: right — wraps text around a floated element, the classic magazine pull-quote / inline-image layout. Clear floats below with clear-both. Rare in app UI, still useful in prose.

Examples:float-rightfloat-leftclear-bothfloat-none
static
Aa text

What it does:position: static — the default; the element ignores top / left / z-index and stays in normal flow. Use to explicitly reset a position set higher up (e.g. md:static to undo an absolute on desktop).

Examples:staticmd:staticrelative md:absolute
Background (10)
bg-gradient-to-r

What it does:Linear gradient direction. Variants: -t, -tr, -r, -br, -b, -bl, -l, -tl. Pair with from-X to-X (and optional via-X) to set color stops. Tailwind 4 adds angle syntax bg-linear-45.

Examples:bg-gradient-to-rbg-gradient-to-brbg-linear-45
from-cyan-500

What it does:Gradient start color. Pair with bg-gradient-to-* and to-X. Optional position: from-cyan-500 from-10% starts the cyan stop at 10% along the line. Same for via- and to-.

Examples:from-cyan-500from-violet-500 from-10%from-transparent
via-violet-500

What it does:Optional middle stop in a gradient — gives you a three-color blend (from → via → to). Common Aurora gradient: from-cyan-500 via-violet-500 to-pink-500.

Examples:via-violet-500via-fuchsia-500via-transparent
to-pink-500

What it does:Gradient end color. Combine: bg-gradient-to-r from-cyan-500 to-pink-500. For "fade out to transparent" use to-transparent — useful for fading text edges and image vignettes.

Examples:to-pink-500to-transparentto-cyan-500/0
bg-cover

What it does:background-size: cover — image scales to cover the box, may crop. Other: bg-contain (fit fully, may letterbox), bg-auto (natural size). Pair with bg-center for typical hero images.

Examples:bg-coverbg-containbg-centerbg-no-repeat
bg-[url(/hero.png)]

What it does:Arbitrary background image — bracket syntax accepts any url() / linear-gradient() / radial-gradient() value. Useful for noise textures, dot grids, custom gradients beyond the named scale.

Examples:bg-[url(/hero.png)]bg-[radial-gradient(circle,theme(colors.cyan.500),transparent)]
bg-fixed

What it does:background-attachment: fixed — the background image stays pinned to the viewport while content scrolls over it, the parallax-hero effect. bg-local scrolls with the element's own content, bg-scroll with the page.

Examples:bg-fixedbg-localbg-scroll
bg-no-repeat

What it does:background-repeat: no-repeat — shows the background image once instead of tiling. bg-repeat-x tiles only horizontally, bg-repeat-round / bg-repeat-space adjust spacing of the tiled copies.

Examples:bg-no-repeatbg-repeat-xbg-repeat-round
bg-origin-border

What it does:background-origin — sets the box the background is positioned from: border, padding (default), or content. bg-origin-border lets a background image run under the border, useful for full-bleed gradient borders.

Examples:bg-origin-borderbg-origin-paddingbg-origin-content
bg-left-top

What it does:background-position — anchors the background image. bg-center is the common one; bg-left-top, bg-right-bottom, bg-top etc. cover the nine-point grid. Pair with bg-cover for hero crops that favor a corner.

Examples:bg-left-topbg-centerbg-right-bottombg-top
Tailwind 4 (15)
@theme
Aa text

What it does:Tailwind 4 CSS-first config — declares theme tokens directly in CSS. Replaces tailwind.config.js. Variables generated automatically: --color-X for colors, --font-X for fonts, --spacing-X for spacing scale.

Examples:@theme { --color-brand: #06e6d7; }@theme inline { ... }
theme()
Aa text

What it does:In-CSS function to read a theme token. theme(colors.cyan.500) returns the cyan-500 value. Use in arbitrary-value contexts: shadow-[0_4px_8px_theme(colors.cyan.500/40)].

Examples:theme(colors.cyan.500)theme(spacing.4)theme(--color-brand)
bg-cyan-500/[0.4]

What it does:oklch-based palette in Tailwind 4 — wider gamut, smoother gradients, more perceptually uniform brightness. Old hex / rgb values are converted automatically; you write the same class names.

Examples:bg-cyan-500bg-[oklch(72%_0.18_270)]
@container/named
Aa text

What it does:Container queries built in (no plugin needed). Mark parent with @container, then children use @sm: @md: @lg: that react to the parent's width. Name a container: @container/sidebar lets a deeper child target THIS specific ancestor with @sm/sidebar:.

Examples:@container/sidebar@sm/sidebar:flex-row@md/main:grid
@sm:flex-row

What it does:Container-query breakpoint — applies when the @container parent reaches ≥ sm (default 640px). Just like sm: but driven by parent width instead of viewport. Game-changer for components reused at different sizes.

Examples:@sm:flex-row@md:text-base@lg:grid-cols-3
size-N (3.4+)

What it does:Tailwind 3.4+ size shorthand — sets width AND height. size-8 is exactly w-8 h-8. Saves writing the same number twice for icons, avatars, dots. Half the diff in component PRs.

Examples:size-4size-8size-12
rotate-x-45

What it does:Tailwind 4 3D transforms — rotate around X, Y, Z axes. Pair with perspective-N on the parent and transform-3d to enable. translate-z-N moves toward / away from the viewer.

Examples:rotate-x-45rotate-y-180translate-z-4
starting:opacity-0

What it does:Tailwind 4 — applies styles via CSS @starting-style. When an element first appears, those styles are the starting frame for the transition. The CSS-native way to animate elements IN without keyframes.

Examples:starting:opacity-0starting:-translate-y-2
bg-linear-to-r

What it does:Tailwind 4 renames bg-gradient-to-r to bg-linear-to-r and adds bg-radial / bg-conic. Angles are now first-class: bg-linear-45 sets a 45° linear gradient. The from-/via-/to- stops work the same.

Examples:bg-linear-to-rbg-linear-45bg-radialbg-conic
text-(--brand)
Aa text

What it does:Tailwind 4 CSS-variable shorthand — text-(--brand) reads a custom property without the verbose text-[var(--brand)] bracket form. Works for any value slot: bg-(--surface), w-(--sidebar).

Examples:text-(--brand)bg-(--surface)w-(--sidebar)
not-hover:opacity-60

What it does:Tailwind 4 not-* variant generalized — negates ANY variant inline. not-hover:opacity-60 dims an element except while hovered, not-supports-[grid]:block gives a non-grid fallback. Cleaner than arbitrary :not() selectors.

Examples:not-hover:opacity-60not-focus:border-transparentnot-first:mt-2
field-sizing-content
Aa text

What it does:Tailwind 4 wrapper for CSS field-sizing — a textarea auto-grows to fit its content with no JS resize observer. field-sizing-content on a textarea, and it expands as you type. field-sizing-fixed restores normal behavior.

Examples:field-sizing-contentfield-sizing-fixed
inset-shadow-sm

What it does:Tailwind 4 splits inner shadows into their own scale — inset-shadow-sm / inset-shadow / inset-shadow-lg, plus inset-ring-N. They compose independently from the outer shadow-* so a button can have both an outer lift and an inner press.

Examples:inset-shadow-sminset-shadowinset-ring-2
transition-discrete

What it does:Tailwind 4 wrapper for transition-behavior: allow-discrete — lets discrete properties like display animate. Pair with starting:opacity-0 and a display toggle to fade an element in and out of display:none, no JS.

Examples:transition-discretestarting:opacity-0 transition-discrete
scheme-dark
Aa text

What it does:Tailwind 4 maps color-scheme — scheme-dark / scheme-light tell the browser which native UI (scrollbars, form controls, default colors) to render. Set scheme-dark on a dark page so scrollbars match instead of staying light.

Examples:scheme-darkscheme-lightscheme-light-dark

What this tool does

A searchable Tailwind CSS cheat sheet with 100+ utility classes across twelve categories, every entry rendered with a LIVE preview right next to the name so you SEE what the class does instead of guessing. Covers spacing (p- / m- / px / py / space- / gap with the rem / px conversion called out), sizing (w- / h- / min-w / max-w / size- 3.4+ shorthand), color (bg- / text- / border- / ring- against the full palette slate → rose, shades 50–950), flex (flex-row / col, items-*, justify-*, flex-1, shrink-0), grid (grid-cols-N, grid-rows-N, col-span, place-items, arbitrary templates), typography (text-xs → text-9xl, font-thin → font-black, leading, tracking, align, truncate, line-clamp, text-balance), responsive (sm: / md: / lg: / xl: / 2xl: with actual breakpoints 640 / 768 / 1024 / 1280 / 1536 and the mobile-first rule), state (hover: / focus: / focus-visible: / active: / disabled: / group-* / peer-* / dark: / motion-reduce: / aria-* / data-[state=open]: / has-[:checked]:), effects (shadow-, rounded-, opacity-, blur-, backdrop-blur, transition, duration-, animate-spin / pulse / bounce), position (absolute / relative / fixed / sticky, inset-, z-), background (bg-gradient-to-r, from- via- to-), and Tailwind 4 additions (@theme, theme(), oklch palette, built-in @container queries, size- shorthand, 3D transform utilities, @starting-style). Every entry has bilingual EN / ZH descriptions written independently — not machine-translated — plus one or more usage examples and a working live preview. Search runs across class names, descriptions, and examples; filter chips narrow to any category; one click copies the class to your clipboard. 100% client-side — no upload, no execution, no network requests.

Tool details

Input
Text
The page exposes text boxes, numeric controls, file pickers, or structured inputs depending on the tool.
Output
Live result + Copy + Preview
The result area focuses on usable output, with copy, download, or preview actions when supported.
Privacy
Browser-side processing
The main tool logic does not call an external API, so inputs normally stay in the current tab.
Save / share
No account required
Open the page and use it; whether results survive refresh depends on the tool.
Performance budget
Initial JS <= 30 KB
No WASM budget is declared, keeping the tool quick to open on mobile.
Best fit
Developer & DevOps · Developer
Category and role tags drive related tools, internal links, and quick fit checks.

How to use

  1. 1. Input

    Paste or drop your content into the tool panel.

  2. 2. Process

    Click the button. All processing is local in your browser.

  3. 3. Copy / Download

    Copy the result or download to disk in one click.

How Tailwind CSS Cheatsheet fits into your work

Use it in the small gaps between coding, reviewing, debugging, and shipping.

Developer jobs

  • Formatting, validating, shrinking, or inspecting code-adjacent text.
  • Preparing snippets for documentation, tickets, commits, or handoff.
  • Checking a small payload quickly without switching tools.

Developer checks

  • Run irreversible transforms like minify or obfuscate on a copy.
  • Keep secrets out of pasted snippets unless the tool explicitly stays local.
  • Use your normal tests or linter before shipping transformed code.

Good next steps

These links move the current task into a more complete workflow.

  1. 1 CSS Box Shadow Generator Visual CSS box-shadow builder — multi-layer, inset, color/blur with live preview. Open
  2. 2 CSS Formatter & Minifier Format and beautify CSS — sort properties, indent rules, expand or minify. Open
  3. 3 CSS Loaders Generator CSS loaders — 40+ pure-CSS spinners/skeletons, customize color/size/speed, copy ready-to-use code. Open

Real-world use cases

  • Picking the right shadow without opening five docs tabs

    You are styling a card and cannot remember whether you want shadow-md, shadow-lg, or shadow-xl. Scroll to the effects rows, see all six depths rendered live side by side, and pick the one that reads as "raised but not floating" in under ten seconds. Same trick works for rounded-sm through rounded-3xl and the seven blur levels.

  • Translating a Figma spacing value into a Tailwind class

    The design says 24px of padding. You type 24 into search, see that p-6 maps to 1.5rem which is exactly 24px, and copy it. The rem-and-px column means you never have to divide by 4 in your head again. A whole grid gap of 16px is gap-4, a 12px margin is m-3, and a hairline 1px border stays border.

  • Getting a responsive layout right on the first try

    You want one column on phones and three on desktop. The grid rows show grid-cols-1 md:grid-cols-3, the responsive section spells out that md: kicks in at 768px, and the live preview resizes so you watch the breakpoint flip. No guessing whether md is 760 or 768, and no shipping a layout that only works on your own monitor.

  • Wiring up hover and dark mode states correctly

    A button needs a darker shade on hover and a different look in dark mode. The state rows show hover:bg-cyan-600 and dark:bg-slate-800 with previews you can actually trigger, plus the note that focus-visible is the keyboard-only variant you want for accessibility. You compose md:hover:dark:bg-slate-700 and know it will work before you save.

Common pitfalls

  • Building class names by string concat like `text-${c}-500` so Tailwind's scanner never sees them. Use a literal lookup table such as red maps to `text-red-500`.

  • Assuming `md:` means medium screens only. It means medium and up, so `md:hidden` hides on desktop too. Use the smallest width as the unprefixed base and override upward.

  • Reaching for `focus:` on a button when you want `focus-visible:`. Plain `focus:` also fires on mouse click and leaves an ugly ring; `focus-visible:` only shows the ring for keyboard users.

Privacy

Everything runs in your browser. The search box filters an in-memory array of class names and never sends a request, and the live previews are plain DOM rendered locally. Nothing you type is stored, logged, or put in the URL, so it is safe behind corporate proxies and on air-gapped machines where you cannot npm install a docs viewer.

FAQ

Tool combos

Folks in your role tend to reach for these alongside this tool.

Made by Toolora · 100% client-side · Updated 2026-06-13