Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Tailwind Knowledge Patch?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nevaberry-tailwind-knowledge-patch)
---
name: tailwind-knowledge-patch
description: Tailwind CSS
version: "4.3.5"
license: MIT
metadata:
author: Nevaberry
---
# Tailwind CSS Knowledge Patch
Load this skill when updating Tailwind CSS utility syntax, configuring themes
and source detection, defining utilities or variants, integrating build tools,
or migrating and canonicalizing class lists. Use the topic references for
the detailed behavior and examples relevant to the task.
## Reference index
| Reference | Topics |
| --- | --- |
| [Configuration and Theming](references/configuration.md) | Theme namespaces, JavaScript lookups, source registration and detection, custom utilities, package aliases |
| [Integrations and Ecosystem](references/integrations.md) | Vite, webpack, Rspack, Turbopack, PostCSS, CLI and watch mode, scanner availability, components, formatting |
| [Migration and Compatibility](references/migration.md) | Invalid syntax, upgrade behavior, canonicalization, browser fallbacks, generated CSS |
| [Utilities](references/utilities.md) | Logical layout, grid, containers, scrollbars, transforms, masks, shadows, typography, spacing |
| [Variants and States](references/variants.md) | Negation, supports queries, variant composition, scopes, plugin base styles |
## Deprecations and syntax that affects generation
- Replace deprecated `start-*` and `end-*` with `inset-s-*` and `inset-e-*`,
respectively. The legacy utilities require a value suffix to generate CSS.
- Unsupported or empty extra slash modifiers emit no CSS. Use `stroke-2`
instead of `stroke-2/50`, and `bg-red-500/50` instead of `bg-red-500/50/`.
- Arbitrary property values containing a top-level `!` are skipped. Put the
important modifier outside the brackets: `[color:red]!`.
- The canonicalizer rewrites `overflow-ellipsis` to `text-ellipsis` and
migrates legacy inset utilities with `full`, `auto`, `px`, or numeric values,
including negative forms such as `-start-4` to `-inset-s-4`.
## Migrating and canonicalizing existing code
The v3-to-v4 upgrade tool uses the v3 config's `content` setting to find files
to migrate and skips files ignored by Git. It leaves HTML `style` attributes
intact. `@tailwindcss/upgrade` honors ignore rules for files it would rewrite
when run from a project subdirectory.
The utility canonicalizer can combine font size and line height, equal width
and height, and matching arbitrary values into shorthands:
| Input | Canonical form |
| --- | --- |
| `text-sm leading-6` | `text-sm/6` |
| `w-1234 h-1234` | `size-1234` |
| `w-5 h-5 size-5` | `size-5` |
| `px-[1.2rem] py-[1.2rem]` | `p-[1.2rem]` |
| `[&:has(img)]:p-4` | `has-[img]:p-4` |
Canonicalized shorthands preserve the original theme variable even when
another variable has the same default value. Inline `theme()` alpha migration
uses arbitrary percentages to preserve precision or avoid a theme opacity
token overriding the requested alpha. `tailwindcss canonicalize` sends plugin
logs to stderr so stdout can be piped or redirected as results.
See [Migration and Compatibility](references/migration.md) for calculation,
whitespace, unit, color, breakpoint, and legacy-utility canonicalization.
## Logical layout and containers
- Use `inset-s-*` / `inset-e-*` for inline-start / inline-end offsets and
`inset-bs-*` / `inset-be-*` for block-start / block-end offsets.
- Use `pbs-*` / `pbe-*`, `mbs-*` / `mbe-*`, and `border-bs-*` / `border-be-*`
for block-start / block-end padding, margins, and borders.
- Scroll padding uses `scroll-pbs-*` / `scroll-pbe-*`; scroll margins use
`scroll-mbs-*` / `scroll-mbe-*`.
- `inline-*`, `min-inline-*`, `max-inline-*`, `block-*`, `min-block-*`, and
`max-block-*` size elements and set limits following the writing mode.
- Safe alignment works in flex and grid. `justify-center-safe` centers grid
tracks when they fit and falls back to start alignment when they overflow.
- `self-baseline-last` opts an individual flex or grid item into last-baseline
alignment. `aspect-*` fractions accept quarter-unit increments.
- `auto-rows-12` and `auto-cols-16` size implicit tracks to 12 and 16 times the
theme spacing unit, respectively.
- `@container-size` sets `container-type: size`; descendants can use `cqb`
against its block size. `@container-size/{name}` names the container.
## Scrollbars, transforms, and visual effects
`scrollbar-auto`, `scrollbar-thin`, and `scrollbar-none` set scrollbar width.
Use `scrollbar-thumb-*` and `scrollbar-track-*` together for colors, including
slash opacity. Gutter choices are `scrollbar-gutter-auto`,
`scrollbar-gutter-stable`, and `scrollbar-gutter-both`.
Combine `rotate-z-*` with `rotate-x-*` and put `perspective-distant` on the
parent for visible depth. `translate-z-*` offsets depth; `scale-z-*` scales it.
Set `transform-3d` on the parent whose children should retain their depth.
- `inset-shadow-*` and `inset-ring-*` stack with `shadow-*` and `ring-*`,
giving four box-shadow layers on one element.
- Put slash opacity directly on text-shadow sizes. With the default theme,
`text-shadow-lg/50` equals `text-shadow-lg text-shadow-black/50`.
- Named box, text, drop, and inset shadow sizes accept fractional percentages
as slash modifiers, such as `shadow-sm/12.5`.
- Edge masks (`mask-t-*`, `mask-r-*`, `mask-b-*`, `mask-l-*`) stack with radial
and conic masks. Set radial stop colors and positions with separate classes;
`mask-radial-at-right` moves the center to the right edge.
- A bracketed gradient modifier accepts the full interpolation clause,
including `in`, as in `bg-conic/[in_hsl_longer_hue]`.
- `zoom-125` sets `zoom: 125%`; use `zoom-[1.1]` for an arbitrary value or
`zoom-(--preview-zoom)` for a CSS variable.
## Theme values, typography, and spacing
- Default color palettes include mauve, olive, mist, and taupe.
- `--placeholder-color-*` supplies custom colors for `placeholder-*`.
`--perspective-*` generates matching `perspective-*` utilities.
- JavaScript config and plugin theme keys preserve case. In a legacy JavaScript
config, `ringColor.DEFAULT` supplies the color used by `ring` without a color utility.
- In a JavaScript plugin or config, root lookups such as `theme('colors')`
return the full namespace object, including its `DEFAULT` entry when present.
- `--opacity-*` theme values appear in suggestions for slash opacity modifiers.
- `font-features-*` sets `font-feature-settings` for features supported by the
current font. `tab-2` sets `tab-size: 2` for literal tabs in preformatted text.
- `--spacing()` works inside arbitrary values, including
`py-[calc(--spacing(4)-1px)]`; `text-[--spacing(5)]` sets a spacing-based font size.
- `--spacing(0)` compiles to `0px` for length expressions. Spacing utilities
such as `m-0` emit literal `0`; those such as `m-1` emit `var(--spacing)` directly.
- Units such as `dvmin`, `svi`, `cap`, and `rex` are recognized as lengths:
`text-[10dvmin]` sets `font-size` without a `length:` hint.
## Source detection and registration
`source()` paths are validated relative to the stylesheet containing them,
including when that stylesheet is imported by another file. Explicit `@source`
directories are scanned even when ignored by Git; binary file types are still
skipped. A later `@source` can re-include a file excluded by an earlier
`@source not`, while `@source not inline()` suppresses utilities even when
detected in source files.
```css
@source not "./templates/legacy/**";
@source "./templates/legacy/active.html";
```
Automatic detection skips `.jj`, `.env`, and `.env.*` and follows allowlists
in `.gitignore`. Ruby comments do not contribute classes. Detection recognizes
uppercase letters followed by digits, dotted classes inside MDX braces, Twig
`addClass()` / `removeClass()` literals, Template Toolkit delimiters, Maud
conditions, and Ruby `%w` / `%W` angle-bracket or custom delimiters.
Explicit source globs can traverse symlinks. A trailing `**/*` keeps earlier
wildcard segments in effect. See [Configuration and Theming](references/configuration.md)
for source-scope rules and nested or sibling paths.
## Custom utilities and variants
Use `--default(...)` inside `--value(...)` or `--modifier(...)` when the class
suffix or slash modifier is omitted. Multi-token defaults retain their spaces.
Separate `@utility` definitions with the same name can handle different value
types; each functional definition needs a `--value(...)` call.
```css
@utility code-tab-* {
tab-size: --value(integer, --default(4));
}
```
- `@variant` inside a block-form `@custom-variant` reuses an existing variant.
- `@variant hover:focus` requires both variants; `@variant hover, focus`
applies declarations for each variant independently.
- `not-hover:` applies outside `:hover` and when `@media not (hover: hover)`
matches. `not-*` can also negate container queries, including `style()` queries.
- `supports-[selector(a:not(.foo))]:flex` tests selector support; `and`, `or`,
and `not` inside the selector expression are preserved.
- A custom variant with `@scope` wraps generated utility rules in the scope.
Nested scope boundaries are preserved; direct declarations inside a scope
are wrapped in `:where(:scope)`.
- `@variant` works in plugin `addBase()` styles, including with a custom
variant declared later in the stylesheet.
## Build integrations and watch mode
With CLI, Vite, or PostCSS, `@import`, `@reference`, `@plugin`, and `@config`
can resolve `#` aliases from the `package.json` `imports` field. Vite resolves
relative `@import` and `@plugin` paths from the declaring stylesheet and uses
`resolve.alias` for both directives. Upgrade `@tailwindcss/vite` to 4.2.2 for
Vite 8. When PostCSS omits `from`, `@tailwindcss/postcss` resolves relative
imports from its configured `base` directory.
Install `@tailwindcss/webpack` for webpack; Rspack can be the sole bundler
dependency. Use `@tailwindcss/turbopack` for Next.js and omit `as: '*.css'`
from the loader rule so CSS Modules work.
Use `--silent` with `@tailwindcss/cli` to suppress messages while writing
compiled CSS to the output file. Use `--watch --poll` when filesystem events
are unreliable or unavailable and
`--poll=<ms>` to set the interval. One-off builds and polling watch builds
work even when `@parcel/watcher` cannot load.
```sh
npx @tailwindcss/cli -i ./input.css -o ./output.css --watch --poll=500
```
Tailwind 4.3.4 installs `@tailwindcss/oxide-wasm32-wasi` on all platforms and
loads it automatically when native bindings are unavailable. Use 4.3.5 in
WebContainers so the WASM scanner loads and detects changed and newly created
files after the initial scan. Use signed standalone macOS binaries from 4.3.4
or later for macOS 27.
See [Integrations and Ecosystem](references/integrations.md) for Vite reload
conditions, PostCSS rebuilds and asset URLs, CLI watch recovery, native CSS
mixins, nesting, Tailwind Plus HTML behavior, Headless UI dialogs, and Prettier.