Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

tailwind-best-practices

БесплатноБез исполняемых скриптовНе проверен

Tailwind CSS patterns and conventions, v4 first with v3.4 legacy and migration. Use when writing responsive designs, implementing dark mode, creating reusable…

AsyrafHussinот AsyrafHussin★ 112 звёзд на GitHub

Об этом скилле

Tailwind CSS Best Practices

Comprehensive patterns for building consistent, maintainable interfaces with Tailwind CSS v4, with v3.4 kept as legacy and a full v3 → v4 migration path. Contains 30 rules covering responsive design, dark mode, component patterns, configuration, v4 setup and migration, and the utilities added in v4.1–4.3.

Metadata

  • Version: 2.0.0
  • Framework: Tailwind CSS v4.0+ (tested on 4.3); v3.4 legacy
  • Rule Count: 30 rules across 5 categories
  • Last Updated: November 2026
  • License: MIT
  • Documentation: tailwindcss.com/docs

Step 1: Detect Tailwind Version

Always check the version before giving any advice. v3 and v4 are fundamentally different.

Check package.json for the installed version:

{ "tailwindcss": "^4.x" }  // → v4 rules apply (default)
{ "tailwindcss": "^3.x" }  // → v3 legacy rules apply

For minor-version features (4.1 text shadows, 4.2 logical utilities, 4.3 scrollbars), check the exact version with npm ls tailwindcss.

Also check for these signals:

Signal Version
@import "tailwindcss" in CSS v4
@tailwindcss/vite, @tailwindcss/postcss, @tailwindcss/cli or @tailwindcss/webpack in dependencies v4
@theme {} block in CSS v4
@tailwind base; directives in CSS v3
tailwind.config.js exists and no @config in CSS v3
tailwind.config.js exists and CSS has @config "..." v4 loading a legacy config (mid-migration)

A tailwind.config.js on its own does not prove v3: v4 ignores it unless the CSS loads it with @config.

If v4 (default): Apply v4- rules plus resp-/responsive-, dark-, comp-/component- rules. Use @theme {}, not tailwind.config.js. If v3: Apply resp-/responsive-, dark-, comp-/component-, config- rules and the v3 (legacy) sections. Mention that v4 is available. If migrating v3 → v4: Follow v4-migration directly.

When to Apply

Reference these guidelines when:

  • Writing responsive layouts
  • Implementing dark mode
  • Creating reusable component styles
  • Configuring Tailwind (v4 @theme, or v3 config)
  • Migrating a project from v3 to v4
  • Setting up a new project with v4

Rule Categories by Priority

Priority Category Impact Prefix Rules Version
1 Responsive Design CRITICAL resp-, responsive- 6 v4 / v3
2 Dark Mode CRITICAL dark- 6 v4 / v3
3 Component Patterns HIGH comp-, component- 7 v4 / v3
4 Custom Configuration HIGH config- 6 v3 legacy (v4 equivalents included)
5 V4 & Migration HIGH v4- 5 v4

Quick Reference

1. Responsive Design (CRITICAL)

  • resp-mobile-first - Mobile-first approach
  • responsive-breakpoint-order - Order breakpoints smallest to largest
  • responsive-container-queries - Container queries (@container, @min-*/@max-*, @container-size)
  • responsive-fluid-typography - Fluid type with clamp() and --text-* theme values
  • responsive-aspect-ratio - Aspect ratio utilities
  • responsive-grid-system - Responsive grid layouts

2. Dark Mode (CRITICAL)

  • dark-setup - Configure dark mode (v4 default is prefers-color-scheme)
  • dark-class-strategy - Manual toggle with @custom-variant dark / darkMode: 'class'
  • dark-media-strategy - Follow the system preference
  • dark-color-scheme - Semantic color tokens for both themes
  • dark-custom-colors - Custom palettes and pairing
  • dark-transitions - Smooth theme transitions

3. Component Patterns (HIGH)

  • comp-clsx-cn - Conditional classes with clsx + tailwind-merge
  • component-btn-variants - Button variants
  • component-card-patterns - Card patterns
  • component-form-elements - Form elements
  • component-modals - Modals and dialogs
  • component-navigation - Navigation
  • component-tables - Tables

4. Custom Configuration — v3 legacy (HIGH)

  • config-extend-theme - Extend vs override theme
  • config-custom-colors - Custom color palette
  • config-custom-fonts - Custom fonts
  • config-custom-spacing - Custom spacing
  • config-plugins - Using plugins (@plugin in v4)
  • config-presets - Sharing configuration (a theme CSS file in v4)

5. V4 & Migration (HIGH)

  • v4-installation - Install v4 with Vite, PostCSS, CLI or webpack; @source, source(), @reference
  • v4-theme-configuration - @theme {} in CSS; @theme inline; sharing a theme; @config as a bridge
  • v4-custom-utilities - @utility, @custom-variant, @variant, @plugin, @layer components
  • v4-migration - Step-by-step v3 → v4: renames, removals, changed defaults, syntax changes
  • v4-new-utilities - Built-ins from v4.1–4.3: text shadows, masks, pointer variants, logical properties, scrollbars

Essential Patterns

Mobile-First Responsive Design

// ✅ Mobile-first: start with mobile, add larger bre
Полный SKILL.md на GitHub

Установить tailwind-best-practices в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

AGENTS.mdREADME.mdmetadata.jsonrules/_sections.mdrules/_template.mdrules/comp-clsx-cn.mdrules/component-btn-variants.mdrules/component-card-patterns.mdrules/component-form-elements.mdrules/component-modals.mdrules/component-navigation.mdrules/component-tables.mdrules/config-custom-colors.mdrules/config-custom-fonts.mdrules/config-custom-spacing.mdrules/config-extend-theme.mdrules/config-plugins.mdrules/config-presets.mdrules/dark-class-strategy.mdrules/dark-color-scheme.mdrules/dark-custom-colors.mdrules/dark-media-strategy.mdrules/dark-setup.mdrules/dark-transitions.mdrules/resp-mobile-first.mdrules/responsive-aspect-ratio.mdrules/responsive-breakpoint-order.mdrules/responsive-container-queries.mdrules/responsive-fluid-typography.mdrules/responsive-grid-system.mdrules/v4-custom-utilities.mdrules/v4-installation.mdrules/v4-migration.mdrules/v4-new-utilities.mdrules/v4-theme-configuration.md

FAQ

Что делает скилл tailwind-best-practices?

Tailwind CSS patterns and conventions, v4 first with v3.4 legacy and migration. Use when writing responsive designs, implementing dark mode, creating reusable component styles, configuring Tailwind, or migrating from v3 to v4. Triggers on tasks involving Tailwind classes, responsive design, dark mode, CSS styling, or "migrate to Tailwind v4".

Как установить скилл tailwind-best-practices?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл tailwind-best-practices запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить tailwind-best-practices с