skills/awais68/tailwind-css/SKILL.md
Use when styling UI components or layouts with Tailwind CSS - mobile-first design, responsive utilities, custom themes, or component styling. NOT when plain CSS, CSS-in-JS (styled-components), or non-Tailwind frameworks are involved. Triggers: "style component", "responsive design", "mobile-first", "dark theme", "tailwind classes", "dashboard grid".
npx skillsauth add aiskillstore/marketplace tailwind-cssInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Expert guidance for Tailwind CSS styling with mobile-first responsive design, custom themes, and utility-first approach. Focuses on accessibility, dark mode, and performance optimization.
This skill triggers when users request:
// ✅ GOOD: Mobile-first progressive enhancement
<div className="w-full px-4 py-2 sm:w-1/2 sm:px-6 md:w-1/3 md:px-8 lg:w-1/4">
<KPICard />
</div>
// Breakpoints:
// sm: 640px - Small tablets/phones
// md: 768px - Tablets
// lg: 1024px - Desktops
// xl: 1280px - Large screens
// 2xl: 1536px - Extra large screens
Requirements:
sm:, md:, lg: prefixessm:640px, md:768px, lg:1024px// ✅ GOOD: Fluid responsive layouts
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4">
{items.map(item => <Item key={item.id} item={item} />)}
</div>
// ✅ GOOD: Responsive spacing
<div className="p-4 sm:p-6 md:p-8 lg:p-12">
Content
</div>
// ✅ GOOD: Container queries (if needed)
<div className="@container">
<div className="@lg:grid-cols-2">
Nested responsive content
</div>
</div>
Requirements:
w-full, flex-1) for mobilesm:, md:, lg:) for larger screens// tailwind.config.ts
export default {
darkMode: 'class', // or 'media'
content: ['./src/**/*.{ts,tsx}'],
theme: {
extend: {
colors: {
primary: {
50: '#eff6ff',
100: '#dbeafe',
500: '#3b82f6',
900: '#1e3a8a',
},
erp: {
'card': '#ffffff',
'card-dark': '#1f2937',
},
},
spacing: {
'18': '4.5rem',
'88': '22rem',
},
fontFamily: {
sans: ['Inter', 'sans-serif'],
},
},
},
plugins: [],
};
Requirements:
tailwind.config.ts, don't overrideprimary, secondary, accent)darkMode: 'class' for manual dark mode toggle// ✅ GOOD: Utility-first approach
export const Button = ({ variant, size, children }) => (
<button className={`
font-semibold rounded-lg
${variant === 'primary' ? 'bg-blue-500 text-white hover:bg-blue-600' : 'bg-gray-200 text-gray-800 hover:bg-gray-300'}
${size === 'sm' ? 'px-3 py-1 text-sm' : 'px-4 py-2'}
transition-colors duration-200
focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2
`}>
{children}
</button>
);
// ✅ GOOD: CVA or class-variance-authority for variants
import { cva } from 'class-variance-authority';
const buttonVariants = cva(
'font-semibold rounded-lg transition-colors',
{
variants: {
variant: {
primary: 'bg-blue-500 text-white hover:bg-blue-600',
secondary: 'bg-gray-200 text-gray-800 hover:bg-gray-300',
},
size: {
sm: 'px-3 py-1 text-sm',
md: 'px-4 py-2',
},
},
}
);
Requirements:
@apply sparingly (only for repeated patterns)Component Styling:
Configuration:
tailwind.config.ts updates for custom themesglobals.css for global styles and directivesDark Mode Support:
<div className="bg-white dark:bg-gray-900 text-gray-900 dark:text-white">
Content with dark mode
</div>
Analyze Layout Requirements
Apply Mobile-First Styles
Add Responsive Breakpoints
sm: for tablets (640px)md: for tablets (768px)lg: for desktops (1024px)Apply Dark Mode
dark: variants for colors/backgroundsValidate Accessibility
Before completing any styling:
dark: classesfocus-visible or focus:ring on all interactive elementstransition-* classes for smooth state changesexport const KPICard = ({ title, value, trend, loading }) => (
<div className="
w-full p-4 bg-white dark:bg-gray-800
rounded-lg shadow-sm border border-gray-200 dark:border-gray-700
sm:p-6 md:p-8
">
{loading ? (
<Skeleton className="h-20" />
) : (
<>
<h3 className="text-sm font-medium text-gray-600 dark:text-gray-400">
{title}
</h3>
<p className="text-2xl font-bold text-gray-900 dark:text-white mt-2">
{value}
</p>
{trend && (
<span className={`
inline-flex items-center mt-2 text-sm
${trend > 0 ? 'text-green-600 dark:text-green-400' : 'text-red-600 dark:text-red-400'}
`}>
{trend > 0 ? '↑' : '↓'} {Math.abs(trend)}%
</span>
)}
</>
)}
</div>
);
export const DashboardGrid = ({ children }) => (
<div className="
w-full grid gap-4
grid-cols-1
sm:grid-cols-2
md:grid-cols-3
lg:grid-cols-4
xl:grid-cols-5
p-4
">
{children}
</div>
);
export const ResponsiveForm = () => (
<form className="
w-full max-w-lg mx-auto
p-4 sm:p-6 md:p-8
bg-white dark:bg-gray-800
rounded-lg shadow-md
">
<div className="space-y-4 sm:space-y-6">
<div>
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
Name
</label>
<input className="
w-full px-4 py-2 text-base
border border-gray-300 dark:border-gray-600
rounded-lg
bg-white dark:bg-gray-700
text-gray-900 dark:text-white
focus:ring-2 focus:ring-blue-500 focus:border-blue-500
" />
</div>
<button className="
w-full sm:w-auto
px-6 py-3 text-base font-semibold
bg-blue-500 hover:bg-blue-600
text-white rounded-lg
transition-colors duration-200
focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2
">
Submit
</button>
</div>
</form>
);
export const DarkModeToggle = ({ isDark, onToggle }) => (
<button
onClick={onToggle}
className="
p-2 rounded-lg
bg-gray-200 dark:bg-gray-700
hover:bg-gray-300 dark:hover:bg-gray-600
text-gray-800 dark:text-gray-200
transition-colors duration-200
focus:outline-none focus:ring-2 focus:ring-blue-500
"
aria-label={isDark ? 'Switch to light mode' : 'Switch to dark mode'}
>
{isDark ? '☀️' : '🌙'}
</button>
);
// Recommended breakpoint configuration
screens: {
'xs': '475px', // Extra small phones
'sm': '640px', // Small tablets/phones
'md': '768px', // Tablets
'lg': '1024px', // Desktops
'xl': '1280px', // Large screens
'2xl': '1536px', // Extra large screens
}
// Semantic color naming
colors: {
primary: { 50: '...', 500: '...', 900: '...' },
success: { 50: '...', 500: '...', 900: '...' },
warning: { 50: '...', 500: '...', 900: '...' },
error: { 50: '...', 500: '...', 900: '...' },
}
// Use Tailwind's scale: 0, 1, 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24, 32, 40, 48, 56, 64, 72, 80, 96
// 1 = 0.25rem (4px), 4 = 1rem (16px), 8 = 2rem (32px)
spacing: {
'128': '32rem',
'144': '36rem',
}
focus:ring-2 or focus-visiblesr-only skip links for keyboard usersaria-label for icon-only buttonsdevelopment
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.