tailwind-patterns
Skill2 starsChanged 7 days agoMITView on GitHub
Tailwind CSS v4 patterns for CSS-first config via the @theme directive, v3-vs-v4 deltas, variant rules, and anti-patterns. Use whenever the project contains a `tailwind.config.*`, `@import "tailwindcss"` in CSS, or a `tailwindcss` or `@tailwindcss/*` dependency, OR the user asks about Tailwind, utility classes, design tokens, or dark-mode strategy in a Tailwind project, even if Tailwind is not mentioned by name.
19 other projects use a version of this.
Adopted by
Most recently taken up by
- amanuelmamo7/Skillstheir own version, first seen Nov 7, 2026
- coco-research/cocotheir own version, first seen Nov 1, 2026
- naman10parikh/pixeltheir own version, first seen Oct 25, 2026
- sid-lakhani/agents-configtheir own version, first seen Oct 20, 2026
- xfstudio/skillstheir own version, first seen Oct 13, 2026
- xenitV1/Antigravity-Workflowstheir own version, first seen Oct 8, 2026
Used with
Projects with it also use intelligent-routing, nextjs-react-expert and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
SKB3002Skillintelligent-routing
Automatic agent selection and intelligent task routing. Analyzes user requests and automatically selects the best specialist agent(s) without requiring explicit user mentions.
Also in 5 projects that use this
SKB3002Skillnextjs-react-expert
React and Next.js performance optimization from Vercel Engineering. Use when building React components, optimizing performance, eliminating waterfalls, reducing bundle size, reviewing code for performance issues, or implementing server/client-side optimizations.
Also in 3 projects that use this
xfstudioSkillrust-pro
Master Rust 1.75+ with modern async patterns, advanced type system
Also in 5 projects that use this
xfstudioSkillcode-refactoring-tech-debt
You are a technical debt expert specializing in identifying, quantifying, and prioritizing technical debt in software projects. Analyze the codebase to uncover debt, assess its impact, and create acti
Also in 3 projects that use this
jornalistainclusivoSkilldesign-spec
How to author a DESIGN.md file — the machine-readable design-token + human-rationale format that must exist before any UI is built. YAML front-matter token schema (colors, typography, spacing, rounded, components), type system, token references, and canonical section order.
Also in 3 projects that use this
weirdgmeSkillfrontend-dev-guidelines
Frontend development guidelines for React/TypeScript applications. Modern patterns including Suspense, lazy loading, useSuspenseQuery, file organization with features directory, MUI v7 styling, TanStack Router, performance optimization, and TypeScript best practices. Use when creating components, pages, features, fetching data, styling, routing, or working with frontend code.
Also in 4 projects that use this
- +2 more from xfstudio
Other versions19 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 19
- vudovn/ag-kit★ 8.2ksame name
- vudovn/antigravity-kit★ 8.2ksame name
- coco-research/coco★ 797same name
- xenitV1/Antigravity-Workflows★ 130same name
- tranhieutt/software_development_department★ 71same name
- kumaran-is/claude-code-onboarding★ 35same name
- sabahattink/antigravity-fullstack-hq★ 30same name
- VoDaiLocz/kilo-kit-mcp★ 28same name
- xfstudio/skills★ 9same name
- SKB3002/agenthub★ 4same name
9 more not listed
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 repository37 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- templates/CLAUDE.mdCLAUDE.md
- auditSkill
- backup-patternsSkill
- bash-patternsSkill
- depsSkill
- django-patternsSkill
- docker-patternsSkill
- drf-patternsSkill
- engineering-fundamentalsSkill
- fastapi-patternsSkill
- git-patternsSkill
- go-patternsSkill
- graphql-patternsSkill
- investigateSkill
- javascript-patternsSkill
- logging-patternsSkill
- referenceSkill
- metaSkill
- monitoring-patternsSkill
- next-app-router-patternsSkill
- nuxt-patternsSkill
- opentofu-patternsSkill
- prSkill
- python-patternsSkill
- react-patternsSkill
- report-formatSkill
- security-patternsSkill
- slop-patternsSkill
- storybook-patternsSkill
- test-patternsSkill
- typescript-patternsSkill
- unslopSkill
- vps-provisioningSkill
- vue-patternsSkill
- wcag-auditSkill
- writeSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 0 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 18 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Default assumption: Tailwind v4 with CSS-first config.
- Very specific: line 34
Use oklch() for new colors.
- Very specific: line 91
If both tailwind.config.js and @import "tailwindcss" are present, the project is mid-migration.
“Common” is measured: kept by at least 6 in 10 of the 18 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Tailwind patterns
Default assumption: Tailwind v4 with CSS-first config. If the project has a tailwind.config.js it is v3 and the v3 section applies; otherwise v4.
v4 vs v3 at a glance
- v4 setup: a single
@import "tailwindcss"in the main CSS file. No@tailwind base / components / utilitiesdirectives. - v4 config: lives in CSS via the
@themedirective. Notailwind.config.js. Theme tokens become CSS custom properties automatically. - v4 content detection: automatic. The compiler scans the project for class names; you do not configure
contentpaths. - v4 plugins: still work. Container queries are built in; typography and forms remain separate
@tailwindcss/*plugins. Check before installing. - v4 build: full builds ~3.8x and incremental rebuilds 8.8x faster than v3.4;
@importbundling and vendor prefixing are built in (Lightning CSS under the hood).
Setting up v4 correctly
/* app/globals.css or equivalent */
@import "tailwindcss";
@theme {
--color-brand: oklch(0.7 0.15 250);
--font-display: "Inter", sans-serif;
--spacing-page: 4rem;
--breakpoint-3xl: 1920px;
}- Theme keys follow the pattern
--<namespace>-<name>. Namespaces:color,font,text,spacing,breakpoint,radius,shadow,animate, etc. - Defining a key generates the corresponding utility (
text-brand,font-display,p-page,3xl:). - Use
oklch()for new colors; v4's default palette is OKLCH-based for better wide-gamut support.
v3 patterns to avoid in v4
tailwind.config.js: do not create one in a v4 project. Move config into@themeblocks. If the file exists in a v4 project, it is dead code.@tailwind base; @tailwind components; @tailwind utilities;: v3 directive triple. v4 replaces these with a single@import "tailwindcss".theme.extend: v3 JS shape. In v4, all CSS-defined--<namespace>-<name>tokens extend the default theme automatically.content: [...]: v3 path config. v4 auto-detects.@layer utilities { ... }for arbitrary utility classes: still works, but prefer defining custom utilities with the@utilitydirective in v4 for better tree-shaking.
Using theme values from CSS
var(--color-brand): read a theme value in plain CSS. Every@themekey is a CSS custom property; there is no separate read function in the v4 docs.--alpha(var(--color-brand) / 50%): compute an alpha-modified color in v4. v3 used thetheme()helper, kept in v4 only for compatibility.
Variants and modifiers
- v4 variant order:
hover:focus:bg-blue-500applies hover AND focus, just like v3. No change. - New in v4:
not-variant prefix (not-hover:opacity-50)nth-*variants (nth-3:,nth-[3n+1]:); the*:direct-children variant predates v4 (3.4)- starting-style variants (
starting:opacity-0for entry animations)
- Container queries are built in:
@containeron the parent,@sm:flexetc. on children. No plugin install.
Anti-patterns to flag in review
warning: hardcoded hex colors when a theme token would work
text-[#ff0000] bypasses the design system. Use the existing token; if missing, add it to @theme.
warning: @apply chains longer than three utilities
They obscure the cascade and inhibit tree-shaking. Use a CSS class with raw properties instead, or compose at the markup level.
info: conditional @apply inside @media or selector blocks
Works, but readability falls off fast. Inline utilities or extract a component.
warning: dark: everywhere instead of a [data-theme="dark"] strategy
Inconsistent when the project already has a theme toggle. v4 supports both; pick one.
info: animate-[...] arbitrary values when a named animation exists
Define --animate-<name> in @theme and reuse it instead of repeating the arbitrary value.
warning: missing text- size on body copy
Relying on the browser default (16px) instead of setting the base size explicitly leaves typography undocumented and inconsistent across components.
Verifying which version is in use
# v4: postcss config has @tailwindcss/postcss, OR vite plugin @tailwindcss/vite
rg '@tailwindcss/(postcss|vite)' package.json
# v4 config in CSS
rg '@import "tailwindcss"' --type css
# v3 sentinel: a tailwind.config.js or .ts
fd -t f 'tailwind.config'If both tailwind.config.js and @import "tailwindcss" are present, the project is mid-migration. Treat as v4 but expect leftover v3 patterns.
References
- v4 release post: https://tailwindcss.com/blog/tailwindcss-v4
- v3-to-v4 upgrade guide: https://tailwindcss.com/docs/upgrade-guide
- v4 docs: https://tailwindcss.com/docs
Version notes
Checked: 2026-09-26 against https://tailwindcss.com/blog, https://tailwindcss.com/blog/tailwindcss-v4, https://tailwindcss.com/blog/tailwindcss-v3-4 and https://tailwindcss.com/docs/theme
- 4.3 (2026-05-08): no directive or function syntax change; no v5 exists.
- 4.0: CSS-first config (
@import "tailwindcss",@theme,@utility,--alpha()), automatic content detection,not-,nth-*, andstarting:variants (*:is 3.4; build-speed figures and the*:example corrected 2026-09-26). Theme values are read withvar(--*), not a--theme()function (corrected 2026-09-12). - 3.x:
tailwind.config.js,@tailwind base/components/utilities,theme()helper. See "v3 patterns to avoid in v4".
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.

