<< All versions

Skill v1.0.0

currentAutomated scan100/100
leahycc/claude-skills/tailwind-design-system
──Details
PublishedNovember 16, 2026 at 10:55 PM
Content Hashsha256:421694c156011bf5...
Git SHA0249d82592a8
──Files
Files (1 file, 11.2 KB)
SKILL.md11.2 KBactive
SKILL.md · 128 lines · 11.2 KB

name: tailwind-design-system description: > Builds and maintains design systems on Tailwind CSS v4 for large codebases and dedicated design system repos. Token tiers mapped onto :root, @theme and @theme inline, closed scales, OKLCH palettes with measured WCAG contrast, dark mode, brands and density, component APIs with cva or tailwind-variants and a configured cn, monorepo packages where the system owns its @source, npm versus shadcn registries, lint rules and CI budgets that stop drift, Storybook visual and a11y tests, semver, token and component deprecation, docs, and migrating many apps from v3 and raw classes to tokens. Ships a contrast-checked starter theme and scripts that inspect a repo, measure contrast and count off-system classes. Use when creating or changing a design system, theme, tokens, a shared UI package, or the rules apps follow to use one. Not for styling one page or one-off visual design, a full WCAG audit (wcag-accessibility), or React rendering speed (react-performance). metadata: version: "1.0.0"


Tailwind design system

How to build a design system on Tailwind CSS v4 that many teams and many apps can use for years: one place to change a value, themes that swap at runtime, components that carry their own accessibility, and machines that stop drift. Checked against Tailwind 4.3.3. If inspect.mjs shows a newer version, check its changelog before relying on version-specific notes here.

The system is the tokens and the rules, not the components. Components are the easy part to copy. What makes a system hold at scale is a closed set of semantic tokens, and lint and CI that make going around them harder than using them.

Measure, never assume. Contrast is computed, classes are compiled, versions are read from the repo. Sources and check dates: SOURCES.md.

Procedure

  1. Run node scripts/inspect.mjs from the repo root. It prints the installed Tailwind and related versions, every CSS entry with its @source lines, @theme blocks, dark variant and token counts, surfaces without a foreground token, and v3 leftovers. Work from that, not from memory.
  2. Find the task in the table below and read that resource.
  3. New system: copy templates/theme.css, then change values, not structure.
  4. Make the change.
  5. Verify, and report each result:
  • The app or Storybook builds.
  • node scripts/check-contrast.mjs <theme files> passes, after any token change.
  • The Tailwind lint config passes, or node scripts/audit-classes.mjs <dirs> shows counts did not rise.
text
tokens (DTCG JSON, optional)
│ generate
▼
theme.css ── primitives :root --palette-* never classes
── semantic :root, dark, --primary swapped per theme
brand blocks
── utility map @theme inline --color-primary the public classes
── scales @theme --text-sm closed with --*: initial
── @source "./components" the package says where its classes live
│ @import "@acme/ui/theme.css"
▼
app.css @import "tailwindcss"; one Tailwind build per app
│
▼
lint + audit budgets + contrast + visual and a11y tests in CI

Where to read

TaskResource
Token tiers, where each lives, @theme vs @theme inline vs @theme static, closing scales, naming, property-scoped colours, DTCG, Terrazzo, Figmatokens.md
OKLCH palettes, surface and text pairs, measuring contrast, derived states, dark mode switch, brands, nested themes, high contrast, forced colours, chart colourscolor-and-themes.md
Type scale and text styles, spacing and density, control heights, radius, elevation, motion, z-index layers, breakpoints and container queriesscales.md
@utility, @custom-variant, @variant, @apply policy, @source inline, @reference, plugins on v4extending-tailwind.md
Component anatomy, variants with cva or tailwind-variants, configuring cn, the className contract, styling from ARIA and data attributes, Base UI, Radix and React Aria, accessibility each component ownscomponents.md
Repo layout, package boundaries, the package owning its @source, three shipping models, exports, cascade layers, monorepo tools, editor and Prettier setuparchitecture.md
npm package vs shadcn registry, registry:base and registry:theme, private and GitHub registries, versioning a registrydistribution.md
Closed scales, the lint config, budgets that only go down, contrast in CI, visual regression, axe in Storybook, the CI pipelineenforcement.md
Semver and Changesets, what counts as breaking, deprecating tokens, components and props, lifecycle stages, contribution, ADRs, adoption metricsgovernance.md
Diataxis for systems, the component page, token docs, generated reference, docs for coding agentsdocumentation.md
v3 to v4 with the upgrade tool, silent renames, JS config to CSS, moving apps from raw classes to tokens, many apps in sequencemigration.md

