sergiodxa avatar

Frontend Tailwind Best Practices

A solid set of opinionated Tailwind conventions that pushes you toward custom stack utilities (v-stack, h-stack) instead of raw flex classes, and enforces the cn() merge pattern for every className prop. The layout rules are the real win here, especially preferring gap over child margins and the responsive stack switching pattern. Also includes guidance on class-based dark mode, affordance patterns, and capability-based responsive design (pointer-coarse vs device sizes). It's prescriptive in a good way. If you're starting a new project or tired of flex flex-col gap-4 everywhere, this gives you a cleaner vocabulary. Just know you'll need to set up those custom utilities in your Tailwind config first.

skills.sh installs
465
GitHub stars
92
last updated
Aug 21, 2026

Install

$ npx -y skills add sergiodxa/agent-skills --skill frontend-tailwind-best-practices --agent claude-code

Installs into .claude/skills of the current project.

Files

Tailwind CSS Best Practices

Styling patterns and conventions for frontend applications. Contains 10 rules covering layout utilities, affordances, color schemes, responsive design, and className handling.

When to Apply

Reference these guidelines when:

  • Writing component styles with Tailwind
  • Creating layouts (stacks, grids, centering)
  • Handling responsive design
  • Working with color schemes
  • Merging className props

Rules Summary

Layout Utilities (CRITICAL)

layout-stack-utilities - @rules/layout-stack-utilities.md

Use custom stack utilities instead of flex classes.

// Bad
<div className="flex flex-col gap-4">
<div className="flex flex-row gap-4">

// Good
<div className="v-stack gap-4">
<div className="h-stack gap-4">

Available utilities:

Sponsors

Details

Repository
github.com/sergiodxa/agent-skills
Categories
Frontend Development, Documentation, AI & Agent Building
First seen
Jun 3, 2026

More from sergiodxa/agent-skills

All 10
1manutej avatartailwind-cssmanutej/luxor-claude-marketplaceUtility-first CSS framework for rapid UI development with responsive design, component patterns, and production optimization. Master core utilities, dark mode, 463skills.sh installs
2majesteitbart avatarshadcn-ui-expertmajesteitbart/talentmatcherDevelop high-quality, accessible React components using shadcn-ui, Tailwind CSS, and Radix UI. Use when building forms, layouts, dialogs, tables, or any UI comp445skills.sh installs
3secondsky avatarnuxt-ui-v4secondsky/claude-skillsNuxt UI v4 component library for building Nuxt v4 applications. 125+ accessible components with Tailwind v4, Reka UI, dark mode, theming. Use for dashboards, fo421skills.sh installs
4julianromli avatarfrontend-ui-animatorjulianromli/ai-skillsAnalyze and implement purposeful UI animations for Next.js + Tailwind + React projects. Use when user asks to add animations, enhance UI motion, animate pages/c342skills.sh installs
5ovachiever avatarnextjs-shadcn-builderovachiever/droid-tingsBuild new Next.js applications or migrate existing frontends (React, Vue, Angular, vanilla JS, etc.) to Next.js + shadcn/ui with systematic analysis and convers263skills.sh installs
6hieutrtr avatarreact-frontend-experthieutrtr/ai1-skillsReact/TypeScript frontend implementation patterns. Use during the implementation phase when creating or modifying React components, custom hooks, pages, data fe206skills.sh installs