tailwind-css-patterns
Skill1 starsChanged 9 days agoMITView on GitHub
Provides comprehensive Tailwind CSS utility-first styling patterns including responsive design, layout utilities, flexbox, grid, spacing, typography, colors, and modern CSS best practices. Use when styling React/Vue/Svelte components, building responsive layouts, implementing design systems, or optimizing CSS workflow.
14 other projects use a version of this, 6 of them edited.
Adopted by
Most recently taken up by
- figueroaignacio/ignaciofigueroa.devedited, first seen Nov 8, 2026
- ever-co/ever-worksedited, first seen Nov 8, 2026
- ever-works/ever-worksedited, first seen Nov 5, 2026
- Mane087/IA-Skillsedited, first seen Nov 1, 2026
- gnjohnny/Maps2Chatword for word, first seen Oct 13, 2026
- dalerodr/play-makerword for word, first seen Oct 11, 2026
Used with
Projects with it also use tailwind-v4-shadcn, two-factor-authentication-best-practices and 9 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.
nicepkgSkilltailwind-v4-shadcn
Production-tested setup for Tailwind CSS v4 with shadcn/ui, Vite, and React.
Also in 5 projects that use this
lukevellaSkilltwo-factor-authentication-best-practices
This skill provides guidance and enforcement rules for implementing secure two-factor authentication (2FA) using Better Auth's twoFactor plugin.
Also in 3 projects that use this
lukevellaSkillemail-and-password-best-practices
This skill provides guidance and enforcement rules for implementing secure email and password authentication using Better Auth.
Also in 3 projects that use this
currents-devSkillplaywright-best-practices
Use when writing Playwright tests, fixing flaky tests, debugging failures, implementing Page Object Model, configuring CI/CD, optimizing performance, mocking APIs, handling authentication or OAuth, testing accessibility (axe-core), file uploads/downloads, date/time mocking, WebSockets, geolocation, permissions, multi-tab/popup flows, mobile/responsive layouts, touch gestures, GraphQL, error handling, offline mode, multi-user collaboration, third-party services (payments, email verification), console error monitoring, global setup/teardown, test annotations (skip, fixme, slow), test tags (@smoke, @fast, @critical, filtering with --grep), project dependencies, security testing (XSS, CSRF, auth), performance budgets (Web Vitals, Lighthouse), iframes, component testing, canvas/WebGL, service workers/PWA, test coverage, i18n/localization, Electron apps, or browser extension testing. Covers E2E, component, API, visual, accessibility, security, Electron, and extension testing.
Also in 3 projects that use this
JetBrainsSkillvitest
Vitest fast unit testing framework powered by Vite with Jest-compatible API. Use when writing tests, mocking, configuring coverage, or working with test filtering and fixtures.
Also in 4 projects that use this
DatabricksSkilldeploy-to-vercel
Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".
Also in 4 projects that use this
- +1 more from lukevella
Other versions14 projects use a version of this.
Word for word · 8
- midudev/preguntas-entrevista-react★ 7.8k100% same
- modelscope/ms-agent★ 4.4k100% same
- midudev/la-velada-web-oficial★ 1.9k100% same
- midudev/tailwind-animations★ 1.5k100% same
- itsyasirkhandev/spec-driven-development★ 1100% same
- moisesvalero/my-sveltekit-starter★ 1100% same
- dalerodr/play-maker★ 0100% same
- gnjohnny/Maps2Chat★ 0100% same
Edited · 6
- legions-developer/evilcharts★ 3.2k85% same
- legions-developer/invoicely★ 92389% same
- ever-co/ever-works★ 190100% same
- ever-works/ever-works★ 190100% same
- figueroaignacio/ignaciofigueroa.dev★ 7100% same
- Mane087/IA-Skills★ 498% same
Wrote their own version · 0
None found.
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.
- agents.mdAGENTS.md
- skills/vercel-composition-patterns/AGENTS.mdAGENTS.md
- skills/vercel-react-best-practices/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- accessibilitySkill
- autoskillsSkill
- compliance-checkerSkill
- contract-writerSkill
- django-expertSkill
- django-patternsSkill
- django-securitySkill
- django-tddSkill
- django-verificationSkill
- env-shielding-auditorSkill
- frontend-designSkill
- graphifySkill
- js-standardizerSkill
- mass-standardizerSkill
- mcp-registrySkill
- nodejs-backend-patternsSkill
- nodejs-best-practicesSkill
- omni-context-minimizerSkill
- python-quality-auditorSkill
- readme-standardizerSkill
- seoSkill
- skill-creatorSkill
- skilloptSkill
- skills-samplesSkill
- slash-commanderSkill
- sprint-architectSkill
- token-saver-auditorSkill
- topology-monitorSkill
- topology-scaffolderSkill
- typescript-advanced-typesSkill
- vercel-composition-patternsSkill
- vercel-react-best-practicesSkill
- viteSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. 9 are common, 0 are distinctive, and 9 are very specific to this project.
9
Common
Most of the 6 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 57
Start Mobile-First: Write base styles for mobile, add responsive prefixes (sm:, md:, lg:) for larger screens
- Common: line 60
Extract Components: Create reusable component classes for repeated patterns
- Common: line 62
Verify Changes: Test at each breakpoint using DevTools responsive mode.
- Common: line 103
Consistent Spacing: Use Tailwind's spacing scale (4, 8, 12, 16, etc.)
- Very specific: line 106
Utility Composition: Prefer utility classes over @apply for maintainability
- Common: line 107
Semantic HTML: Use proper HTML elements with Tailwind classes
- Common: line 108
Performance: Ensure content paths include all template files for optimal purging
- Very specific: line 114
Check content paths: Ensure all template files are included in content: [] in config
- Very specific: line 115
Verify build: Run npm run build to regenerate purged CSS
- Very specific: line 116
Dev mode: Use npx tailwindcss -o with --watch flag for live updates
- Common: line 120
Check breakpoint values: Verify breakpoints match your design requirements
- Common: line 121
DevTools: Use browser DevTools responsive mode to test at each breakpoint
- Very specific: line 124
Verify config: Ensure darkMode: 'class' or 'media' is set correctly
- Very specific: line 125
Toggle implementation: Use document.documentElement.classList.toggle('dark') for class strategy
- Very specific: line 126
Initial flash: Add dark class to <html> before body renders
- Common: line 132
Arbitrary Values: Use sparingly; prefer design tokens for consistency
- Very specific: line 133
Specificity Issues: Avoid @apply with complex selectors
- Common: line 135
Browser Support: Check Tailwind docs for compatibility notes
“Common” is measured: kept by at least 6 in 10 of the 6 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 CSS Development Patterns
Expert guide for building modern, responsive user interfaces with Tailwind CSS utility-first framework. Covers v4.1+ features including CSS-first configuration, custom utilities, and enhanced developer experience.
Overview
Provides actionable patterns for responsive, accessible UIs with Tailwind CSS v4.1+. Covers utility composition, dark mode, component patterns, and performance optimization.
When to Use
- Styling React/Vue/Svelte components
- Building responsive layouts and grids
- Implementing design systems
- Adding dark mode support
- Optimizing CSS workflow
Quick Reference
Responsive Breakpoints
| Prefix | Min Width | Description |
sm: | 640px | Small screens |
md: | 768px | Tablets |
lg: | 1024px | Desktops |
xl: | 1280px | Large screens |
2xl: | 1536px | Extra large |
Common Patterns
<!-- Center content -->
<div class="flex items-center justify-center min-h-screen">
Content
</div>
<!-- Responsive grid -->
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
<!-- Items -->
</div>
<!-- Card component -->
<div class="bg-white rounded-lg shadow-lg p-6">
<h3 class="text-xl font-bold">Title</h3>
<p class="text-gray-600">Description</p>
</div>Instructions
- Start Mobile-First: Write base styles for mobile, add responsive prefixes (
sm:,md:,lg:) for larger screens - Use Design Tokens: Leverage Tailwind's spacing, color, and typography scales
- Compose Utilities: Combine multiple utilities for complex styles
- Extract Components: Create reusable component classes for repeated patterns
- Configure Theme: Customize design tokens in
tailwind.config.jsor using@theme - Verify Changes: Test at each breakpoint using DevTools responsive mode. Check for visual regressions and accessibility issues before committing.
Examples
Responsive Card Component
function ProductCard({ product }: { product: Product }) {
return (
<div className="bg-white rounded-lg shadow-lg overflow-hidden sm:flex">
<img className="h-48 w-full object-cover sm:h-auto sm:w-48" src={product.image} />
<div className="p-6">
<h3 className="text-lg font-semibold">{product.name}</h3>
<button className="mt-4 px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700">
Add to Cart
</button>
</div>
</div>
);
}Dark Mode Toggle
<div class="bg-white dark:bg-gray-900 text-gray-900 dark:text-white">
<h1 class="dark:text-white">Title</h1>
</div>Form Input
<input
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"
placeholder="you@example.com"
/>Best Practices
- Consistent Spacing: Use Tailwind's spacing scale (4, 8, 12, 16, etc.)
- Color Palette: Stick to Tailwind's color system for consistency
- Component Extraction: Extract repeated patterns into reusable components
- Utility Composition: Prefer utility classes over
@applyfor maintainability - Semantic HTML: Use proper HTML elements with Tailwind classes
- Performance: Ensure content paths include all template files for optimal purging
- Accessibility: Include focus styles, ARIA labels, and respect user preferences (reduced-motion)
Troubleshooting
Classes Not Applying
- Check content paths: Ensure all template files are included in
content: []in config - Verify build: Run
npm run buildto regenerate purged CSS - Dev mode: Use
npx tailwindcss -owith--watchflag for live updates
Responsive Styles Not Working
- Order matters: Responsive prefixes must come before non-responsive (e.g.,
md:flexnotflex md:flex) - Check breakpoint values: Verify breakpoints match your design requirements
- DevTools: Use browser DevTools responsive mode to test at each breakpoint
Dark Mode Issues
- Verify config: Ensure
darkMode: 'class'or'media'is set correctly - Toggle implementation: Use
document.documentElement.classList.toggle('dark')for class strategy - Initial flash: Add
darkclass to<html>before body renders
Constraints and Warnings
- Class Proliferation: Long class strings reduce readability; extract into components
- Content Paths: Misconfigured paths cause classes to be purged in production
- Arbitrary Values: Use sparingly; prefer design tokens for consistency
- Specificity Issues: Avoid
@applywith complex selectors - Dark Mode: Requires correct configuration (
classormediastrategy) - Browser Support: Check Tailwind docs for compatibility notes
References
- references/layout-patterns.md — Flexbox, grid, spacing, typography, colors
- references/component-patterns.md — Cards, navigation, forms, modals, React patterns
- references/responsive-design.md — Responsive patterns, dark mode, container queries
- references/animations.md — Transitions, transforms, built-in animations, motion preferences
- references/performance.md — Bundle optimization, CSS optimization, production builds
- references/accessibility.md — Focus management, screen readers, color contrast, ARIA
- references/configuration.md — CSS-first config, JavaScript config, plugins, presets
- references/reference.md — Additional reference materials
External Resources
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.

