tailwind
БесплатноБез исполняемых скриптовНе проверенTailwind CSS utility-first framework for rapid UI development with responsive design and dark mode
Об этом скилле
Tailwind CSS Skill
progressive_disclosure: entry_point: - summary - when_to_use - quick_start sections: core_concepts: - utility_first_approach - responsive_design - configuration advanced: - dark_mode - custom_utilities - plugins - performance_optimization integration: - framework_integration - component_patterns reference: - common_utilities - breakpoints - color_system tokens: entry: 75
full: 4500
Summary
Tailwind CSS is a utility-first CSS framework that provides low-level utility classes to build custom designs without writing CSS. It offers responsive design, dark mode, customization through configuration, and integrates seamlessly with modern frameworks.
When to Use
Best for:
- Rapid prototyping with consistent design systems
- Component-based frameworks (React, Vue, Svelte)
- Projects requiring responsive and dark mode support
- Teams wanting to avoid CSS file maintenance
- Design systems with standardized spacing/colors
Consider alternatives when:
- Team unfamiliar with utility-first approach (learning curve)
- Project requires extensive custom CSS animations
- Legacy browser support needed (IE11)
- Minimal CSS footprint required without build process
Quick Start
Installation
# npm
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
# yarn
yarn add -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
# pnpm
pnpm add -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
Configuration
tailwind.config.js:
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./src/**/*.{js,jsx,ts,tsx}",
"./public/index.html",
],
theme: {
extend: {},
},
plugins: [],
}
Basic CSS Setup
styles/globals.css:
@tailwind base;
@tailwind components;
@tailwind utilities;
First Component
// Simple button with Tailwind utilities
function Button({ children, variant = 'primary' }) {
const baseClasses = "px-4 py-2 rounded-lg font-medium transition-colors";
const variants = {
primary: "bg-blue-600 text-white hover:bg-blue-700",
secondary: "bg-gray-200 text-gray-900 hover:bg-gray-300",
danger: "bg-red-600 text-white hover:bg-red-700"
};
return (
<button className={`${baseClasses} ${variants[variant]}`}>
{children}
</button>
);
}
Core Concepts
Utility-First Approach
Tailwind provides single-purpose utility classes that map directly to CSS properties.
Layout Utilities
Flexbox:
// Centered flex container
<div className="flex items-center justify-center">
<div>Centered content</div>
</div>
// Responsive flex direction
<div className="flex flex-col md:flex-row gap-4">
<div className="flex-1">Column 1</div>
<div className="flex-1">Column 2</div>
</div>
// Flex wrapping and alignment
<div className="flex flex-wrap items-start justify-between">
<div className="w-1/2 md:w-1/4">Item</div>
<div className="w-1/2 md:w-1/4">Item</div>
</div>
Grid:
// Basic grid
<div className="grid grid-cols-3 gap-4">
<div>1</div>
<div>2</div>
<div>3</div>
</div>
// Responsive grid
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
<div className="col-span-1 md:col-span-2">Wide item</div>
<div>Item</div>
<div>Item</div>
</div>
// Auto-fit grid
<div className="grid grid-cols-[repeat(auto-fit,minmax(250px,1fr))] gap-4">
<div>Auto-sized item</div>
<div>Auto-sized item</div>
</div>
Spacing System
Padding and Margin:
// Uniform spacing
<div className="p-4">Padding all sides</div>
<div className="m-8">Margin all sides</div>
// Directional spacing
<div className="pt-4 pb-8 px-6">Top 4, bottom 8, horizontal 6</div>
<div className="ml-auto mr-0">Right-aligned with margin</div>
// Negative margins
<div className="mt-4 -mb-2">Overlap bottom</div>
// Responsive spacing
<div className="p-2 md:p-4 lg:p-8">Responsive padding</div>
Space Between:
// Gap between children
<div className="flex gap-4">
<div>Item 1</div>
<div>Item 2</div>
</div>
// Responsive gap
<div className="grid grid-cols-3 gap-2 md:gap-4 lg:gap-6">
<div>1</div>
<div>2</div>
<div>3</div>
</div>
Typography
// Font sizes and weights
<h1 className="text-4xl font-bold">Heading</h1>
<p className="text-base font-normal leading-relaxed">Paragraph</p>
<span className="text-sm font-medium text-gray-600">Caption</span>
// Text alignment and decoration
<p className="text-center underline">Centered underlined text</p>
<p className="text-right line-through">Right-aligned strikethrough</p>
// Responsive typography
<h1 className="text-2xl md:text-4xl lg:text-6xl font-bold">
Responsive heading
</h1>
// Text overflow handling
<p className="truncate">This text will be truncated with ellipsis...</p>
<p className="line-clamp-3">
Установить tailwind в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл tailwind?
Tailwind CSS utility-first framework for rapid UI development with responsive design and dark mode
Как установить скилл tailwind?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл tailwind запускает скрипты?
Нет, скилл состоит только из инструкций (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