Defaults, unless the repo has already decided

DecisionDefaultWhy
Token tiersPrimitives in :root, semantic in :root and mode blocks, utility map in @theme inlinePrimitives cannot become classes. Nested themes flip.
Colour namesshadcn's contract (primary, primary-foreground, muted-foreground, border, input, ring) plus your rolesRegistry components drop in themed
Default paletteClosed: --color-*: initialRaw palette classes stop compiling
Dark mode@custom-variant dark (&:where([data-theme="dark"], [data-theme="dark"] *));Zero specificity, room for data-brand and data-density
ShippingSource in a package, each app compiles, the package's theme declares its own @sourceOne Tailwind build per app, apps never hard-code the system's folders
Variantsclass-variance-authority 0.7.1, or tailwind-variants for multi-part componentsEcosystem default, and slots where they pay off
Mergingtailwind-merge 3 or cn 0.5, configured once in the system with every custom keyUnregistered keys merge wrong in silence
Primitive libraryWhatever the system already uses. New: Base UI (shadcn's default) or React Aria.Never hand-build menu, dialog or combobox behaviour
Linteslint-plugin-better-tailwindcss with entryPoint, unknown, conflicting and restricted classesTurns closed scales into errors with autofix
VersioningChangesets, core packages fixed to one versionOne number per bug report
Contrast barWCAG 2.2 AA, 4.5:1 text, 3:1 control boundaries and focusWCAG 3 has no contrast algorithm yet. APCA is not a conformance target.

Traps

SymptomCauseFix
Classes used only inside the shared UI package are missing in productionTailwind skips node_modules, so the app never scans the package@source "./components"; in the package's theme file (architecture.md)
A dark band or brand panel does not change colourSemantic colours mapped in plain @theme, resolved once at :root@theme inline (tokens.md)
cn() drops a colour next to a custom text sizetailwind-merge and cn do not read @theme, and treat text-heading as a colourRegister custom keys, or name text styles type-* (components.md)
bg-blue-500 renders nothingThe palette is closed, as intendedUse the semantic token. Lint's unknown-class rule makes this an error.
A class built with a template string never appearsTailwind reads files as text and never sees bg-${tone}A map of complete class strings (extending-tailwind.md)
A custom utility changed after a Tailwind upgradeCore added the same name (tab-* in 4.3)Prefix system utilities
@apply fails in a CSS module or a Vue or Svelte style blockThat file is compiled without the theme@reference the theme, or plain var()
Every system token is "unknown" in lintNo entryPoint, or a shared config's cwd pointing at the shared packagePass entryPoint and cwd: import.meta.dirname from each app (enforcement.md)
Prettier sorts classes oddly or ignores tokensNo tailwindStylesheet, or one root config for several appsOne config per package, pointed at a file that imports Tailwind
Utilities cannot override a system component's CSSSystem CSS is unlayered@layer components and :where() (architecture.md)
A density mode changes nothing--spacing defined in @theme inline, so the value is baked inPlain @theme (scales.md)
Borders turned dark after upgrading to v4v4's default border colour is currentColorA base rule setting border-color: var(--color-border)
The focus ring fails 3:1outline-ring/50, a faded ringFull-strength ring with an offset
The page flashes light before darkThe theme attribute is set after first paintAn inline script in <head> (color-and-themes.md)
Contrast passes on the page but fails in a cardmuted-foreground measured only on backgroundMeasure every surface it sits on

Review checklist

  • [ ] inspect.mjs output is in the PR or the report, with the Tailwind version
  • [ ] Primitives are not in @theme. Semantic colours go through @theme inline.
  • [ ] --color-* is closed, and other scales the system owns are closed
  • [ ] Every surface token has a -foreground partner, and check-contrast.mjs passes in every mode and brand
  • [ ] No raw palette classes, arbitrary values, dark: colour overrides or !important in app code, enforced by lint
  • [ ] Components use semantic classes only, take variants as typed props, and merge className last through the system's cn
  • [ ] Custom theme keys are registered with the merge config
  • [ ] The UI package's theme declares its @source, and exports serves theme.css with the style condition
  • [ ] System CSS is in a layer, with :where() selectors
  • [ ] Focus is visible at 3:1, targets are at least 24px, reduced motion is respected, in the components themselves
  • [ ] Breaking changes ship with a major, a changeset, and a codemod or autofix rule
  • [ ] Deprecated tokens are aliases with a removal version and a lint warning

Related skills

Accessibility criteria in full: wcag-accessibility. Types for component props and variant maps: typescript-safety. Writing the docs pages: plain-docs. Button and error text: ux-copy.

All versions