[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79SEEVVSVFC7SHYT3MT7J4W":3,"skill-same:01M79SEEVVSVFC7SHYT3MT7J4W":86},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":14,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M79SEEVVSVFC7SHYT3MT7J4W","tailwind-v4",null,"Tailwind CSS v4 utility lookup, CSS-first theming, and version guardrails. Use whenever a project depends on tailwindcss v4, imports `tailwindcss` from CSS, or has an `@theme`, `@utility`, `@apply`, or `@custom-variant` rule - and for any CSS or class-name work in such a project, including writing markup with utility classes, editing a stylesheet, theming, dark mode, responsive or container queries, and build setup with Vite, PostCSS, or the CLI. Load this even for requests that look trivial, such as adding one class or changing one color, because v4 replaced the JavaScript config with CSS, renamed or removed a large part of the v3 class surface, and silently generates nothing for v3 syntax rather than failing, which makes recalled knowledge of \"Tailwind\" wrong in ways no build error reports.","davner\u002Fdotfiles","davner","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F46757810?v=4","01M79SCEJR5ZY0VZD2HJ9HCCXC","Dan Avner","01M79SCEKB7MRS52247SX36BWM",0,"MIT","https:\u002F\u002Fgithub.com\u002Fdavner\u002Fdotfiles\u002Fblob\u002Fmain\u002Fhome\u002F.claude\u002Fskills\u002Ftailwind-v4\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: tailwind-v4\ndescription: Tailwind CSS v4 utility lookup, CSS-first theming, and version guardrails. Use whenever a project depends on tailwindcss v4, imports `tailwindcss` from CSS, or has an `@theme`, `@utility`, `@apply`, or `@custom-variant` rule - and for any CSS or class-name work in such a project, including writing markup with utility classes, editing a stylesheet, theming, dark mode, responsive or container queries, and build setup with Vite, PostCSS, or the CLI. Load this even for requests that look trivial, such as adding one class or changing one color, because v4 replaced the JavaScript config with CSS, renamed or removed a large part of the v3 class surface, and silently generates nothing for v3 syntax rather than failing, which makes recalled knowledge of \"Tailwind\" wrong in ways no build error reports.\nallowed-tools: Bash(node *tw4.mjs*), Bash(node -e *), Bash(ls -d *), Bash(curl -sS *)\n---\n\n# Tailwind CSS v4\n\n## What is actually installed here\n\n```json\n!`node -e \"const fs=require('fs'),pa=require('path');const up=(n)=>{let d=process.cwd();for(;;){const p=pa.join(d,'node_modules',n);if(fs.existsSync(p))return p;const q=pa.dirname(d);if(q===d)return null;d=q}};const v=(p)=>{try{return JSON.parse(fs.readFileSync(pa.join(p,'package.json'),'utf8')).version}catch(e){return null}};const tw=up('tailwindcss');if(!tw){console.log(JSON.stringify({installed:null,note:'no tailwindcss resolved from '+process.cwd()},null,2));process.exit(0)}const ver=v(tw);const integ={};for(const n of ['@tailwindcss\u002Fvite','@tailwindcss\u002Fpostcss','@tailwindcss\u002Fcli','@tailwindcss\u002Fwebpack','@tailwindcss\u002Ftypography','@tailwindcss\u002Fforms']){const d=up(n);if(d)integ[n]=v(d)}const cfg=['tailwind.config.js','tailwind.config.cjs','tailwind.config.mjs','tailwind.config.ts'].filter(f=>fs.existsSync(pa.join(process.cwd(),f)));console.log(JSON.stringify({installed:ver,major:parseInt(ver,10),integrations:integ,legacyJsConfig:cfg},null,2))\" 2>\u002Fdev\u002Fnull || echo '{\"installed\":null,\"note\":\"node unavailable or errored\"}'`\n```\n\nRead `installed` before doing anything else. It is the version on disk, which beats\nthe version anyone believes is in use.\n\n- **`major` is `4`** - this skill applies. Proceed, but read\n  [version-floors.md](references\u002Fversion-floors.md) before using anything added\n  after 4.0: a v4.0 project silently generates nothing for a 4.1 utility.\n- **`major` is `3`** - this skill does NOT apply. Say so and stop using it. Almost\n  every rule below is wrong for v3, starting with the config file.\n- **`installed` is `null`** - dependencies may not be installed, or you are not in\n  the project directory. Ask before assuming a version; do not guess from memory.\n- **`legacyJsConfig` is non-empty** - a `tailwind.config.js` is present. In v4 that\n  file does nothing unless a stylesheet names it with `@config`. See\n  [the silent failures](#the-four-silent-failures) below.\n\n## Verify the class, do not recall it\n\nTailwind ships no CLI that answers \"does this class exist\"; the compiler is\nreachable only through a Node API. This skill bundles the script that asks it.\n\nThe script lives in this skill's directory and your working directory is the\nuser's project, so resolve it once per session and reuse the variable.\n\n```bash\nTW4=$(ls -d ~\u002F.claude\u002Fskills\u002Ftailwind-v4\u002Fscripts\u002Ftw4.mjs \\\n            .claude\u002Fskills\u002Ftailwind-v4\u002Fscripts\u002Ftw4.mjs 2>\u002Fdev\u002Fnull | head -1)\n\nnode \"$TW4\" version                      # installed version, integrations, entry CSS\nnode \"$TW4\" check flex bg-brand card-pad # does each class exist here? exit 1 if not\nnode \"$TW4\" css text-shadow-lg           # the CSS a class compiles to\nnode \"$TW4\" variants                     # every variant this project can use\nnode \"$TW4\" search '^mask-'              # find classes by pattern\nnode \"$TW4\" theme '^--color-brand'       # resolved theme variables\n```\n\n`check` answers against **this project's** stylesheet, so a custom `@theme` color,\na project `@utility`, and a project `@custom-variant` all resolve. It exits 1 if\nany candidate is not a utility, so it works in a conditional. Run it before\nwriting an unfamiliar class, and always for anything in the rename tables.\n\nIf `$TW4` comes back empty the skill is installed elsewhere; fall back to the docs\nbelow rather than guessing.\n\n## The four silent failures\n\nv4 does not error on v3 input. It compiles, exits 0, and produces the wrong thing.\nThese four are the reason this skill exists, and all four are verified against\ntailwindcss 4.3.3:\n\n**1. `@tailwind base\u002Fcomponents\u002Futilities` produces an empty stylesheet.** Not a\nwarning, not an error - a 66-byte file containing only the license comment. The\nentire framework vanishes and the build succeeds. v4 imports as regular CSS:\n\n```css\n@import \"tailwindcss\";\n```\n\n**2. `tailwind.config.js` is ignored unless a stylesheet names it.** A v3 project\nwhose config carries the whole design system builds clean and drops all of it. If\nthe injected `legacyJsConfig` above is non-empty, check the entry CSS for\n`@config` before touching anything:\n\n```css\n@config \"..\u002F..\u002Ftailwind.config.js\";   \u002F* compatibility, not the v4 way *\u002F\n```\n\nThe v4 way is `@theme` in CSS. See [theme.md](references\u002Ftheme.md).\n`corePlugins`, `safelist`, and `separator` are not supported through `@config` at\nall - safelist with `@source inline(…)` instead.\n\n**3. `bg-[--brand]` compiles to `background-color: --brand`,** which is not a\nvalue and does nothing. v4 changed the CSS-variable shorthand from square\nbrackets to parentheses. `bg-(--brand)` is the one that emits `var(--brand)`.\nThe same trap applies to every utility, and there is no diagnostic.\n\n**4. A custom class in `@layer utilities` loses every variant.** In v3 that block\nregistered a real utility. In v4 it emits the bare rule and nothing else, so\n`hover:zorble` and `md:zorble` generate no CSS while `zorble` still works - which\nis what makes it hard to spot. Use `@utility`:\n\n```css\n\u002F* v3: hover:zorble and md:zorble silently produce nothing *\u002F\n@layer utilities { .zorble { outline-offset: 7px; } }\n\n\u002F* v4: all variants generated *\u002F\n@utility zorble { outline-offset: 7px; }\n```\n\n## Where the truth lives\n\nWork down this list. Stop at the first source that answers the question.\n\n**1. `node \"$TW4\" check` \u002F `css`.** Version-exact by construction, because it\ncompiles against the project's own installed Tailwind and its own stylesheet. Use\nit for any question of the form \"does this exist\" or \"what does this emit\".\n\n**2. The installed package's CSS.** `node_modules\u002Ftailwindcss\u002Ftheme.css` is the\ndefault theme - every `--color-*`, `--breakpoint-*`, `--spacing`, `--radius-*`,\n`--shadow-*` and so on, as shipped. `preflight.css` is the base reset.\n`index.css` shows the layer order the framework establishes. Read these rather\nthan recalling default values.\n\n**3. The reference files in this skill**, for the v3-to-v4 delta and the traps\nthat neither the types nor a build error will tell you.\n\n**4. The documentation site**, at `https:\u002F\u002Ftailwindcss.com\u002Fdocs\u002F\u003Cpage>`, for usage\nshape. It documents the **latest** v4 only - there is no per-version docs site, so\na page may describe a utility your installed version does not have. Confirm with\n`check` before using anything the page introduces. There is no `llms.txt`\n(`\u002Fllms.txt` returns 404), so read pages individually. The docs source is MDX at\n`github.com\u002Ftailwindlabs\u002Ftailwindcss.com` under `src\u002Fdocs\u002F`, which is easier to\nread than the rendered HTML.\n\n## Rules that prevent the common failures\n\n**Never write a `tailwind.config.js` for a v4 project.** Theme customization is\nCSS. Adding a color means adding a variable in the right namespace, and the\nutility comes with it:\n\n```css\n@import \"tailwindcss\";\n\n@theme {\n  --color-brand: oklch(0.7 0.2 200);   \u002F* creates bg-brand, text-brand, border-brand, … *\u002F\n  --breakpoint-3xl: 120rem;            \u002F* creates the 3xl:* variant *\u002F\n  --font-display: \"Satoshi\", sans-serif;\n}\n```\n\nThe namespace decides which utilities appear. Full table in\n[theme.md](references\u002Ftheme.md).\n\n**Check the class name before writing it.** v4 renamed the shadow, radius and blur\nscales by shifting every step, so `shadow-sm` in v4 is v3's `shadow` and looks\nvisibly different from v3's `shadow-sm` (now `shadow-xs`). `outline-none` changed\nmeaning rather than disappearing. Full tables in\n[version-delta.md](references\u002Fversion-delta.md); the ones that bite hardest:\n\n| If you are about to write | v4 wants | Why it matters |\n| --- | --- | --- |\n| `shadow-sm`, `rounded-sm`, `blur-sm` meaning the v3 value | `shadow-xs`, `rounded-xs`, `blur-xs` | compiles fine, renders bigger |\n| `outline-none` meaning \"invisible but focusable\" | `outline-hidden` | `outline-none` now really removes the outline |\n| `ring` meaning a 3px ring | `ring-3` | `ring` is 1px in v4 |\n| `bg-gradient-to-r` | `bg-linear-to-r` | old name still works, emits different interpolation |\n| `bg-opacity-50`, `text-opacity-50` | `bg-black\u002F50`, `text-black\u002F50` | the `*-opacity-*` utilities are gone |\n| `!flex` | `flex!` | old position still works but is deprecated |\n| `bg-[--brand]` | `bg-(--brand)` | silent no-op, see above |\n| `grid-cols-[max-content,auto]` | `grid-cols-[max-content_auto]` | comma is no longer read as a space |\n\n**Colors default to `currentColor`, not gray.** `border`, `divide-*` and `ring`\ninherit the text color in v4 rather than defaulting to `gray-200` \u002F `blue-500`.\nA bare `border` that looked right in v3 will follow the text color here, so name\nthe color: `border border-gray-200`.\n\n**Stacked variants read left to right.** v3 applied them right to left. `*:first:pt-0`\nin v4 is v3's `first:*:pt-0`. Only order-sensitive stacks are affected.\n\n**Class names must appear whole in the source.** Tailwind scans files as plain\ntext and never evaluates them, so `bg-${color}-600` generates nothing. Map props\nto complete class names. To force a class that never appears literally, use\n`@source inline(\"…\")` - the v4 replacement for `safelist`.\n\n**Dark mode by class is a variant override, not a config key.** There is no\n`darkMode: 'class'`:\n\n```css\n@custom-variant dark (&:where(.dark, .dark *));\n```\n\n**`@apply` in a Vue\u002FSvelte\u002FAstro `\u003Cstyle>` block or a CSS module needs\n`@reference`.** Those files are compiled separately and cannot see your theme, so\n`@apply text-brand` fails there. Add `@reference \"..\u002F..\u002Fapp.css\";` at the top of\nthe block, or just use `var(--color-brand)` and skip `@apply` entirely.\n\n**Do not add Sass, Less, or Stylus.** v4 is the preprocessor: it bundles\n`@import`, flattens nesting through Lightning CSS, and adds vendor prefixes. It is\nnot designed to run through another preprocessor.\n\n**Do not propose upgrading a v3 project without saying what it costs.** v4 requires\nSafari 16.4+, Chrome 111+, Firefox 128+ and depends on `@property` and\n`color-mix()`, so it does not degrade - it breaks on older browsers. A project on\nv3.4 may be there on purpose. v3 is still maintained (3.4.19 shipped 2025-12-10).\n\n## Picking the setup\n\n| Build tool | Package | Wiring |\n| --- | --- | --- |\n| Vite | `@tailwindcss\u002Fvite` | `plugins: [tailwindcss()]` in `vite.config` - preferred over PostCSS |\n| PostCSS | `@tailwindcss\u002Fpostcss` | the only plugin needed; drop `postcss-import` and `autoprefixer` |\n| CLI | `@tailwindcss\u002Fcli` | `npx @tailwindcss\u002Fcli -i in.css -o out.css` |\n| Webpack | `@tailwindcss\u002Fwebpack` | added in 4.2.0 |\n\nIn every case the stylesheet is `@import \"tailwindcss\";` and there is no\n`content` array - source detection is automatic, minus `.gitignore`d paths,\n`node_modules`, and binary and CSS files. Details and framework specifics in\n[setup.md](references\u002Fsetup.md).\n\n## Workflow\n\n1. **Read the injected version above.** Confirm `major` is 4, and note\n   `legacyJsConfig`.\n2. **Read the project's entry CSS** before editing anything. It carries the theme,\n   the custom variants, and the custom utilities that this project's classes\n   depend on. `node \"$TW4\" version` reports the path it found.\n3. **Match the project's existing conventions.** Look at how sibling components\n   name things and follow that rather than introducing a second pattern.\n4. **Verify every unfamiliar class** with `node \"$TW4\" check` before writing it,\n   and every class in the rename tables regardless of familiarity.\n5. **Check the version floor** in [version-floors.md](references\u002Fversion-floors.md)\n   for anything newer than 4.0.\n6. **Confirm the result compiles** by running the project's own build, not by\n   reading the class list.\n\n## Reference files\n\n- [version-delta.md](references\u002Fversion-delta.md) - everything v3 to v4: removed,\n  renamed, and changed-behavior utilities, with what still silently works\n- [theme.md](references\u002Ftheme.md) - `@theme`, the namespace table, overriding and\n  disabling defaults, and the shipped default values\n- [directives.md](references\u002Fdirectives.md) - every `@` directive and build-time\n  function, including the functional `@utility` value syntax\n- [variants.md](references\u002Fvariants.md) - the full variant list, stacking order,\n  custom variants, dark mode, container queries\n- [version-floors.md](references\u002Fversion-floors.md) - which v4 minor added which\n  utility, variant and directive\n- [setup.md](references\u002Fsetup.md) - install and wiring per build tool, and\n  migrating a v3 config to CSS\n- [gotchas.md](references\u002Fgotchas.md) - verified surprises that produce no error\n","# Tailwind CSS v4\n\n## What is actually installed here\n\n```json\n!`node -e \"const fs=require('fs'),pa=require('path');const up=(n)=>{let d=process.cwd();for(;;){const p=pa.join(d,'node_modules',n);if(fs.existsSync(p))return p;const q=pa.dirname(d);if(q===d)return null;d=q}};const v=(p)=>{try{return JSON.parse(fs.readFileSync(pa.join(p,'package.json'),'utf8')).version}catch(e){return null}};const tw=up('tailwindcss');if(!tw){console.log(JSON.stringify({installed:null,note:'no tailwindcss resolved from '+process.cwd()},null,2));process.exit(0)}const ver=v(tw);const integ={};for(const n of ['@tailwindcss\u002Fvite','@tailwindcss\u002Fpostcss','@tailwindcss\u002Fcli','@tailwindcss\u002Fwebpack','@tailwindcss\u002Ftypography','@tailwindcss\u002Fforms']){const d=up(n);if(d)integ[n]=v(d)}const cfg=['tailwind.config.js','tailwind.config.cjs','tailwind.config.mjs','tailwind.config.ts'].filter(f=>fs.existsSync(pa.join(process.cwd(),f)));console.log(JSON.stringify({installed:ver,major:parseInt(ver,10),integrations:integ,legacyJsConfig:cfg},null,2))\" 2>\u002Fdev\u002Fnull || echo '{\"installed\":null,\"note\":\"node unavailable or errored\"}'`\n```\n\nRead `installed` before doing anything else. It is the version on disk, which beats\nthe version anyone believes is in use.\n\n- **`major` is `4`** - this skill applies. Proceed, but read\n  [version-floors.md](references\u002Fversion-floors.md) before using anything added\n  after 4.0: a v4.0 project silently generates nothing for a 4.1 utility.\n- **`major` is `3`** - this skill does NOT apply. Say so and stop using it. Almost\n  every rule below is wrong for v3, starting with the config file.\n- **`installed` is `null`** - dependencies may not be installed, or you are not in\n  the project directory. Ask before assuming a version; do not guess from memory.\n- **`legacyJsConfig` is non-empty** - a `tailwind.config.js` is present. In v4 that\n  file does nothing unless a stylesheet names it with `@config`. See\n  [the silent failures](#the-four-silent-failures) below.\n\n## Verify the class, do not recall it\n\nTailwind ships no CLI that answers \"does this class exist\"; the compiler is\nreachable only through a Node API. This skill bundles the script that asks it.\n\nThe script lives in this skill's directory and your working directory is the\nuser's project, so resolve it once per session and reuse the variable.\n\n```bash\nTW4=$(ls -d ~\u002F.claude\u002Fskills\u002Ftailwind-v4\u002Fscripts\u002Ftw4.mjs \\\n            .claude\u002Fskills\u002Ftailwind-v4\u002Fscripts\u002Ftw4.mjs 2>\u002Fdev\u002Fnull | head -1)\n\nnode \"$TW4\" version                      # installed version, integrations, entry CSS\nnode \"$TW4\" check flex bg-brand card-pad # does each class exist here? exit 1 if not\nnode \"$TW4\" css text-shadow-lg           # the CSS a class compiles to\nnode \"$TW4\" variants                     # every variant this project can use\nnode \"$TW4\" search '^mask-'              # find classes by pattern\nnode \"$TW4\" theme '^--color-brand'       # resolved theme variables\n```\n\n`check` answers against **this project's** stylesheet, so a custom `@theme` color,\na project `@utility`, and a project `@custom-variant` all resolve. It exits 1 if\nany candidate is not a utility, so it works in a conditional. Run it before\nwriting an unfamiliar class, and always for anything in the rename tables.\n\nIf `$TW4` comes back empty the skill is installed elsewhere; fall back to the docs\nbelow rather than guessing.\n\n## The four silent failures\n\nv4 does not error on v3 input. It compiles, exits 0, and produces the wrong thing.\nThese four are the reason this skill exists, and all four are verified against\ntailwindcss 4.3.3:\n\n**1. `@tailwind base\u002Fcomponents\u002Futilities` produces an empty stylesheet.** Not a\nwarning, not an error - a 66-byte file containing only the license comment. The\nentire framework vanishes and the build succeeds. v4 imports as regular CSS:\n\n```css\n@import \"tailwindcss\";\n```\n\n**2. `tailwind.config.js` is ignored unless a stylesheet names it.** A v3 project\nwhose config carries the whole design system builds clean and drops all of it. If\nthe injected `legacyJsConfig` above is non-empty, check the entry CSS for\n`@config` before touching anything:\n\n```css\n@config \"..\u002F..\u002Ftailwind.config.js\";   \u002F* compatibility, not the v4 way *\u002F\n```\n\nThe v4 way is `@theme` in CSS. See [theme.md](references\u002Ftheme.md).\n`corePlugins`, `safelist`, and `separator` are not supported through `@config` at\nall - safelist with `@source inline(…)` instead.\n\n**3. `bg-[--brand]` compiles to `background-color: --brand`,** which is not a\nvalue and does nothing. v4 changed the CSS-variable shorthand from square\nbrackets to parentheses. `bg-(--brand)` is the one that emits `var(--brand)`.\nThe same trap applies to every utility, and there is no diagnostic.\n\n**4. A custom class in `@layer utilities` loses every variant.** In v3 that block\nregistered a real utility. In v4 it emits the bare rule and nothing else, so\n`hover:zorble` and `md:zorble` generate no CSS while `zorble` still works - which\nis what makes it hard to spot. Use `@utility`:\n\n```css\n\u002F* v3: hover:zorble and md:zorble silently produce nothing *\u002F\n@layer utilities { .zorble { outline-offset: 7px; } }\n\n\u002F* v4: all variants generated *\u002F\n@utility zorble { outline-offset: 7px; }\n```\n\n## Where the truth lives\n\nWork down this list. Stop at the first source that answers the question.\n\n**1. `node \"$TW4\" check` \u002F `css`.** Version-exact by construction, because it\ncompiles against the project's own installed Tailwind and its own stylesheet. Use\nit for any question of the form \"does this exist\" or \"what does this emit\".\n\n**2. The installed package's CSS.** `node_modules\u002Ftailwindcss\u002Ftheme.css` is the\ndefault theme - every `--color-*`, `--breakpoint-*`, `--spacing`, `--radius-*`,\n`--shadow-*` and so on, as shipped. `preflight.css` is the base reset.\n`index.css` shows the layer order the framework establishes. Read these rather\nthan recalling default values.\n\n**3. The reference files in this skill**, for the v3-to-v4 delta and the traps\nthat neither the types nor a build error will tell you.\n\n**4. The documentation site**, at `https:\u002F\u002Ftailwindcss.com\u002Fdocs\u002F\u003Cpage>`, for usage\nshape. It documents the **latest** v4 only - there is no per-version docs site, so\na page may describe a utility your installed version does not have. Confirm with\n`check` before using anything the page introduces. There is no `llms.txt`\n(`\u002Fllms.txt` returns 404), so read pages individually. The docs source is MDX at\n`github.com\u002Ftailwindlabs\u002Ftailwindcss.com` under `src\u002Fdocs\u002F`, which is easier to\nread than the rendered HTML.\n\n## Rules that prevent the common failures\n\n**Never write a `tailwind.config.js` for a v4 project.** Theme customization is\nCSS. Adding a color means adding a variable in the right namespace, and the\nutility comes with it:\n\n```css\n@import \"tailwindcss\";\n\n@theme {\n  --color-brand: oklch(0.7 0.2 200);   \u002F* creates bg-brand, text-brand, border-brand, … *\u002F\n  --breakpoint-3xl: 120rem;            \u002F* creates the 3xl:* variant *\u002F\n  --font-display: \"Satoshi\", sans-serif;\n}\n```\n\nThe namespace decides which utilities appear. Full table in\n[theme.md](references\u002Ftheme.md).\n\n**Check the class name before writing it.** v4 renamed the shadow, radius and blur\nscales by shifting every step, so `shadow-sm` in v4 is v3's `shadow` and looks\nvisibly different from v3's `shadow-sm` (now `shadow-xs`). `outline-none` changed\nmeaning rather than disappearing. Full tables in\n[version-delta.md](references\u002Fversion-delta.md); the ones that bite hardest:\n\n| If you are about to write | v4 wants | Why it matters |\n| --- | --- | --- |\n| `shadow-sm`, `rounded-sm`, `blur-sm` meaning the v3 value | `shadow-xs`, `rounded-xs`, `blur-xs` | compiles fine, renders bigger |\n| `outline-none` meaning \"invisible but focusable\" | `outline-hidden` | `outline-none` now really removes the outline |\n| `ring` meaning a 3px ring | `ring-3` | `ring` is 1px in v4 |\n| `bg-gradient-to-r` | `bg-linear-to-r` | old name still works, emits different interpolation |\n| `bg-opacity-50`, `text-opacity-50` | `bg-black\u002F50`, `text-black\u002F50` | the `*-opacity-*` utilities are gone |\n| `!flex` | `flex!` | old position still works but is deprecated |\n| `bg-[--brand]` | `bg-(--brand)` | silent no-op, see above |\n| `grid-cols-[max-content,auto]` | `grid-cols-[max-content_auto]` | comma is no longer read as a space |\n\n**Colors default to `currentColor`, not gray.** `border`, `divide-*` and `ring`\ninherit the text color in v4 rather than defaulting to `gray-200` \u002F `blue-500`.\nA bare `border` that looked right in v3 will follow the text color here, so name\nthe color: `border border-gray-200`.\n\n**Stacked variants read left to right.** v3 applied them right to left. `*:first:pt-0`\nin v4 is v3's `first:*:pt-0`. Only order-sensitive stacks are affected.\n\n**Class names must appear whole in the source.** Tailwind scans files as plain\ntext and never evaluates them, so `bg-${color}-600` generates nothing. Map props\nto complete class names. To force a class that never appears literally, use\n`@source inline(\"…\")` - the v4 replacement for `safelist`.\n\n**Dark mode by class is a variant override, not a config key.** There is no\n`darkMode: 'class'`:\n\n```css\n@custom-variant dark (&:where(.dark, .dark *));\n```\n\n**`@apply` in a Vue\u002FSvelte\u002FAstro `\u003Cstyle>` block or a CSS module needs\n`@reference`.** Those files are compiled separately and cannot see your theme, so\n`@apply text-brand` fails there. Add `@reference \"..\u002F..\u002Fapp.css\";` at the top of\nthe block, or just use `var(--color-brand)` and skip `@apply` entirely.\n\n**Do not add Sass, Less, or Stylus.** v4 is the preprocessor: it bundles\n`@import`, flattens nesting through Lightning CSS, and adds vendor prefixes. It is\nnot designed to run through another preprocessor.\n\n**Do not propose upgrading a v3 project without saying what it costs.** v4 requires\nSafari 16.4+, Chrome 111+, Firefox 128+ and depends on `@property` and\n`color-mix()`, so it does not degrade - it breaks on older browsers. A project on\nv3.4 may be there on purpose. v3 is still maintained (3.4.19 shipped 2025-12-10).\n\n## Picking the setup\n\n| Build tool | Package | Wiring |\n| --- | --- | --- |\n| Vite | `@tailwindcss\u002Fvite` | `plugins: [tailwindcss()]` in `vite.config` - preferred over PostCSS |\n| PostCSS | `@tailwindcss\u002Fpostcss` | the only plugin needed; drop `postcss-import` and `autoprefixer` |\n| CLI | `@tailwindcss\u002Fcli` | `npx @tailwindcss\u002Fcli -i in.css -o out.css` |\n| Webpack | `@tailwindcss\u002Fwebpack` | added in 4.2.0 |\n\nIn every case the stylesheet is `@import \"tailwindcss\";` and there is no\n`content` array - source detection is automatic, minus `.gitignore`d paths,\n`node_modules`, and binary and CSS files. Details and framework specifics in\n[setup.md](references\u002Fsetup.md).\n\n## Workflow\n\n1. **Read the injected version above.** Confirm `major` is 4, and note\n   `legacyJsConfig`.\n2. **Read the project's entry CSS** before editing anything. It carries the theme,\n   the custom variants, and the custom utilities that this project's classes\n   depend on. `node \"$TW4\" version` reports the path it found.\n3. **Match the project's existing conventions.** Look at how sibling components\n   name things and follow that rather than introducing a second pattern.\n4. **Verify every unfamiliar class** with `node \"$TW4\" check` before writing it,\n   and every class in the rename tables regardless of familiarity.\n5. **Check the version floor** in [version-floors.md](references\u002Fversion-floors.md)\n   for anything newer than 4.0.\n6. **Confirm the result compiles** by running the project's own build, not by\n   reading the class list.\n\n## Reference files\n\n- [version-delta.md](references\u002Fversion-delta.md) - everything v3 to v4: removed,\n  renamed, and changed-behavior utilities, with what still silently works\n- [theme.md](references\u002Ftheme.md) - `@theme`, the namespace table, overriding and\n  disabling defaults, and the shipped default values\n- [directives.md](references\u002Fdirectives.md) - every `@` directive and build-time\n  function, including the functional `@utility` value syntax\n- [variants.md](references\u002Fvariants.md) - the full variant list, stacking order,\n  custom variants, dark mode, container queries\n- [version-floors.md](references\u002Fversion-floors.md) - which v4 minor added which\n  utility, variant and directive\n- [setup.md](references\u002Fsetup.md) - install and wiring per build tool, and\n  migrating a v3 config to CSS\n- [gotchas.md](references\u002Fgotchas.md) - verified surprises that produce no error\n",{"name":5,"description":7,"allowed-tools":24},"Bash(node *tw4.mjs*), Bash(node -e *), Bash(ls -d *), Bash(curl -sS *)","main","c44baf9a298fde86d3ae736cbe21a6507b212259","home\u002F.claude\u002Fskills\u002Ftailwind-v4","https:\u002F\u002Fgithub.com\u002Fdavner\u002Fdotfiles","https:\u002F\u002Fgithub.com\u002Fdavner","www.danavner.com","2026-11-14 18:56:59",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add davner\u002Fdotfiles --skill tailwind-v4",{"tool":38,"command":39},"bunx","bunx skills add davner\u002Fdotfiles --skill tailwind-v4",{"tool":41,"command":42},"pnpm","pnpm dlx skills add davner\u002Fdotfiles --skill tailwind-v4","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdavner\u002Fdotfiles\u002Fblob\u002Fmain\u002Fhome\u002F.claude\u002Fskills\u002Ftailwind-v4\u002FSKILL.md",true,[46,52,56,60,64,68,72,76,80],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"README.md","REFERENCE","参考文档",3760,"https:\u002F\u002Fgithub.com\u002Fdavner\u002Fdotfiles\u002Fblob\u002Fmain\u002Fhome\u002F.claude\u002Fskills\u002Ftailwind-v4\u002FREADME.md",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"references\u002Fdirectives.md",6428,"https:\u002F\u002Fgithub.com\u002Fdavner\u002Fdotfiles\u002Fblob\u002Fmain\u002Fhome\u002F.claude\u002Fskills\u002Ftailwind-v4\u002Freferences\u002Fdirectives.md",{"path":57,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Fgotchas.md",6452,"https:\u002F\u002Fgithub.com\u002Fdavner\u002Fdotfiles\u002Fblob\u002Fmain\u002Fhome\u002F.claude\u002Fskills\u002Ftailwind-v4\u002Freferences\u002Fgotchas.md",{"path":61,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":62,"sourceHtmlUrl":63},"references\u002Fsetup.md",5136,"https:\u002F\u002Fgithub.com\u002Fdavner\u002Fdotfiles\u002Fblob\u002Fmain\u002Fhome\u002F.claude\u002Fskills\u002Ftailwind-v4\u002Freferences\u002Fsetup.md",{"path":65,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":66,"sourceHtmlUrl":67},"references\u002Ftheme.md",5713,"https:\u002F\u002Fgithub.com\u002Fdavner\u002Fdotfiles\u002Fblob\u002Fmain\u002Fhome\u002F.claude\u002Fskills\u002Ftailwind-v4\u002Freferences\u002Ftheme.md",{"path":69,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":70,"sourceHtmlUrl":71},"references\u002Fvariants.md",4401,"https:\u002F\u002Fgithub.com\u002Fdavner\u002Fdotfiles\u002Fblob\u002Fmain\u002Fhome\u002F.claude\u002Fskills\u002Ftailwind-v4\u002Freferences\u002Fvariants.md",{"path":73,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":74,"sourceHtmlUrl":75},"references\u002Fversion-delta.md",7394,"https:\u002F\u002Fgithub.com\u002Fdavner\u002Fdotfiles\u002Fblob\u002Fmain\u002Fhome\u002F.claude\u002Fskills\u002Ftailwind-v4\u002Freferences\u002Fversion-delta.md",{"path":77,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":78,"sourceHtmlUrl":79},"references\u002Fversion-floors.md",4167,"https:\u002F\u002Fgithub.com\u002Fdavner\u002Fdotfiles\u002Fblob\u002Fmain\u002Fhome\u002F.claude\u002Fskills\u002Ftailwind-v4\u002Freferences\u002Fversion-floors.md",{"path":81,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":84,"sourceHtmlUrl":85},"scripts\u002Ftw4.mjs","SCRIPT","脚本",9733,"https:\u002F\u002Fgithub.com\u002Fdavner\u002Fdotfiles\u002Fblob\u002Fmain\u002Fhome\u002F.claude\u002Fskills\u002Ftailwind-v4\u002Fscripts\u002Ftw4.mjs",[87,94,101,108,115,122],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M7DZZNP2P15106XMWHD3CECC","autopilot","Run the new-work flow, idea or board item to reviewed code, with nobody watching.","https:\u002F\u002Fgithub.com\u002Fdavner\u002Fdotfiles\u002Fblob\u002Fmain\u002Fhome\u002F.claude\u002Fskills\u002Fautopilot\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":19},"01M79SEZ2QHSN3YHPP1833ZPPT","writing-for-agents","Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.","https:\u002F\u002Fgithub.com\u002Fdavner\u002Fdotfiles\u002Fblob\u002Fmain\u002Fhome\u002F.claude\u002Fskills\u002Fwriting-for-agents\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":19},"01M79SEW9SFQ2AF5255M2S0PV0","to-tickets","Break a plan, spec, or the current conversation into tracer-bullet tickets grouped into the fewest PRs, each ticket with its blocking edges and first red test, saved as one local file per ticket.","https:\u002F\u002Fgithub.com\u002Fdavner\u002Fdotfiles\u002Fblob\u002Fmain\u002Fhome\u002F.claude\u002Fskills\u002Fto-tickets\u002FSKILL.md",[],[],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":19},"01M79SET6W048SZACE3Z3JE0QK","to-spec","Turn the current conversation into a spec saved locally as the reference the agents build from: no interview, just synthesis of what you've already discussed.","https:\u002F\u002Fgithub.com\u002Fdavner\u002Fdotfiles\u002Fblob\u002Fmain\u002Fhome\u002F.claude\u002Fskills\u002Fto-spec\u002FSKILL.md",[],[],{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":19},"01M79SEQTSNJFS3HSCV44FKT9X","teach","Teach the user a new skill or concept, within this workspace.","https:\u002F\u002Fgithub.com\u002Fdavner\u002Fdotfiles\u002Fblob\u002Fmain\u002Fhome\u002F.claude\u002Fskills\u002Fteach\u002FSKILL.md",[],[],{"skillNo":123,"name":124,"nameZh":6,"description":125,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":126,"categories":127,"keywords":128,"publishedAt":19},"01M79SENJJCBBA37FAHQKZZTS4","tdd","Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions \"red-green-refactor\", or wants integration tests.","https:\u002F\u002Fgithub.com\u002Fdavner\u002Fdotfiles\u002Fblob\u002Fmain\u002Fhome\u002F.claude\u002Fskills\u002Ftdd\u002FSKILL.md",[],[]]