tailwind-css
БесплатноБез исполняемых скриптовНе проверенUse when styling UI components or layouts with Tailwind CSS - mobile-first design, responsive utilities, custom themes, or component styling. NOT when plain…
от aiskillstore★ 509 звёзд на GitHubОб этом скилле
Tailwind CSS Skill
Overview
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.
When This Skill Applies
This skill triggers when users request:
- Styling: "Style this KPI card", "Button component style", "Design a form"
- Responsive: "Mobile-first layout", "Responsive dashboard", "Grid with breakpoints"
- Themes: "Custom dark theme", "Extend tailwind theme", "Color scheme"
- Layouts: "Dashboard grid", "Card layout", "Flexible container"
Core Rules
1. Mobile-First Design
// ✅ 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:
- Base styles for mobile (no prefix)
- Progressive enhancement with
sm:,md:,lg:prefixes - Start with mobile layout, enhance for larger screens
- Use responsive breakpoints:
sm:640px,md:768px,lg:1024px
2. Responsive Utilities
// ✅ 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:
- Use fluid utilities (
w-full,flex-1) for mobile - Add breakpoints (
sm:,md:,lg:) for larger screens - Consider container queries for nested responsive components
- Test layouts at multiple breakpoints (375px, 768px, 1024px, 1440px)
3. Custom Themes
// 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:
- Extend theme in
tailwind.config.ts, don't override - Use semantic names (
primary,secondary,accent) - Define custom colors, fonts, spacing in theme
- Support CSS variables for dynamic theming
- Use
darkMode: 'class'for manual dark mode toggle
4. Component Styling
// ✅ 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:
- Prefer inline utility classes over custom CSS
- Use
@applysparingly (only for repeated patterns) - Extract complex variants with CVA or similar libraries
- Follow shadcn/ui patterns for consistent styling
- Use template literals for conditional classes
Output Requirements
Code Files
Component Styling:
- Inline utility classes in JSX/TSX
- Conditional classes for variants (dark/light, sizes)
- Focus states and transitions
Configuration:
tailwind.config.tsupdates for custom themesglobals.cssfor global styles and directives
Dark Mode Support:
<div className="bg-white dark:bg-gray-900 text-gray-900 dark:text-white"> Content with dark mode </div>
Integration Requirements
- shadcn/ui: Follow shadcn design tokens and patterns
- Accessibility: WCAG 2.1 AA compliant colors, focus-visible states
- Performance: Enable JIT mode, purge unused classes
- i18n: Support RTL layouts when needed
Documentation
- PHR: Create Prompt History Record for styling decisions
- ADR: Document theme decisions (color schemes, breakpoints)
- Comments: Document non-obvious utility com
Установить tailwind-css в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл tailwind-css?
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".
Как установить скилл tailwind-css?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл tailwind-css запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic