lexington®
Use code LEX35 at checkout
7k+ customers.
Tailwind CSS hidden utilities classes you should know
51 Tailwind CSS v4 utilities classes. From container queries to @starting-style—with practical explanations and copy-ready snippets.
Published on October 20, 2025 by Michael AndreuzzaTailwind CSS is overflowing with utility classes, yet most teams only touch the surface. Digging deeper uncovers expressive helpers that solve layout quirks, improve accessibility, and unlock polished micro-interactions without adding custom CSS. Here’s a curated list of lesser-known Tailwind CSS utilities you can start using today to make your components feel engineered—not improvised.
Why these Tailwind CSS utilities stay hidden
- Tailwind CSS ships hundreds of utilities across layout, typography, and interaction layers.
- Documentation examples focus on the most common classes, so niche utilities slip under the radar.
- Many of these helpers mirror tricky pure CSS techniques (stacking contexts, scroll offset tuning, system color respect) that developers might avoid entirely.
- Knowing them improves Lighthouse scores, reduces overrides, and keeps your design tokens consistent.
1. contents removes wrapper boxes cleanly
contents sets display: contents so a parent behaves like it doesn’t exist in the layout while keeping its children in the DOM. It’s perfect when you need semantic wrappers for accessibility but want the browser to ignore them for flex or grid alignment.
<nav class="flex gap-6 text-sm">
<div class="contents">
<a class="underline-offset-4 hover:underline" href="#features">Features</a>
<a class="underline-offset-4 hover:underline" href="#pricing">Pricing</a>
</div>
</nav>
- Keeps semantic grouping for screen readers.
- Eliminates mystery spacing that happens with
display: blockwrappers. - Works inside both flex and grid contexts.
2. isolate creates a fresh stacking context
Use isolate when positioned child elements escape a component and get clipped or overlap unexpectedly. It applies isolation: isolate, forcing the element to start a new stacking context without additional positioning hacks.
<section class="relative isolate">
<div class="absolute inset-0 bg-gradient-to-br from-purple-500/20 to-blue-500/10 blur-3xl"></div>
<div class="relative rounded-3xl border border-white/10 bg-base-900/60 p-10">
<h2 class="text-3xl font-semibold text-white">Dashboard overview</h2>
</div>
</section>
- Prevents backdrop effects from bleeding onto neighboring sections.
- Lets you stack multiple glowing elements safely.
3. place-content-* handles both axes at once
place-content-* is shorthand for align-content + justify-content inside CSS Grid. If you’re building marketing “feature grids,” this single Tailwind CSS class keeps everything centered without two utilities.
<section class="grid place-content-center gap-8 rounded-3xl border border-zinc-200 p-10">
<p class="text-pretty max-w-xl text-lg text-zinc-600">
Tailwind CSS lets you compress repetitive utilities and keep components declarative.
</p>
</section>
place-content-center,place-content-between, andplace-content-stretchare available out of the box.- Avoids mixing
justify-*anditems-*when the grid’s tracks are already defined.
4. Scroll offset utilities: scroll-pt-* and scroll-m-*
When you have a sticky header or command bar, anchored sections often hide underneath it. Applying scroll-pt-* (scroll padding top) or scroll-p* on the container and scroll-m* on targets inserts an invisible offset so headings remain visible.
<main class="scroll-pt-24 space-y-20">
<section id="setup" class="scroll-mt-24">
<h2 class="text-2xl font-semibold">Setup Tailwind CSS</h2>
</section>
<section id="api" class="scroll-mb-16">
<h2 class="text-2xl font-semibold">API reference</h2>
</section>
</main>
- Mix
scroll-pt-*andscroll-pb-*on the scrolling container withscroll-mt-*orscroll-mb-*on target elements for reliable in-page navigation. - The same utilities fine-tune scroll snap experiences when used alongside
snap-*classes.
5. CSS scroll snap utilities: snap-x, snap-mandatory, snap-center
Tailwind CSS exposes the full scroll snap spec. Pair snap-x snap-mandatory on the container with snap-center on children to build carousels that feel native.
<div class="flex snap-x snap-mandatory gap-6 overflow-x-auto scroll-smooth">
<article class="snap-center min-w-[18rem] rounded-2xl border border-base-200 p-6 shadow">
<h3 class="text-lg font-semibold">Component previews</h3>
</article>
<!-- … -->
</div>
- No dependency on heavyweight carousel libraries.
- Works great alongside touch gestures and scroll-based navigation.
6. text-balance and text-pretty polish headlines
Tailwind CSS ships typography helpers that mirror CSS text wrap algorithms. text-balance keeps multi-line headings visually even, while text-pretty avoids cruel widows and lone words.
<h1 class="text-balance text-pretty text-4xl font-semibold leading-tight">
Ship stronger Tailwind CSS components with lighter markup and smarter defaults.
</h1>
- Improves readability without manual
<br />hacks. - Pair them with
md:text-5xlbreakpoints to keep marketing pages fluid. - They rely on modern
text-wrapvalues, so keep an eye on browser support when targeting legacy environments.
7. accent-* customizes native form controls
Browser default accent colors rarely match your brand. Tailwind CSS adds accent-* utilities that style radios, checkboxes, and range sliders consistently.
<label class="flex items-center gap-3 text-sm text-base-600">
<input type="checkbox" class="accent-emerald-500" checked />
Enable deployment previews
</label>
- Ships with the entire color palette (e.g.,
accent-base-400,accent-rose-500). - Keeps accessibility high because it respects
prefers-contrast.
8. caret-* signals focus state without custom CSS
caret-* controls the text cursor color in inputs and textareas. It’s subtle, but matching your brand color improves the perceived craft of a form.
<input
type="email"
placeholder="you@domain.com"
class="w-full rounded-lg border border-base-200 bg-white px-4 py-3 caret-indigo-500 focus:border-indigo-400 focus:ring-4 focus:ring-indigo-500/20"
/>
- Use with
focus-visible:variants so keyboard users get a strong highlight. - Combine with
placeholder:text-base-400for a cohesive form system.
9. motion-safe / motion-reduce variants respect user settings
While not a single class, these Tailwind CSS variants are rarely used despite being built-in. Wrap your animation utilities behind motion-safe: to keep experiences smooth for users who opt out of motion.
<button
class="group inline-flex items-center gap-2 rounded-full bg-zinc-900 px-6 py-3 text-white motion-safe:transition motion-safe:duration-200 motion-safe:hover:-tranbase-y-0.5"
>
Explore templates
<span class="motion-safe:animate-pulse">→</span>
</button>
- Tailwind automatically emits the correct
@media (prefers-reduced-motion)query. - Prevents vestibular discomfort without sacrificing delight for others.
10. supports-[...] unlocks progressive enhancement
Tailwind’s arbitrary variants let you pair utilities with @supports rules. The supports-[display:grid] variant only applies classes when the user’s browser can handle them, keeping graceful fallbacks intact.
<section class="grid gap-6 supports-[display:grid]:grid-cols-[minmax(16rem,_1fr)_2fr]">
<aside class="rounded-2xl border border-base-200 p-6">Outline</aside>
<div class="rounded-2xl border border-base-200 p-6">Article body</div>
</section>
- Combine with
supports-[backdrop-filter]:backdrop-blur-lgfor frosted glass effects. - Great for progressive enhancements in dashboards and marketing sites.
11. aria-* variants wire accessibility state into styling
aria-* variants style elements based on ARIA attribute values—no extra JavaScript. You can toggle panels, indicate selection, or show errors based purely on stateful markup.
<button
aria-expanded="false"
class="group inline-flex items-center gap-3 rounded-xl border border-base-200 px-5 py-3 aria-expanded:bg-zinc-900 aria-expanded:text-white"
>
Resources
<svg class="size-4 transition group-aria-expanded:rotate-180" viewBox="0 0 20 20" fill="none">
<path d="M5 8l5 5 5-5" stroke="currentColor" stroke-width="1.5" />
</svg>
</button>
- Available variants include
aria-checked,aria-current,aria-invalid, and more. - Enhances accessibility while keeping component logic purely declarative.
12. box-decoration-slice vs box-decoration-clone
box-decoration-slice and box-decoration-clone control how borders, backgrounds, and other decorations behave when inline elements wrap. Use them to create highlighter effects that stay continuous or restart on each line of text.
<span class="box-decoration-clone bg-amber-200 px-2 text-base-900">
Inline highlight that restarts on each line break
</span>
<span class="box-decoration-slice bg-emerald-200 px-2 text-base-900">
Continuous ribbon highlight no matter the wrapping
</span>
- Perfect for callouts or “ticket stub” UI where your content spans multiple lines.
- Avoids custom pseudo-elements or extra markup just to keep backgrounds aligned.
13. Multi-column utilities with columns-*
Tailwind exposes the CSS Multi-Column spec through columns-*. These helpers are ideal for longform content that needs a magazine layout.
<article class="columns-3 gap-10">
<p class="text-balance text-pretty text-lg">
Tailwind CSS lets you pour content into multiple columns without extra containers or grid hacks.
</p>
</article>
- Use
columns-2,columns-3, etc. for column counts orcolumns-[30ch]for fixed column widths. - Combine with
break-inside-avoidto keep cards or callouts from splitting between columns.
14. Break utilities keep components intact
break-before-*, break-after-*, and break-inside-* govern where columns or printed pages split. They are invaluable for multi-column layouts, PDFs, and print stylesheets.
<div class="columns-2 gap-8">
<article class="break-inside-avoid rounded-xl border border-base-200 bg-white/80 p-6">
<h3 class="text-lg font-semibold">Keep cards together</h3>
<p class="text-sm text-base-600">Use `break-inside-avoid-column` to stop awkward splits.</p>
</article>
</div>
break-after-pageforces page breaks for print templates or exported PDFs.break-before-columncan push a hero section to start a fresh column.
15. overscroll-* tames scroll chaining
overscroll-behavior utilities stop the rubber-band effect and scroll chaining that leak gestures to parent containers.
<div class="overscroll-contain h-96 overflow-y-auto rounded-2xl border border-base-200">
<div class="space-y-6 p-8">
<h2 class="text-xl font-semibold">Scrollable modal</h2>
<p class="text-sm text-base-600">Use `overscroll-none` to hard stop, or `overscroll-contain` to keep the bounce inside.</p>
</div>
</div>
- Ideal for drawers, maps, and modals so users do not accidentally scroll the page behind them.
- Pair with
scroll-smoothfor polished anchor jumping inside the container.
16. Less common display & visibility helpers
Utilities like list-item, visible, invisible, and collapse solve niche layout bugs without custom CSS.
<div class="flex items-start gap-4">
<span class="list-item list-inside pl-4 text-sm text-base-500">Custom bullet text</span>
<span class="invisible w-6">•</span>
<span class="visible text-sm text-base-500">Secondary copy stays aligned.</span>
</div>
invisiblekeeps elements in the flow while hiding them visually—great for maintaining layout rhythm.collapsetargets table rows/columns to free up space when data is conditionally hidden.
17. appearance-none for fully custom form controls
Strip away native UI chrome from inputs, selects, and buttons with appearance-none. Follow up with your own Tailwind utilities for total control.
<select
class="appearance-none w-full rounded-xl border border-base-200 bg-white px-4 py-3 text-sm shadow-sm focus:border-indigo-400 focus:outline-none focus:ring-4 focus:ring-indigo-500/20"
>
<option>Starter plan</option>
<option>Growth plan</option>
</select>
- Use
appearance-autoto opt a control back into the platform default. - Combine with
bg-noneand custom icons for dropdown arrows or select chevrons.
18. Color scheme control with scheme-*
scheme-light, scheme-dark, and scheme-light-dark hint to the browser which color scheme to use for built-in form controls and scrollbars.
<form class="scheme-dark space-y-4 rounded-2xl border border-base-200 bg-base-950/70 p-6">
<label class="block text-sm text-base-300">Choose a date</label>
<input type="date" class="w-full rounded-lg bg-base-900 px-4 py-3 text-base-100" />
</form>
- Ensures native pickers do not clash with your dark mode palette.
scheme-light-darkallows controls to adapt when the OS toggles between themes.
19. pointer-events-* for interaction locks
Disable or re-enable pointer interactions with a single class instead of JavaScript conditionals.
<button
class="pointer-events-none inline-flex items-center gap-2 rounded-full bg-base-200 px-6 py-3 text-base-500"
>
Processing…
</button>
- Add
pointer-events-autoback when the async task resolves. - Works for overlays or tooltips that should absorb clicks without blocking the UI underneath.
20. User select helpers: select-none, select-text, select-all
Control how users highlight content on a per-element basis.
<div class="rounded-xl border border-base-200 p-4">
<span class="select-all block text-sm text-base-500">https://example/assets/template.zip</span>
<span class="select-none text-xs uppercase tracking-wide text-base-400">Drag handles stay unselectable</span>
</div>
- Use
select-nonefor draggable UI pieces or buttons. select-allshines in copy-to-clipboard inputs—one click highlights everything.
21. resize-* keeps textareas tidy
resize-none, resize-x, resize-y, and resize give you fine-grained control over how users resize elements.
<textarea
class="resize-none w-full rounded-xl border border-base-200 bg-white p-4 text-sm"
rows="4"
placeholder="Leave a note"
></textarea>
- Prevents layout-breaking horizontal resizing in complex forms.
- Allow vertical-only resizing with
resize-yto respect long feedback submissions.
22. scroll-smooth for effortless anchor navigation
Enable native smooth scrolling without JavaScript.
<div class="scroll-smooth">
<a class="text-sm font-medium text-indigo-500" href="#pricing">Jump to pricing</a>
</div>
- Apply to the
htmlelement or targeted containers depending on your layout. - Combine with
scroll-pt-*offsets to keep headings polished.
23. Touch action utilities lock gestures
Tailwind exposes touch-action via utilities like touch-pan-y, touch-pan-x, and touch-none so you can fine-tune mobile interactions.
<div class="touch-pan-y snap-y snap-mandatory overflow-y-scroll">
<section class="snap-start h-screen bg-base-900 text-white">Slide 1</section>
<section class="snap-start h-screen bg-indigo-900 text-white">Slide 2</section>
</div>
- Prevent horizontal scroll on carousels with
touch-pan-y. - Disable pinch-zoom or pan gestures during ink signatures with
touch-none.
24. Cursor utilities beyond cursor-pointer
Tailwind ships a full cursor palette for nuanced affordances.
<div class="flex gap-6 text-sm text-base-500">
<button class="cursor-wait rounded-full bg-base-200 px-4 py-2">Processing</button>
<button class="cursor-not-allowed rounded-full bg-base-200 px-4 py-2">Disabled</button>
<button class="cursor-none rounded-full bg-base-200 px-4 py-2">Presentation mode</button>
</div>
cursor-progress,cursor-zoom-in, and more are available for specialized UI states.- Use
group-hover:cursor-pointerto communicate interactivity only on hover.
25. Screen reader helpers: sr-only and not-sr-only
sr-only visually hides content while leaving it accessible. Combine with not-sr-only to reveal the same element at specific breakpoints.
<a href="#content" class="sr-only focus:not-sr-only focus:fixed focus:top-4 focus:left-4 focus:rounded-full focus:bg-indigo-600 focus:px-4 focus:py-2 focus:text-white">
Skip to content
</a>
- Essential for skip links, icon-only buttons, and extra instructions.
not-sr-onlylets you reveal hidden text on larger screens or focus states.
26. forced-color-adjust-none preserves contrast-sensitive UI
High-contrast modes can wash out icons or gradients. Use forced-color-adjust-none to opt specific components out of OS-enforced palettes.
<div class="forced-color-adjust-none inline-flex items-center gap-2 rounded-full bg-gradient-to-r from-emerald-500 to-cyan-500 px-4 py-2 text-white">
<svg class="size-4" viewBox="0 0 24 24" fill="none">
<path d="M5 12h14" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
</svg>
Live status
</div>
- Prevents OS overrides from making key UI elements invisible.
- Pair with accessible text alternatives to keep compliance high.
27. CSS filter utilities for instant effects
Tailwind’s filter suite (e.g., blur, grayscale, hue-rotate, invert, saturate) unlocks art direction without leaving HTML.
<figure class="filter hover:grayscale-0 grayscale flex items-center gap-4 rounded-3xl bg-base-900/80 p-6 text-white">
<img class="size-16 rounded-full object-cover" src="/team/alex.jpg" alt="Alex" />
<figcaption>
<p class="text-lg font-semibold">Alex Rivera</p>
<p class="text-sm text-white/70">Hover to reveal full-color portrait.</p>
</figcaption>
</figure>
- Combine multiple filters with
filterand disable them withfilter-none. - Tailor hover states without writing custom CSS selectors.
28. Backdrop filters create frosted-glass UI
backdrop-blur, backdrop-brightness, backdrop-grayscale, and more apply effects to whatever sits behind your element.
<div class="backdrop-blur-xl backdrop-brightness-125 supports-[backdrop-filter]:bg-white/30">
<div class="rounded-3xl border border-white/20 p-8">
<h2 class="text-2xl font-semibold text-base-900">Frosted panel</h2>
<p class="text-sm text-base-600">Transforms modals and sticky headers into premium glassmorphism.</p>
</div>
</div>
- Use
supports-[backdrop-filter]:to guard against older browsers gracefully. - Layer multiple backdrop utilities for fine-tuned glow effects.
29. Blend mode utilities add depth
mix-blend-mode and background-blend-mode utilities let you stack visuals like a designer.
<div class="relative isolate">
<img src="/hero/founders.jpg" alt="Founders" class="absolute inset-0 h-full w-full object-cover" />
<div class="absolute inset-0 mix-blend-multiply bg-gradient-to-tr from-indigo-600 via-purple-500 to-rose-500 opacity-80"></div>
<div class="relative z-10 p-16 text-white">
<h1 class="text-4xl font-semibold">Launch with confidence</h1>
</div>
</div>
mix-blend-difference,mix-blend-screen, andbg-blend-overlayunlock editorial imagery without Photoshop.- Combine with
isolateto contain blending inside a component.
30. Masking utilities sculpt complex shapes
Tailwind’s masking classes (mask-image, mask-repeat, mask-clip, etc.) deliver experimental art direction straight from HTML.
<div class="mask-[url('/blog/starburst.svg')] mask-repeat-no-repeat mask-size-contain bg-gradient-to-br from-sky-500 to-indigo-600 p-16 text-center text-2xl font-semibold text-white">
Spotlight announcement
</div>
- Build spotlight reveals, patterned cards, or avatar frames without editing assets.
mask-border,mask-padding, and arbitrary values give you fine control over the clipping region.- Combine them with presets like
mask-radial-from-transparentto fade edges without wrapper elements.
31. text-shadow returns with configurable presets
Tailwind v4 includes first-party text shadow utilities such as text-shadow-sm, text-shadow, and text-shadow-lg.
<h2 class="text-shadow-lg text-4xl font-semibold text-white">
Neon headline without custom CSS
</h2>
- Craft glows, embossed titles, or depth on hero sections.
- Use arbitrary values like
text-shadow-[0_2px_6px_rgba(15,23,42,0.35)]for precision, or stack color tokens such astext-shadow-indigo-500/60for tinted halos.
32. SVG helpers: fill-* and stroke-*
Inline SVG icons become theme-aware with Tailwind’s fill and stroke utilities.
<svg class="size-10 stroke-2 stroke-indigo-500 fill-none" viewBox="0 0 24 24">
<circle cx="12" cy="12" r="9" />
<path d="M9 12l2 2 4-4" />
</svg>
- Toggle icon states with
group-hover:stroke-whiteorpeer-checked:fill-indigo-500. - Works on inline SVG fragments, so you can ship a single icon component across themes.
33. @container variants make components self-responsive
Tailwind v4 treats container queries as first-class citizens. Register a parent with @container, then use @sm:, @lg:, or @max-md: variants on descendants to respond to that container instead of the viewport.
<article class="@container max-w-3xl rounded-3xl border border-base-200 p-8">
<div class="grid gap-6 @sm:grid-cols-2 @lg:grid-cols-[1fr_1.4fr]">
<div class="space-y-3">
<h3 class="text-lg font-semibold">Container-aware layout</h3>
<p class="text-sm text-base-600">Cards that resize seamlessly even inside sidebars.</p>
</div>
<img class="aspect-video rounded-2xl object-cover" src="/blog/container-card.jpg" alt="Container query preview" />
</div>
</article>
- Scopes responsive tweaks to individual components for truly modular design systems.
- Replaces ad-hoc breakpoint overrides that used to live in custom CSS or plugins.
34. size-* sets width and height in one step
size-* utilities apply identical width and height using Tailwind’s spacing scale or arbitrary values—ideal for square avatars, icon buttons, and placeholders.
<div class="flex items-center gap-4">
<span class="size-14 rounded-2xl bg-base-200"></span>
<button class="size-12 inline-flex items-center justify-center rounded-full bg-indigo-500 text-white">
<svg class="size-5" viewBox="0 0 20 20" fill="none">
<path d="M5 10h10" stroke="currentColor" stroke-width="1.5" />
<path d="M10 5v10" stroke="currentColor" stroke-width="1.5" />
</svg>
</button>
</div>
- Keeps markup tidy by replacing paired
w-*andh-*classes with a single utility. - Helps maintain consistent sizing for badges, chips, and interactive controls.
35. items-baseline-last aligns card footers perfectly
items-baseline-last and self-baseline-last align the bottom-most text line across flex or grid children so mismatched copy lengths don’t knock buttons out of alignment.
<section class="grid gap-6 md:grid-cols-3 items-baseline-last">
<article class="space-y-3 rounded-2xl border border-base-200 p-6">
<h4 class="text-lg font-semibold">Short copy</h4>
<p class="text-sm text-base-500">A concise summary.</p>
<a class="text-sm font-medium text-indigo-500" href="#">Explore</a>
</article>
<article class="space-y-3 rounded-2xl border border-base-200 p-6">
<h4 class="text-lg font-semibold">Deeper dive</h4>
<p class="text-sm text-base-500">Longer copy that wraps to two lines keeps the buttons aligned.</p>
<a class="text-sm font-medium text-indigo-500" href="#">Explore</a>
</article>
</section>
- Keeps call-to-action rows level in pricing tables, feature grids, and testimonial cards.
- Prevents designers from adding spacer divs or flex hacks just to align buttons.
36. Safe alignment utilities prevent clipped content
justify-center-safe, items-center-safe, and friends use the CSS safe keyword to center content until it risks overflow, then fall back to start alignment.
<ul class="flex flex-wrap gap-4 justify-center-safe">
<li class="rounded-full bg-base-900 px-5 py-2 text-sm text-white">Overview</li>
<li class="rounded-full bg-base-900 px-5 py-2 text-sm text-white">Integrations</li>
<li class="rounded-full bg-base-900 px-5 py-2 text-sm text-white">Roadmap</li>
</ul>
- Ensures carousel slides or nav pills stay visible even when the container shrinks.
- Eliminates the need for breakpoint-specific overrides to avoid clipped edges.
37. font-stretch-* unlocks variable font width axes
Tailwind v4 surfaces font-stretch so you can subtly condense or expand typography without swapping typefaces—as long as the font exposes a width axis.
<p class="text-xl font-semibold font-stretch-125% tracking-tight">
Wider glyphs for dramatic hero copy.
</p>
- Refines headings, nav labels, or badges that need to flex inside tight layouts.
- Creates nuanced emphasis states in design systems that rely on variable fonts.
38. hyphens-auto keeps narrow columns readable
hyphens-auto hands long-word hyphenation over to the browser using the element’s language metadata.
<p class="columns-2 hyphens-auto text-balance text-base-600">
Internationalization-heavy content benefits from smart hyphenation without manual soft hyphen characters.
</p>
- Prevents overflow and ragged edges in magazine layouts or mobile-first articles.
- Supports multi-lingual locales when paired with
langattributes on the element.
39. Colored drop-shadow-* utilities add branded glow
Tailwind’s drop-shadow filters now accept palette colors and opacity modifiers so shadows can match your brand accents.
<button class="rounded-full bg-base-900 px-6 py-3 text-white drop-shadow-lg drop-shadow-emerald-400/60">
Neon CTA
</button>
- Delivers neon glows, colored outlines, or tinted depth without custom CSS.
- Lets you stack multiple shadows for richer hover and active states.
40. inset-shadow-* layers inner depth effortlessly
inset-shadow-* and inset-ring-* stack with outer shadows to create sophisticated lighting effects for cards and controls.
<div class="rounded-3xl bg-base-950 p-6 shadow-xl inset-shadow-sm inset-shadow-sky-500/40">
<h3 class="text-xl font-semibold text-white">Control center</h3>
<p class="text-sm text-white/70">Combine outer elevation with subtle inner glow states.</p>
</div>
- Enables neumorphic presses, inner glows, and focus rings without hand-authored CSS.
- Uses CSS variables under the hood so multiple layers compose cleanly.
41. 3D transform helpers bring interfaces to life
Perspective utilities (perspective-sm, perspective-distant) pair with 3D transforms like rotate-x-*, rotate-y-*, and tranbase-z-* for immersive interactions.
<div class="perspective-normal">
<div class="transition duration-500 rotate-y-12 hover:rotate-y-0 preserve-3d rounded-3xl border border-base-200 bg-white p-10">
<h3 class="text-xl font-semibold text-base-900">3D product card</h3>
<p class="text-sm text-base-500">Hover to bring it front and center.</p>
</div>
</div>
- Powers card flips, gallery rotations, and layered hero effects with zero custom keyframes.
- Reduces reliance on heavy animation libraries for modest depth treatments.
42. field-sizing-content builds auto-growing inputs
Leverage the new CSS field-sizing property so inputs, selects, and textareas expand to fit their content.
<label class="flex max-w-md items-center gap-3 rounded-2xl border border-base-200 p-4">
<span class="text-sm font-medium text-base-500">Tags</span>
<input
class="field-sizing-content min-w-[10ch] flex-1 rounded-lg border-0 bg-transparent text-sm focus:outline-none"
placeholder="Add label"
value="Design systems"
/>
</label>
- Removes the need for MutationObservers or textarea autoresize scripts in chat-style inputs.
- Plays nicely with Tailwind spacing utilities for polished inline forms.
43. user-invalid: and user-valid: delay validation styling
These variants map to the :user-invalid and :user-valid pseudo-classes, styling form fields only after interaction rather than on initial render.
<input
required
type="email"
class="w-full rounded-xl border border-base-200 px-4 py-3 transition user-invalid:border-rose-500 user-invalid:ring-4 user-invalid:ring-rose-500/20 user-valid:border-emerald-500 user-valid:ring-4 user-valid:ring-emerald-500/20"
placeholder="you@example.com"
/>
- Prevents “error-on-page-load” UX for required fields.
- Helps you deliver balanced feedback loops for inline validation.
44. inverted-colors: keeps high-contrast modes tidy
Target OS-level inverted color schemes to fine-tune shadows, gradients, and blend modes for accessibility.
<div class="rounded-3xl border border-base-200 bg-white p-6 shadow-xl inverted-colors:shadow-none">
<h3 class="text-lg font-semibold text-base-900">High-contrast safe card</h3>
</div>
- Stops forced color modes from turning soft shadows into glaring halos.
- Lets you keep ornamental effects without sacrificing legibility in accessibility tooling.
45. noscript: variant reveals graceful fallbacks
noscript: hooks into @media (scripting: none) so you can surface alternate content when JavaScript is disabled.
<div class="hidden noscript:flex items-center gap-2 rounded-xl border border-amber-400 bg-amber-50 p-4 text-sm text-amber-700">
<svg class="size-4" viewBox="0 0 20 20" fill="none">
<path d="M10 4v6" stroke="currentColor" stroke-width="1.5" />
<circle cx="10" cy="14" r="1" fill="currentColor" />
</svg>
Enable JavaScript for interactive dashboards.
</div>
- Provides progressive enhancement messaging without separate
<noscript>markup. - Aids SEO and accessibility by clarifying when critical features require scripting.
46. Pointer precision media queries tailor tap targets
Variants like pointer-coarse: and pointer-fine: adapt spacing based on the user’s input device, not their viewport size.
<button class="rounded-full bg-indigo-600 px-4 py-2 text-sm text-white pointer-coarse:px-6 pointer-coarse:py-3">
Touch-friendly action
</button>
- Ensures hit areas meet WCAG touch guidelines on 2-in-1s and phones alike.
- Avoids guesswork when laptops ship with both touch and pointer inputs.
47. hover:not-active: differentiates interaction states
Tailwind’s not- modifier lets you express “hover when not active” or similar negated combinations directly in utilities.
<button class="rounded-xl bg-base-900 px-6 py-3 text-white transition hover:bg-base-800 hover:not-active:bg-base-700 active:bg-base-950">
Stateful button
</button>
- Keeps hover and active styling distinct without writing custom selectors.
- Simplifies complex button states, toggles, and press animations.
48. in- variants respond to ancestor state without group
in- variants rely on the CSS :has() selector to react to ancestor hover, focus, or other states while keeping markup free of helper classes.
<div class="rounded-2xl border border-base-200 p-6 hover:bg-base-50">
<h4 class="text-base font-semibold text-base-900 in-hover:underline">Hovering the card underlines this text.</h4>
</div>
- Propagates card hover effects to deeply nested children with no extra wrappers.
- Encourages semantic HTML because the parent no longer needs a
.groupclass.
49. group-has-[...] styles parents based on active descendants
group-has variants use :has() to detect matching children, allowing parent styling when a nested element toggles state or attributes.
<ul class="group space-y-2 rounded-2xl border border-base-200 p-4">
<li data-active class="rounded-lg bg-indigo-50 px-3 py-2 text-sm font-medium text-indigo-600">Docs</li>
<li class="rounded-lg px-3 py-2 text-sm text-base-500 group-has-[&_[data-active]]:font-semibold group-has-[&_[data-active]]:text-base-900">
Tutorials
</li>
</ul>
- Highlights menu labels, breadcrumb parents, or list headers when descendants change state.
- Eliminates JavaScript event listeners whose only job was toggling parent classes.
50. starting: delivers zero-JS entry animations
The starting: variant maps to @starting-style, defining the initial keyframe for elements as they enter the DOM.
<div class="tranbase-y-4 opacity-0 starting:tranbase-y-0 starting:opacity-100 transition-all duration-700">
Fade-and-slide intro
</div>
- Creates fade-ins, slides, and transforms that play once without IntersectionObserver glue code.
- Works brilliantly for modal mounts, hero copy, and section reveals.
51. details-content: styles the expandable region in <details>
details-content: targets the autogenerated wrapper around <details> disclosure content so you can pad it, animate it, or tweak typography without extra markup.
<details class="rounded-2xl border border-base-200 p-4 details-content:animate-fade details-content:pt-3">
<summary class="cursor-pointer text-sm font-semibold text-base-900">What happens to my data?</summary>
<div class="text-sm text-base-600">
Your preferences stay in your workspace and never touch third-party APIs.
</div>
</details>
- Brings the native
<details>element up to modern UX expectations without custom components. - Keeps disclosure patterns accessible while still feeling intentionally designed.
Tailwind CSS hidden utilities cheat sheet
| Utility | Problem it solves | Quick win |
|---|---|---|
@container | Component-level responsiveness | Cards that adapt inside any layout |
size-16 | Match width and height instantly | Icon buttons without double utilities |
items-baseline-last | Align variable-height cards | Keep CTA rows perfectly level |
justify-center-safe | Center content without clipping | Navigation pills that never overflow |
box-decoration-clone | Control inline highlights across line breaks | Ticket-style ribbons that wrap cleanly |
columns-3 | Flow content into multiple columns | Magazine layouts without extra markup |
break-inside-avoid | Prevent cards splitting across columns | Preserve card integrity in multi-column layouts |
overscroll-contain | Stop scroll chaining | Polished modals and maps on mobile |
scroll-pt-24 | Offset anchor navigation | Sticky headers no longer hide titles |
font-stretch-125% | Widen or condense variable fonts | Responsive headings without swapping typefaces |
hyphens-auto | Improve legibility in narrow columns | Automatic hyphenation for multilingual copy |
drop-shadow-emerald-400/60 | Brand-colored glows | Neon CTA shadows in one class |
inset-shadow-sm | Layer inner depth with outer shadows | Neumorphic toggles without custom CSS |
mask-radial-* | Fade edges and spotlight content | Gradient-masked hero imagery |
field-sizing-content | Auto-resize inputs and textareas | Chat composer that grows with input |
user-invalid: | Delay validation styling until interaction | No more red borders on initial load |
inverted-colors: | Handle forced color inversion | Remove shadows that invert badly |
pointer-coarse: | Optimize tap targets for touch | Bigger padding on phones without breakpoints |
hover:not-active: | Style the absence of a state | Hover styles that differ from active clicks |
in-hover: | React to ancestor states without group | Deep child styling on hovered cards |
group-has-[...] | Detect active descendants | Bold the menu label when a child is active |
starting: | Animate first paint without JS | Fade-in hero copy using pure CSS |
details-content: | Style the content area of <details> | Animated FAQ answers with zero extra markup |
Leaning on these hidden Tailwind CSS helpers keeps your design system relevant, performant, and easier to maintain. Sprinkle a couple of them into your next release, document the patterns in your UI library, and you’ll instantly stand out from teams still fighting their cascading style sheets.
/Michael Andreuzza