tailwind-shadcn
Skill1 starsChanged 5 months agoMITView on GitHub
Implements the design system on a Next.js 16 frontend — Tailwind v4 CSS-first theming with @theme and OKLCH CSS variables, semantic surface/-foreground token pairs, light plus .dark sets, and shared shadcn/ui components extended via cva. Use when implementing an approved screen or component, adding or restyling a component, turning token roles into @theme CSS variables, wiring dark mode, coding a button/badge variant, or asking how theming works here. Not for deciding which tokens, component variants and patterns should exist — the system's definition and governance (see design-system), page/route structure or data fetching (see nextjs-module), or RTL and logical-property direction handling (see i18n-rtl).
In this repository49 other files it gives its agents.
- accessibilitySkill
- ai-evalsSkill
- ai-integrationSkill
- architecture-decisionsSkill
- audit-loggingSkill
- aws-servicesSkill
- browser-e2e-testingSkill
- celery-tasksSkill
- changelogSkill
- ci-cdSkill
- codebase-guideSkill
- code-reviewSkill
- commit-messageSkill
- cookie-auth-csrfSkill
- dashboard-data-designSkill
- db-concurrencySkill
- debugSkill
- dependency-auditSkill
- deploy-awsSkill
- design-systemSkill
- drf-apiSkill
- drf-zod-contractSkill
- frontend-perfSkill
- git-workflowSkill
- i18n-rtlSkill
- incident-responseSkill
- migrationsSkill
- money-decimalSkill
- multi-tenancySkill
- nextjs-moduleSkill
- observabilitySkill
- perf-reviewSkill
- production-readinessSkill
- product-ux-designSkill
- rbac-permissionsSkill
- react-querySkill
- security-reviewSkill
- skill-authoringSkill
- tenant-session-switchSkill
- threat-modelingSkill
- verifySkill
- version-checkSkill
- visual-ui-designSkill
- webhook-handlerSkill
- websockets-channelsSkill
- write-testsSkill
- zod-formsSkill
- zustand-stateSkill
- example-skillSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 22
Reuse the shared shadcn component; extend it with
cva: Add a variant to the existing component instead of forking a new one, so every … - Very specific: line 61
No hardcoded hex/rgb/hsl in components and no arbitrary bg-[#...] — that value can't follow the theme into dark mode.
- Very specific: line 65
Don't reintroduce tailwind.config.js colors alongside @theme.
- Very specific: line 68
Use logical utilities (ms-, me-, ps-, pe-) not ml-/pl- so RTL works (see i18n-rtl).
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Tailwind + shadcn/ui (implementing the design system)
When to use
Styling anything on the frontend: adding a component, restyling one, coding a
color or spacing token, wiring dark mode, or adding a variant. The rule of thumb —
reach for a token and a shared component before writing raw CSS or a new one-off.
Which roles, variants, and patterns should exist is decided upstream in
design-system; this skill turns those decisions into working code.
Pattern
Two invariants:
- Colors and spacing are tokens, never raw values. Define them once as OKLCH
CSS variables in
@theme, in semanticsurface/surface-foregroundpairs, with a light set on:rootand a dark override on.dark. No hex, nohsl(), notailwind.config.jscolor map — Tailwind v4 is CSS-first. - Reuse the shared shadcn component; extend it with
cva. Add a variant to the existing component instead of forking a new one, so every button/badge stays in sync.
Declare tokens CSS-first in your global stylesheet — semantic names, OKLCH, each
paired with a -foreground; the .dark block overrides the same names:
/* app/globals.css */
@import "tailwindcss";
@theme {
--color-surface: oklch(1 0 0); /* page background */
--color-surface-foreground: oklch(0.21 0.01 285);
--color-primary: oklch(0.62 0.19 259); /* brand */
--color-primary-foreground: oklch(0.98 0 0);
--radius-lg: 0.5rem;
}
.dark {
--color-surface: oklch(0.21 0.01 285); /* same names, dark values */
--color-surface-foreground: oklch(0.98 0 0);
}These generate utilities automatically — bg-surface, text-surface-foreground,
bg-primary, rounded-lg. Toggle dark mode by putting .dark on <html>.
Extend the shared shadcn component with cva rather than forking one: define a
cva(base, { variants, defaultVariants }) map keyed on token utilities only
(e.g. bg-primary text-primary-foreground for a variant, h-8 px-3 for a size),
export its VariantProps as the component's prop type, and consume it in markup with
className={button({ variant: "ghost" })}. Never inline a hex or a magic px value.
Adapt to your repo
Rename the semantic tokens to your palette (surface, primary, accent, muted,
destructive, border) and pick real OKLCH values — keep the -foreground pairing and
the light/.dark split. Confirm your globals.css uses @import "tailwindcss" and
@theme (v4), not a legacy tailwind.config.js theme.extend.colors. If shadcn's CLI
scaffolded HSL variables, migrate them to OKLCH once, centrally.
Gotchas
- No hardcoded hex/
rgb/hslin components and no arbitrarybg-[#...]— that value can't follow the theme into dark mode. Only tokens flip. - A color used without a matching
-foregroundfails contrast in one mode — always define and use the pair. - Don't reintroduce
tailwind.config.jscolors alongside@theme; pick CSS-first and keep tokens in one place, or the two drift. - Extend the shared component; a forked
MyButtonskips future token/a11y fixes. - Use logical utilities (
ms-,me-,ps-,pe-) notml-/pl-so RTL works (seei18n-rtl).
See also
design-systemnextjs-modulei18n-rtl
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.

