tailwind-css-v4
Skill0 starsChanged 3 months agoMITView on GitHub
Tailwind CSS v4 setup and patterns: @theme tokens, dark mode, responsive layouts, sr-only utilities, print styles, and prefers-reduced-motion. Use when styling React/Next.js apps with Tailwind v4 or migrating from v3 config.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- joe-bell/cvatheir own version, first seen Oct 8, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- joe-bell/cva★ 6.9ksame name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository23 other files it gives its agents.
- client-document-exportSkill
- cloudflare-turnstile-nextjsSkill
- ga4-analytics-nextjsSkill
- git-repo-privacy-auditSkill
- hardened-contact-form-nextjsSkill
- html-semantic-markupSkill
- multi-step-wizard-flowSkill
- nextjs-api-routesSkill
- nextjs-app-routerSkill
- nextjs-seo-metadataSkill
- nextjs-ui-foundationSkill
- next-themes-dark-modeSkill
- playwright-e2e-testingSkill
- react-components-patternsSkill
- react-hooks-patternsSkill
- recharts-dashboardSkill
- resend-email-nextjsSkill
- server-pdf-playwrightSkill
- shadcn-ui-setupSkill
- specialized-form-inputsSkill
- vitest-unit-testingSkill
- web-accessibility-wcagSkill
- zustand-persist-stateSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 35
Use in components: bg-brand-900, text-accent-400, font-sans.
- Very specific: line 61
Use dark: variants: dark:bg-brand-900 dark:text-slate-100.
- Distinctive: line 103
Always merge conditional classes:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Tailwind CSS v4
Setup (Next.js)
/* app/globals.css */
@import "tailwindcss";
@custom-variant dark (&:where(.dark, .dark *));PostCSS uses @tailwindcss/postcss — no separate tailwind.config.js required for tokens.
Theme tokens (@theme)
Define design system once:
@theme inline {
--color-brand-50: #f0f4f8;
--color-brand-900: #0a1929;
--color-accent-400: #e6c35c;
--font-sans: var(--font-dm-sans), system-ui, sans-serif;
}Use in components: bg-brand-900, text-accent-400, font-sans.
CSS variables for runtime theming
:root {
--background: #f8fafc;
--foreground: #0a1929;
}
.dark {
--background: #0a1929;
--foreground: #f0f4f8;
color-scheme: dark;
}Map in @theme: --color-background: var(--background).
Dark mode
Pair with next-themes — class strategy on <html>:
<html suppressHydrationWarning>Use dark: variants: dark:bg-brand-900 dark:text-slate-100.
Responsive patterns
Mobile-first breakpoints: sm:, md:, lg:.
<div className="flex flex-col gap-4 sm:flex-row lg:grid lg:grid-cols-3">Common dashboard: stack on mobile, grid on lg:.
Accessibility utilities
<span className="sr-only">Loading</span>
<a className="sr-only focus:not-sr-only focus:fixed focus:z-[100] ...">Skip to main</a>Reduced motion
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}Print styles
@media print {
@page { size: A4 landscape; margin: 0.5cm; }
.print\:hidden { /* use print:hidden in JSX */ }
}cn() helper
Always merge conditional classes:
import { clsx } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}Anti-patterns
- Arbitrary hex in every component — use
@themetokens !importanteverywhere — fix specificity with data attributes for export/print overrides- Inline
style={{}}for static values Tailwind can express - Forgetting explicit height on chart/chart-like containers
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

