flpbalada/fb-skills/code-architecture-tailwind-v4-best-practices
Claude Code and agent skill by flpbalada/fb-skills
- community
Checking that the SKILL.md file is still in the repository.
Choose Tailwind CSS v4 component styling patterns. Use when building Tailwind components, buttons, cards, variants, slots, state styles, or design tokens; choosing utilities vs CVA vs tailwind-variants; avoiding @apply; or migrating v3 component patterns. For project-level Tailwind installation, PostCSS/Vite setup, @source, plugins, or browser support, use tailwind-v4-configuration instead.
Install
npx vskill@latest install flpbalada/fb-skills/code-architecture-tailwind-v4-best-practicesSKILL.md
The same SKILL.md was published earlier as flpbalada/fb-skills/code-architecture-tailwind-v4-best-practices.
Tailwind CSS v4 Best Practices
Use Tailwind utilities first. Abstract only when variants justify it.
Goal
Keep styling local, explicit, accessible, and easy to change.
Rules
- Use utility classes directly for simple components.
- Use CVA when a component has 3+ variants and needs type-safe props.
- Use tailwind-variants for slots, compound parts, or complex design systems.
- Avoid
@applyfor component styles. - Use
@themefor design tokens. - Use data attributes for component state.
- Keep one styling approach per component family.
- Preserve accessibility on interactive elements.
Tailwind v4 Setup
Decision Guide
- Pure utilities: 1-2 variants, simple component, no shared API needed.
- CVA: 3+ variants, type-safe props, button-like component.
- tailwind-variants: slots, responsive variants, component composition.
- Custom
@utility: rare project-specific utility. @apply: avoid unless project convention requires it.
Component Rules
- Keep base layout classes obvious.
- Put state in
data-*attributes when it affects styling. - Use
disabled,aria-disabled, andaria-busycorrectly. - Accept
classNameonly when extension is intended. - Merge classes with existing project helper, usually
cn. - Do not hide important design choices behind unclear helpers.
Migration Notes
shadow-smbecameshadow-xs.rounded-smbecamerounded-xs.bg-opacity-50becomesbg-black/50.bg-gradient-to-rbecomesbg-linear-to-r.bordernow usescurrentColor.ringnow usescurrentColor; use explicit ring width and color.
Flow
- Check existing component style patterns.
- Count variants and slots.
- Pick utilities, CVA, or tailwind-variants.
- Add tokens through
@themewhen needed. - Model state with attributes.
- Verify responsive behavior and accessibility.
References
Output
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/code-architecture-tailwind-v4-best-practices/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/flpbalada/fb-skills/code-architecture-tailwind-v4-best-practices)