Command Palette

Search for a command to run...

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

tailwind

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

USE WHEN writing, fixing or reviewing styling in a project that uses Tailwind CSS, even a one-class change or a request that does not name Tailwind: colours…

mintuzот mintuz★ 38 звёзд на GitHub

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

Tailwind

Write Tailwind styling that the build generates, that matches the installed version and that adds nothing the requester did not ask for.

Boundaries

  • In a project without Tailwind, use web:css. In a Tailwind project, this skill covers the class names and the stylesheet that Tailwind processes.
  • When the change also alters React component structure, state or data flow, also load web:react.

References

Read a reference only when the task needs it:

Reference Read for
setup.md Tailwind config, global CSS, CSS variables for theming, the token hierarchy
cva-components.md A CVA component, after Component variants selects CVA
animations.md Entry and exit animations, dialog transitions, tailwindcss-animate
utilities.md Class composition with cn, shared focus and disabled-state strings
best-practices.md Semantic naming, accessible names, dark mode, arbitrary values, @apply, responsive and animation performance

Version gate

Before you write Tailwind syntax, read the installed major version. Tailwind 3 and Tailwind 4 syntax is not interchangeable. Before you use a feature that a later minor version added, such as @source inline(...) in Tailwind 4.1, read the minor version too. In your reply, name the installed major version and the path it uses: CSS-first for Tailwind 4, config-based for Tailwind 3.

Tailwind 4 (CSS-first):

  • Import with @import "tailwindcss";.
  • Declare tokens in a CSS @theme block.
  • When a utility must follow a CSS variable that changes at run time, such as a variable redefined under .dark or [data-theme="dark"], declare the token in @theme inline. Then state both halves of the reason in your reply:
    1. A plain @theme variable that references another variable resolves once at the root, so its utility keeps the root value inside a nested override.
    2. @theme inline puts the variable reference in the generated utility, so the value resolves on the element that uses it.
  • For a new Vite integration, register the @tailwindcss/vite plugin. It replaces the PostCSS setup. Keep a working @tailwindcss/postcss integration where you find one.
  • Tailwind 4 detects sources automatically in a normal layout and usually needs no config file or content glob. Register a path with @source only when Tailwind cannot reach it, such as an ignored directory or a path outside the project root.

Tailwind 3 (config-based):

  • Import with @tailwind base;, @tailwind components; and @tailwind utilities;.
  • Declare tokens under theme.extend in tailwind.config.*. Set content and darkMode there. See setup.md.

Do not add a config file, content glob, PostCSS setup or dependency unless the observed project requires it (principle-foundational-thinking).

Literal class names

Tailwind generates CSS only for class names that appear as complete literal strings in the files it scans. It reads source as plain text and never evaluates it, so it never generates a name built at run time, such as `bg-${color}-600`. Such a component looks correct only while another scanned file contains the same names. Treat every dynamic class name as a defect.

When you change how a component builds its class names:

  1. Say which mechanism now keeps every name literal.
  2. Check that Tailwind scans the file, and say so.

Component variants

Put the utilities that every variant shares in one base string. Give each finite typed variant a complete literal class string. Choose the mechanism:

  • Exhaustive Record<Variant, string> map. It needs no dependency. Use it by default, and always when the task forbids new packages.
  • CVA (class-variance-authority). Use it when the project already installs the package, or when the requester asks for CVA and accepts the dependency. CVA derives the prop types, which helps with several independent axes, such as variant plus size. See cva-components.md.

Do not add class-variance-authority on your own initiative (Dependencies).

Do not fix a dynamic class name with a safelist: it hides which variants the component uses and grows the generated CSS. Safelist only a known, finite set of names that cannot appear in scanned source. Tailwind 4.1 and later write it as @source inline(...); Tailwind 4.0 does not have it. For a name unknown until run time, such as a class read from a database, map each external value to a literal class in your source, with a default for an unrecognised value.

Before you write a component that takes a ref, read the installed React version. In React 19, accept ref as a regular prop and do not add forwardRef or displayName. Use forwardRef only on React 18 or earlier.

Focus indicators

Give every i

Полный SKILL.md на GitHub

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

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

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

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

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

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

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

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

references/animations.mdreferences/best-practices.mdreferences/cva-components.mdreferences/setup.mdreferences/utilities.md

FAQ

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

USE WHEN writing, fixing or reviewing styling in a project that uses Tailwind CSS, even a one-class change or a request that does not name Tailwind: colours, focus rings, spacing, class names chosen by a prop, map or CVA variants, theme tokens and dark mode in the Tailwind stylesheet or tailwind.config, setup or upgrades (if unsure whether the project uses Tailwind, check package.json or the main stylesheet first); NOT WHEN writing plain CSS or Sass in a project without Tailwind; produces class names Tailwind can find, syntax for the installed major version, visible focus indicators, and no unrequested dependency or invented brand value.

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

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

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

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

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

Сравнить tailwind с