tailwind-design-system
Skill3 starsChanged 8 months agoMITView on GitHub
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).
33 other projects use a version of this.
Adopted by
Most recently taken up by
- JustinWangJP/cc-agent-teams-action-monitortheir own version, first seen Nov 8, 2026
- OpenMontageInc/OpenMontagetheir own version, first seen Nov 8, 2026
- calesthio/OpenMontagetheir own version, first seen Nov 8, 2026
- The-AIOS/aiostheir own version, first seen Nov 3, 2026
- JuankCadavid/akili-specstheir own version, first seen Nov 2, 2026
- naman10parikh/pixeltheir own version, first seen Oct 25, 2026
Used with
Projects with it also use bfl-api, flux-best-practices and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
LinHao-citySkillbfl-api
BFL FLUX API integration guide covering endpoints, async polling patterns, rate limiting, error handling, webhooks, and regional endpoints with Python and TypeScript code examples.
Also in 3 projects that use this
LinHao-citySkillflux-best-practices
Comprehensive guide for BFL FLUX image generation models. Covers prompting, T2I, I2I, structured JSON, hex colors, typography, multi-reference editing, and model-specific best practices for FLUX.2 and FLUX.1 families.
Also in 3 projects that use this
dAAAbSkillheygen
Also in 3 projects that use this
MoizIbnYousafSkillvisual-style
Build a persistent visual brand identity for image generation. Defines how the brand looks visually — aesthetic, lighting, composition, mood — and writes it to brand/creative-kit.md so /image-gen and other creative skills produce consistent on-brand visuals. Three modes: Extract (from website/URL), Build (interview), Reference (mood board/examples). Use when starting any project that needs images, when the user says "visual style", "brand aesthetic", "image style", "visual identity", "how should our images look", "build visual brand", "define our look", or when /image-gen outputs feel generic because no visual style exists yet.
Also in 3 projects that use this
- +8 more from LinHao-city
Other versions33 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 33
- calesthio/OpenMontage★ 78ksame name
- OpenMontageInc/OpenMontage★ 78ksame name
- The-AIOS/aios★ 105same name
- RodrigoTomeES/getmcp★ 13same name
- wpank/ai★ 11same name
- JuankCadavid/akili-specs★ 10same name
- LinHao-city/StoryMind★ 10same name
- xfstudio/skills★ 9same name
- HK-hub/AgentSkills★ 6same name
- JustinWangJP/cc-agent-teams-action-monitor★ 6same name
23 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository17 other files it gives its agents.
- api-securitySkill
- ascii-artSkill
- code-readabilitySkill
- gotchasSkill
- llm-agent-securitySkill
- nextjs-app-routerSkill
- plain-docsSkill
- product-marketingSkill
- prompt-rewriteSkill
- react-performanceSkill
- react-testingSkill
- seoSkill
- spa-performanceSkill
- typescript-safetySkill
- ux-copySkill
- wcag-accessibilitySkill
- webgpuSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.
0
Common
Most of the 10 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 29
Run node scripts/inspect.mjs from the repo root.
- Distinctive: line 33
Verify, and report each result:
“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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
- Run
node scripts/inspect.mjsfrom the repo root. It prints the installed Tailwind and related versions, every CSS entry with its@sourcelines,@themeblocks, dark variant and token counts, surfaces without a foreground token, and v3 leftovers. Work from that, not from memory. - Find the task in the table below and read that resource.
- New system: copy templates/theme.css, then change values, not structure.
- Make the change.
- 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.
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 CIWhere to read
| Task | Resource |
Token tiers, where each lives, @theme vs @theme inline vs @theme static, closing scales, naming, property-scoped colours, DTCG, Terrazzo, Figma | tokens.md |
| OKLCH palettes, surface and text pairs, measuring contrast, derived states, dark mode switch, brands, nested themes, high contrast, forced colours, chart colours | color-and-themes.md |
| Type scale and text styles, spacing and density, control heights, radius, elevation, motion, z-index layers, breakpoints and container queries | scales.md |
@utility, @custom-variant, @variant, @apply policy, @source inline, @reference, plugins on v4 | extending-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 owns | components.md |
Repo layout, package boundaries, the package owning its @source, three shipping models, exports, cascade layers, monorepo tools, editor and Prettier setup | architecture.md |
npm package vs shadcn registry, registry:base and registry:theme, private and GitHub registries, versioning a registry | distribution.md |
| Closed scales, the lint config, budgets that only go down, contrast in CI, visual regression, axe in Storybook, the CI pipeline | enforcement.md |
| Semver and Changesets, what counts as breaking, deprecating tokens, components and props, lifecycle stages, contribution, ADRs, adoption metrics | governance.md |
| Diataxis for systems, the component page, token docs, generated reference, docs for coding agents | documentation.md |
| v3 to v4 with the upgrade tool, silent renames, JS config to CSS, moving apps from raw classes to tokens, many apps in sequence | migration.md |
Defaults, unless the repo has already decided
| Decision | Default | Why |
| Token tiers | Primitives in :root, semantic in :root and mode blocks, utility map in @theme inline | Primitives cannot become classes. Nested themes flip. |
| Colour names | shadcn's contract (primary, primary-foreground, muted-foreground, border, input, ring) plus your roles | Registry components drop in themed |
| Default palette | Closed: --color-*: initial | Raw 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 |
| Shipping | Source in a package, each app compiles, the package's theme declares its own @source | One Tailwind build per app, apps never hard-code the system's folders |
| Variants | class-variance-authority 0.7.1, or tailwind-variants for multi-part components | Ecosystem default, and slots where they pay off |
| Merging | tailwind-merge 3 or cn 0.5, configured once in the system with every custom key | Unregistered keys merge wrong in silence |
| Primitive library | Whatever the system already uses. New: Base UI (shadcn's default) or React Aria. | Never hand-build menu, dialog or combobox behaviour |
| Lint | eslint-plugin-better-tailwindcss with entryPoint, unknown, conflicting and restricted classes | Turns closed scales into errors with autofix |
| Versioning | Changesets, core packages fixed to one version | One number per bug report |
| Contrast bar | WCAG 2.2 AA, 4.5:1 text, 3:1 control boundaries and focus | WCAG 3 has no contrast algorithm yet. APCA is not a conformance target. |
Traps
| Symptom | Cause | Fix |
| Classes used only inside the shared UI package are missing in production | Tailwind 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 colour | Semantic colours mapped in plain @theme, resolved once at :root | @theme inline (tokens.md) |
cn() drops a colour next to a custom text size | tailwind-merge and cn do not read @theme, and treat text-heading as a colour | Register custom keys, or name text styles type-* (components.md) |
bg-blue-500 renders nothing | The palette is closed, as intended | Use the semantic token. Lint's unknown-class rule makes this an error. |
| A class built with a template string never appears | Tailwind 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 upgrade | Core added the same name (tab-* in 4.3) | Prefix system utilities |
@apply fails in a CSS module or a Vue or Svelte style block | That file is compiled without the theme | @reference the theme, or plain var() |
| Every system token is "unknown" in lint | No entryPoint, or a shared config's cwd pointing at the shared package | Pass entryPoint and cwd: import.meta.dirname from each app (enforcement.md) |
| Prettier sorts classes oddly or ignores tokens | No tailwindStylesheet, or one root config for several apps | One config per package, pointed at a file that imports Tailwind |
| Utilities cannot override a system component's CSS | System CSS is unlayered | @layer components and :where() (architecture.md) |
| A density mode changes nothing | --spacing defined in @theme inline, so the value is baked in | Plain @theme (scales.md) |
| Borders turned dark after upgrading to v4 | v4's default border colour is currentColor | A base rule setting border-color: var(--color-border) |
| The focus ring fails 3:1 | outline-ring/50, a faded ring | Full-strength ring with an offset |
| The page flashes light before dark | The theme attribute is set after first paint | An inline script in <head> (color-and-themes.md) |
| Contrast passes on the page but fails in a card | muted-foreground measured only on background | Measure every surface it sits on |
Review checklist
inspect.mjsoutput 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
-foregroundpartner, andcheck-contrast.mjspasses in every mode and brand - No raw palette classes, arbitrary values,
dark:colour overrides or!importantin app code, enforced by lint - Components use semantic classes only, take variants as typed props, and merge
classNamelast through the system'scn - Custom theme keys are registered with the merge config
- The UI package's theme declares its
@source, andexportsservestheme.csswith thestylecondition - 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.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

