UI Theme Reference
Configurable design token registry used by ui-best-practices rules.
Every hardcoded value in the best practices MUST reference a token defined here.
To customize: override values below or generate via /pwdev-uiux:theme create.
How to Use
Rules in the ui-best-practices skill reference tokens as theme.<section>.<token>.
When implementing, map these tokens to your stack:
| Stack |
Token format |
File |
| shadcn-vue |
hsl(var(--<token>)) |
src/assets/index.css |
| shadcn-react |
hsl(var(--<token>)) |
src/app/globals.css |
| primevue |
var(--p-<token>) |
src/assets/theme.css |
| tailwind-only |
Tailwind config theme.extend |
tailwind.config.ts |
| custom |
Any CSS variable scheme |
project-specific |
1. Colors
1.1 Surfaces
| Token |
Light |
Dark |
Usage |
--background |
#F9FAFB · 210 20% 98% |
#0A0F1A · 222 84% 5% |
Page background |
--foreground |
#1D2939 · 220 26% 16% |
#F0F4F8 · 210 40% 96% |
Primary text |
--card |
#FFFFFF · 0 0% 100% |
#111827 · 222 47% 11% |
Card / surface background |
--card-foreground |
#1D2939 · 220 26% 16% |
#F0F4F8 · 210 40% 96% |
Text on cards |
--popover |
#FFFFFF · 0 0% 100% |
#111827 · 222 47% 11% |
Popover / dropdown bg |
--popover-foreground |
#1D2939 · 220 26% 16% |
#F0F4F8 · 210 40% 96% |
Text on popovers |
1.2 Text Hierarchy
| Token |
Light |
Dark |
Usage |
--foreground |
#1D2939 |
#F0F4F8 |
Primary text, headings |
--muted-foreground |
#667085 |
#94A3B8 |
Secondary text, labels, placeholders |
1.3 Interactive
| Token |
Light |
Dark |
Usage |
--primary |
brand color |
brand color (adjusted) |
Buttons, links, focus rings |
--primary-foreground |
#FFFFFF |
#FFFFFF |
Text on primary backgrounds |
--secondary |
#F1F5F9 |
#1E293B |
Secondary buttons, subtle actions |
--secondary-foreground |
#1D2939 |
#F0F4F8 |
Text on secondary backgrounds |
--accent |
#F1F5F9 |
#1E293B |
Hover highlights, active states |
--accent-foreground |
#1D2939 |
#F0F4F8 |
Text on accent backgrounds |
1.4 Feedback
| Token |
Light |
Dark |
Usage |
--success |
#039855 |
#34D399 |
Positive states, confirmations |
--success-foreground |
#FFFFFF |
#022C22 |
Text on success backgrounds |
--warning |
#F79009 |
#FBBF24 |
Alerts, caution states |
--warning-foreground |
#422006 |
#422006 |
Text on warning backgrounds |
--destructive |
#D92D20 |
#FCA5A5 |
Errors, delete actions |
--destructive-foreground |
#FFFFFF |
#450A0A |
Text on destructive backgrounds |
--info |
#2563EB |
#60A5FA |
Informational, tips |
--info-foreground |
#FFFFFF |
#172554 |
Text on info backgrounds |
1.5 Structure
| Token |
Light |
Dark |
Usage |
--border |
#EAECF0 |
#1E293B |
Dividers, separators |
--input |
#D0D5DD |
#334155 |
Input borders |
--ring |
primary |
primary |
Focus ring color |
--muted |
#F1F5F9 |
#1E293B |
Muted backgrounds (badges, tags) |
1.6 Reserved Semantic Colors
These colors carry universal meaning. Never repurpose them for decorative or categorical use:
| Color |
Meaning |
Allowed usage |
Green (--success) |
Good / positive / complete |
Success states, positive KPIs, completion |
Orange (--warning) |
Caution / attention needed |
Warnings, pending actions, approaching limits |
Red (--destructive) |
Bad / error / danger |
Errors, failures, destructive actions, negative KPIs |
For categorical/chart colors, use the chart palette below.
1.7 Chart Palette
Dedicated colors for data visualization — independent from feedback semantics:
| Token |
Default |
Usage |
--chart-1 |
#2563EB |
Primary data series |
--chart-2 |
#7C3AED |
Secondary data series |
--chart-3 |
#0891B2 |
Tertiary data series |
--chart-4 |
#C026D3 |
Fourth data series |
--chart-5 |
#EA580C |
Fifth data series |
--chart-muted |
#D1D5DB |
De-emphasized / comparison series |
2. Typography
2.1 Font Stack
| Token |
Default |
Fallbacks |
--font-sans |
Inter |
system-ui, -apple-system, sans-serif |
--font-mono |
JetBrains Mono |
ui-monospace, monospace |
2.2 Type Scale
Progressive scale — adjacent levels must not skip more than one step:
| Token |
Size |
Line Height |
Weight |
Usage |
--text-xs |
12px |
16px |
400 |
Footnotes, badges, captions (minimum allowed) |
--text-sm |
14px |
20px |
400 |
Default body text, form labels |
--text-base |
16px |
24px |
400 |
Emphasized body, card titles |
--text-lg |
18px |
28px |
500 |
Section headings |
--text-xl |
20px |
28px |
600 |
Page sub-titles |
--text-2xl |
24px |
32px |
600 |
Page titles |
--text-3xl |
30px |
36px |
700 |
Hero headings |
--text-4xl |
36px |
40px |
700 |
Display / marketing headings |
Constraint: never jump more than 2 steps between adjacent text elements (e.g., text-3xl → text-sm is forbidden; use text-3xl → text-xl → text-base → text-sm).
2.3 Font Weight Scale
| Token |
Value |
Usage |
--font-normal |
400 |
Body text |
--font-medium |
500 |
Labels, nav items |
--font-semibold |
600 |
Headings, emphasis |
--font-bold |
700 |
Hero, display text |
3. Spacing
Base unit: 4px. All spacing must be a multiple of 4.
| Token |
Value |
Tailwind |
Typical Usage |
--space-0.5 |
2px |
gap-0.5 |
Micro adjustments only |
--space-1 |
4px |
gap-1 |
Icon ↔ label gap |
--space-1.5 |
6px |
gap-1.5 |
Compact inline gap |
--space-2 |
8px |
gap-2 |
Internal gap, small padding |
--space-3 |
12px |
gap-3 |
Badge padding, compact lists |
--space-4 |
16px |
gap-4, p-4 |
Default card padding (min) |
--space-5 |
20px |
gap-5 |
Medium card padding |
--space-6 |
24px |
gap-6, p-6 |
Default card padding (max), section gaps |
--space-8 |
32px |
gap-8, p-8 |
Large section padding |
--space-10 |
40px |
gap-10 |
Page-level vertical spacing |
--space-12 |
48px |
gap-12 |
Major section dividers |
--space-16 |
64px |
gap-16 |
Page top/bottom margins |
Card Padding Rule
| Card context |
Recommended padding |
| Compact (sidebar, list items) |
--space-3 to --space-4 (12–16px) |
| Standard (content cards) |
--space-4 to --space-6 (16–24px) |
| Featured / hero cards |
--space-6 to --space-8 (24–32px) |
| Ceiling |
Never exceed --space-8 (32px) in cards |
4. Sizing
4.1 Interactive Elements
| Token |
Value |
Usage |
--height-input |
40px |
Inputs, selects, single-line controls |
--height-button |
40px |
All buttons (must match input height) |
--height-button-sm |
32px |
Compact buttons (tables, toolbars) |
--height-button-lg |
48px |
Hero CTAs, prominent actions |
--min-touch-target |
44px |
Minimum tap area on touch devices (WCAG 2.5.8) |
4.2 Content Width
| Token |
Value |
Usage |
--max-w-form |
560px |
Form containers (onboarding, settings) |
--max-w-button |
400px |
Max button width in wide forms |
--max-w-content |
768px |
Article/text-heavy content |
--max-w-page |
1280px |
Page container |
4.3 Textarea Height
| Context |
Rows |
Approx Height |
| Short input (tagline, slug) |
2 |
~56px |
| Medium input (description) |
4–5 |
~112px |
| Long input (feedback, notes) |
6–8 |
~168px |
Always enable auto-resize to grow with content.
5. Border Radius
| Token |
Value |
Usage |
--radius |
8px (configurable) |
Base radius — defines product personality |
--radius-sm |
calc(var(--radius) - 4px) |
Badges, small elements |
--radius-md |
calc(var(--radius) - 2px) |
Inputs, buttons |
--radius-lg |
var(--radius) |
Cards, modals |
--radius-xl |
calc(var(--radius) + 4px) |
Feature cards, large containers |
--radius-full |
9999px |
Avatars, pills, tags |
Personality Guide
| Brand Style |
--radius value |
| Modern / trendy |
12px–16px |
| Neutral / corporate (safe default) |
8px |
| Enterprise / dense |
4px |
| Sharp / editorial |
0px–2px |
6. Shadows
All shadows use #000000 with controlled opacity. No colored shadows.
| Token |
Value |
Usage |
--shadow-xs |
0 1px 2px rgba(0,0,0,0.05) |
Subtle lift (inputs, badges) |
--shadow-sm |
0 2px 4px rgba(0,0,0,0.06) |
Cards at rest |
--shadow-md |
0 4px 16px rgba(0,0,0,0.08) |
Elevated cards, dropdowns |
--shadow-lg |
0 8px 24px rgba(0,0,0,0.10) |
Modals, popovers |
--shadow-xl |
0 16px 48px rgba(0,0,0,0.12) |
Command palette, overlays |
Constraints:
- Minimum opacity:
0.05 (below is invisible)
- Maximum opacity:
0.12 (above feels heavy)
- Never use colored shadows
- Never use gradients as shadow replacements
7. Z-Index Scale
Managed scale to prevent z-index wars:
| Token |
Value |
Usage |
--z-base |
0 |
Default stacking |
--z-dropdown |
10 |
Dropdowns, tooltips |
--z-sticky |
20 |
Sticky headers, fixed navs |
--z-drawer |
30 |
Side drawers, panels |
--z-modal |
40 |
Modals, dialogs |
--z-popover |
50 |
Popovers over modals |
--z-toast |
60 |
Toast notifications |
--z-command |
70 |
Command palette (Cmd+K) |
--z-overlay |
80 |
Full-screen overlays |
8. Breakpoints
| Token |
Value |
Tailwind |
Usage |
--bp-sm |
640px |
sm: |
Large phones landscape |
--bp-md |
768px |
md: |
Tablets |
--bp-lg |
1024px |
lg: |
Small laptops |
--bp-xl |
1280px |
xl: |
Desktops |
--bp-2xl |
1536px |
2xl: |
Large screens |
Navigation Breakpoint Rules
| Viewport |
Max nav items |
Menu style |
< md |
4 visible |
Bottom bar or hamburger |
md–lg |
5–6 visible |
Top bar or compact sidebar |
≥ lg |
Unlimited |
Full sidebar |
9. Motion & Animation
| Token |
Value |
Usage |
--duration-instant |
100ms |
Hover color changes, opacity |
--duration-fast |
150ms |
Button press, toggle switch |
--duration-normal |
200ms |
Dropdown open, tooltip appear |
--duration-slow |
300ms |
Drawer slide, modal enter |
--duration-slower |
500ms |
Page transitions, skeleton fade |
--ease-default |
cubic-bezier(0.4, 0, 0.2, 1) |
General purpose easing |
--ease-in |
cubic-bezier(0.4, 0, 1, 1) |
Elements leaving the screen |
--ease-out |
cubic-bezier(0, 0, 0.2, 1) |
Elements entering the screen |
Constraint: always respect prefers-reduced-motion: reduce — disable or minimize all animations.
10. Focus & Accessibility
| Token |
Value |
Usage |
--ring-width |
2px |
Focus ring thickness |
--ring-offset |
2px |
Gap between element and focus ring |
--ring-color |
var(--ring) |
Focus ring color (defaults to primary) |
Contrast Requirements (WCAG AA)
| Element Type |
Minimum Ratio |
| Normal text (< 18px) |
4.5:1 |
| Large text (≥ 18px or ≥ 14px bold) |
3:1 |
| UI components (borders, icons) |
3:1 |
| Non-text contrast (graphs, charts) |
3:1 |
CSS Variable Template
Minimal starter for any project — copy and customize:
@layer base {
:root {
/* Surfaces */
--background: 210 20% 98%;
--foreground: 220 26% 16%;
--card: 0 0% 100%;
--card-foreground: 220 26% 16%;
--popover: 0 0% 100%;
--popover-foreground: 220 26% 16%;
--muted: 210 40% 96%;
--muted-foreground: 215 16% 47%;
/* Interactive */
--primary: 221 83% 53%; /* ← your brand color */
--primary-foreground: 0 0% 100%;
--secondary: 210 40% 96%;
--secondary-foreground: 220 26% 16%;
--accent: 210 40% 96%;
--accent-foreground: 220 26% 16%;
/* Feedback */
--destructive: 0 72% 51%;
--destructive-foreground: 0 0% 100%;
--success: 160 84% 39%;
--success-foreground: 0 0% 100%;
--warning: 32 95% 44%;
--warning-foreground: 26 83% 14%;
--info: 221 83% 53%;
--info-foreground: 0 0% 100%;
/* Structure */
--border: 220 13% 91%;
--input: 218 14% 86%;
--ring: var(--primary);
/* Geometry */
--radius: 0.5rem;
/* Shadows */
--shadow-sm: 0 2px 4px rgba(0,0,0,0.06);
--shadow-md: 0 4px 16px rgba(0,0,0,0.08);
--shadow-lg: 0 8px 24px rgba(0,0,0,0.10);
/* Motion */
--duration-fast: 150ms;
--duration-normal: 200ms;
--duration-slow: 300ms;
/* Focus */
--ring-width: 2px;
--ring-offset: 2px;
}
.dark {
--background: 222 84% 5%;
--foreground: 210 40% 96%;
--card: 222 47% 11%;
--card-foreground: 210 40% 96%;
--popover: 222 47% 11%;
--popover-foreground: 210 40% 96%;
--muted: 217 33% 17%;
--muted-foreground: 215 20% 65%;
--primary: 217 91% 60%;
--primary-foreground: 222 47% 11%;
--secondary: 217 33% 17%;
--secondary-foreground: 210 40% 96%;
--accent: 217 33% 17%;
--accent-foreground: 210 40% 96%;
--destructive: 0 63% 31%;
--destructive-foreground: 210 40% 98%;
--success: 142 69% 58%;
--success-foreground: 144 61% 10%;
--warning: 48 96% 53%;
--warning-foreground: 22 78% 10%;
--info: 217 91% 60%;
--info-foreground: 222 47% 11%;
--border: 217 33% 17%;
--input: 217 33% 17%;
--ring: 224 76% 48%;
--shadow-sm: 0 2px 4px rgba(0,0,0,0.20);
--shadow-md: 0 4px 16px rgba(0,0,0,0.25);
--shadow-lg: 0 8px 24px rgba(0,0,0,0.30);
}
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
transition-duration: 0.01ms !important;
}
}
}
Integration with Plugin Commands
| Command |
How it uses this reference |
/pwdev-uiux:theme create |
Generates a customized version of the CSS template above |
/pwdev-uiux:theme validate |
Checks all foreground/background pairs against contrast requirements |
/pwdev-uiux:theme from-figma |
Maps Figma variables to this token structure |
/pwdev-uiux:scan |
Audits existing UI against these tokens |
/pwdev-uiux:push-to-figma tokens |
Syncs these tokens to Figma variables |
1---2name: ui-theme-reference3description: >4 Canonical design token registry — colors, typography, spacing, sizing, border radius,5 shadows, z-index, breakpoints, motion, and focus tokens. Used by ui-best-practices6 rules and all agents that implement or review UI components. Includes CSS variable7 template for quick project setup.8metadata:9 source: https://skillmd.com/skills/pwdev-solucoes/ui-theme-reference10---1112# UI Theme Reference1314> Configurable design token registry used by `ui-best-practices` rules.15> Every hardcoded value in the best practices MUST reference a token defined here.16> To customize: override values below or generate via `/pwdev-uiux:theme create`.1718---1920## How to Use2122Rules in the `ui-best-practices` skill reference tokens as `theme.<section>.<token>`.23When implementing, map these tokens to your stack:2425| Stack | Token format | File |26|-------|-------------|------|27| shadcn-vue | `hsl(var(--<token>))` | `src/assets/index.css` |28| shadcn-react | `hsl(var(--<token>))` | `src/app/globals.css` |29| primevue | `var(--p-<token>)` | `src/assets/theme.css` |30| tailwind-only | Tailwind config `theme.extend` | `tailwind.config.ts` |31| custom | Any CSS variable scheme | project-specific |3233---3435## 1. Colors3637### 1.1 Surfaces3839| Token | Light | Dark | Usage |40|-------|-------|------|-------|41| `--background` | `#F9FAFB` · `210 20% 98%` | `#0A0F1A` · `222 84% 5%` | Page background |42| `--foreground` | `#1D2939` · `220 26% 16%` | `#F0F4F8` · `210 40% 96%` | Primary text |43| `--card` | `#FFFFFF` · `0 0% 100%` | `#111827` · `222 47% 11%` | Card / surface background |44| `--card-foreground` | `#1D2939` · `220 26% 16%` | `#F0F4F8` · `210 40% 96%` | Text on cards |45| `--popover` | `#FFFFFF` · `0 0% 100%` | `#111827` · `222 47% 11%` | Popover / dropdown bg |46| `--popover-foreground` | `#1D2939` · `220 26% 16%` | `#F0F4F8` · `210 40% 96%` | Text on popovers |4748### 1.2 Text Hierarchy4950| Token | Light | Dark | Usage |51|-------|-------|------|-------|52| `--foreground` | `#1D2939` | `#F0F4F8` | Primary text, headings |53| `--muted-foreground` | `#667085` | `#94A3B8` | Secondary text, labels, placeholders |5455### 1.3 Interactive5657| Token | Light | Dark | Usage |58|-------|-------|------|-------|59| `--primary` | *brand color* | *brand color (adjusted)* | Buttons, links, focus rings |60| `--primary-foreground` | `#FFFFFF` | `#FFFFFF` | Text on primary backgrounds |61| `--secondary` | `#F1F5F9` | `#1E293B` | Secondary buttons, subtle actions |62| `--secondary-foreground` | `#1D2939` | `#F0F4F8` | Text on secondary backgrounds |63| `--accent` | `#F1F5F9` | `#1E293B` | Hover highlights, active states |64| `--accent-foreground` | `#1D2939` | `#F0F4F8` | Text on accent backgrounds |6566### 1.4 Feedback6768| Token | Light | Dark | Usage |69|-------|-------|------|-------|70| `--success` | `#039855` | `#34D399` | Positive states, confirmations |71| `--success-foreground` | `#FFFFFF` | `#022C22` | Text on success backgrounds |72| `--warning` | `#F79009` | `#FBBF24` | Alerts, caution states |73| `--warning-foreground` | `#422006` | `#422006` | Text on warning backgrounds |74| `--destructive` | `#D92D20` | `#FCA5A5` | Errors, delete actions |75| `--destructive-foreground` | `#FFFFFF` | `#450A0A` | Text on destructive backgrounds |76| `--info` | `#2563EB` | `#60A5FA` | Informational, tips |77| `--info-foreground` | `#FFFFFF` | `#172554` | Text on info backgrounds |7879### 1.5 Structure8081| Token | Light | Dark | Usage |82|-------|-------|------|-------|83| `--border` | `#EAECF0` | `#1E293B` | Dividers, separators |84| `--input` | `#D0D5DD` | `#334155` | Input borders |85| `--ring` | *primary* | *primary* | Focus ring color |86| `--muted` | `#F1F5F9` | `#1E293B` | Muted backgrounds (badges, tags) |8788### 1.6 Reserved Semantic Colors8990These colors carry universal meaning. **Never repurpose them** for decorative or categorical use:9192| Color | Meaning | Allowed usage |93|-------|---------|---------------|94| Green (`--success`) | Good / positive / complete | Success states, positive KPIs, completion |95| Orange (`--warning`) | Caution / attention needed | Warnings, pending actions, approaching limits |96| Red (`--destructive`) | Bad / error / danger | Errors, failures, destructive actions, negative KPIs |9798For categorical/chart colors, use the chart palette below.99100### 1.7 Chart Palette101102Dedicated colors for data visualization — independent from feedback semantics:103104| Token | Default | Usage |105|-------|---------|-------|106| `--chart-1` | `#2563EB` | Primary data series |107| `--chart-2` | `#7C3AED` | Secondary data series |108| `--chart-3` | `#0891B2` | Tertiary data series |109| `--chart-4` | `#C026D3` | Fourth data series |110| `--chart-5` | `#EA580C` | Fifth data series |111| `--chart-muted` | `#D1D5DB` | De-emphasized / comparison series |112113---114115## 2. Typography116117### 2.1 Font Stack118119| Token | Default | Fallbacks |120|-------|---------|-----------|121| `--font-sans` | `Inter` | `system-ui, -apple-system, sans-serif` |122| `--font-mono` | `JetBrains Mono` | `ui-monospace, monospace` |123124### 2.2 Type Scale125126Progressive scale — adjacent levels must not skip more than one step:127128| Token | Size | Line Height | Weight | Usage |129|-------|------|-------------|--------|-------|130| `--text-xs` | `12px` | `16px` | 400 | Footnotes, badges, captions (minimum allowed) |131| `--text-sm` | `14px` | `20px` | 400 | **Default body text**, form labels |132| `--text-base` | `16px` | `24px` | 400 | Emphasized body, card titles |133| `--text-lg` | `18px` | `28px` | 500 | Section headings |134| `--text-xl` | `20px` | `28px` | 600 | Page sub-titles |135| `--text-2xl` | `24px` | `32px` | 600 | Page titles |136| `--text-3xl` | `30px` | `36px` | 700 | Hero headings |137| `--text-4xl` | `36px` | `40px` | 700 | Display / marketing headings |138139**Constraint:** never jump more than 2 steps between adjacent text elements (e.g., `text-3xl` → `text-sm` is forbidden; use `text-3xl` → `text-xl` → `text-base` → `text-sm`).140141### 2.3 Font Weight Scale142143| Token | Value | Usage |144|-------|-------|-------|145| `--font-normal` | `400` | Body text |146| `--font-medium` | `500` | Labels, nav items |147| `--font-semibold` | `600` | Headings, emphasis |148| `--font-bold` | `700` | Hero, display text |149150---151152## 3. Spacing153154Base unit: **4px**. All spacing must be a multiple of 4.155156| Token | Value | Tailwind | Typical Usage |157|-------|-------|----------|---------------|158| `--space-0.5` | `2px` | `gap-0.5` | Micro adjustments only |159| `--space-1` | `4px` | `gap-1` | Icon ↔ label gap |160| `--space-1.5` | `6px` | `gap-1.5` | Compact inline gap |161| `--space-2` | `8px` | `gap-2` | Internal gap, small padding |162| `--space-3` | `12px` | `gap-3` | Badge padding, compact lists |163| `--space-4` | `16px` | `gap-4, p-4` | Default card padding (min) |164| `--space-5` | `20px` | `gap-5` | Medium card padding |165| `--space-6` | `24px` | `gap-6, p-6` | Default card padding (max), section gaps |166| `--space-8` | `32px` | `gap-8, p-8` | Large section padding |167| `--space-10` | `40px` | `gap-10` | Page-level vertical spacing |168| `--space-12` | `48px` | `gap-12` | Major section dividers |169| `--space-16` | `64px` | `gap-16` | Page top/bottom margins |170171### Card Padding Rule172173| Card context | Recommended padding |174|--------------|-------------------|175| Compact (sidebar, list items) | `--space-3` to `--space-4` (12–16px) |176| Standard (content cards) | `--space-4` to `--space-6` (16–24px) |177| Featured / hero cards | `--space-6` to `--space-8` (24–32px) |178| **Ceiling** | Never exceed `--space-8` (32px) in cards |179180---181182## 4. Sizing183184### 4.1 Interactive Elements185186| Token | Value | Usage |187|-------|-------|-------|188| `--height-input` | `40px` | Inputs, selects, single-line controls |189| `--height-button` | `40px` | All buttons (must match input height) |190| `--height-button-sm` | `32px` | Compact buttons (tables, toolbars) |191| `--height-button-lg` | `48px` | Hero CTAs, prominent actions |192| `--min-touch-target` | `44px` | Minimum tap area on touch devices (WCAG 2.5.8) |193194### 4.2 Content Width195196| Token | Value | Usage |197|-------|-------|-------|198| `--max-w-form` | `560px` | Form containers (onboarding, settings) |199| `--max-w-button` | `400px` | Max button width in wide forms |200| `--max-w-content` | `768px` | Article/text-heavy content |201| `--max-w-page` | `1280px` | Page container |202203### 4.3 Textarea Height204205| Context | Rows | Approx Height |206|---------|------|---------------|207| Short input (tagline, slug) | 2 | `~56px` |208| Medium input (description) | 4–5 | `~112px` |209| Long input (feedback, notes) | 6–8 | `~168px` |210211Always enable auto-resize to grow with content.212213---214215## 5. Border Radius216217| Token | Value | Usage |218|-------|-------|-------|219| `--radius` | `8px` *(configurable)* | Base radius — defines product personality |220| `--radius-sm` | `calc(var(--radius) - 4px)` | Badges, small elements |221| `--radius-md` | `calc(var(--radius) - 2px)` | Inputs, buttons |222| `--radius-lg` | `var(--radius)` | Cards, modals |223| `--radius-xl` | `calc(var(--radius) + 4px)` | Feature cards, large containers |224| `--radius-full` | `9999px` | Avatars, pills, tags |225226### Personality Guide227228| Brand Style | `--radius` value |229|-------------|-----------------|230| Modern / trendy | `12px–16px` |231| Neutral / corporate (safe default) | `8px` |232| Enterprise / dense | `4px` |233| Sharp / editorial | `0px–2px` |234235---236237## 6. Shadows238239All shadows use `#000000` with controlled opacity. No colored shadows.240241| Token | Value | Usage |242|-------|-------|-------|243| `--shadow-xs` | `0 1px 2px rgba(0,0,0,0.05)` | Subtle lift (inputs, badges) |244| `--shadow-sm` | `0 2px 4px rgba(0,0,0,0.06)` | Cards at rest |245| `--shadow-md` | `0 4px 16px rgba(0,0,0,0.08)` | Elevated cards, dropdowns |246| `--shadow-lg` | `0 8px 24px rgba(0,0,0,0.10)` | Modals, popovers |247| `--shadow-xl` | `0 16px 48px rgba(0,0,0,0.12)` | Command palette, overlays |248249**Constraints:**250- Minimum opacity: `0.05` (below is invisible)251- Maximum opacity: `0.12` (above feels heavy)252- Never use colored shadows253- Never use gradients as shadow replacements254255---256257## 7. Z-Index Scale258259Managed scale to prevent z-index wars:260261| Token | Value | Usage |262|-------|-------|-------|263| `--z-base` | `0` | Default stacking |264| `--z-dropdown` | `10` | Dropdowns, tooltips |265| `--z-sticky` | `20` | Sticky headers, fixed navs |266| `--z-drawer` | `30` | Side drawers, panels |267| `--z-modal` | `40` | Modals, dialogs |268| `--z-popover` | `50` | Popovers over modals |269| `--z-toast` | `60` | Toast notifications |270| `--z-command` | `70` | Command palette (Cmd+K) |271| `--z-overlay` | `80` | Full-screen overlays |272273---274275## 8. Breakpoints276277| Token | Value | Tailwind | Usage |278|-------|-------|----------|-------|279| `--bp-sm` | `640px` | `sm:` | Large phones landscape |280| `--bp-md` | `768px` | `md:` | Tablets |281| `--bp-lg` | `1024px` | `lg:` | Small laptops |282| `--bp-xl` | `1280px` | `xl:` | Desktops |283| `--bp-2xl` | `1536px` | `2xl:` | Large screens |284285### Navigation Breakpoint Rules286287| Viewport | Max nav items | Menu style |288|----------|--------------|------------|289| `< md` | 4 visible | Bottom bar or hamburger |290| `md–lg` | 5–6 visible | Top bar or compact sidebar |291| `≥ lg` | Unlimited | Full sidebar |292293---294295## 9. Motion & Animation296297| Token | Value | Usage |298|-------|-------|-------|299| `--duration-instant` | `100ms` | Hover color changes, opacity |300| `--duration-fast` | `150ms` | Button press, toggle switch |301| `--duration-normal` | `200ms` | Dropdown open, tooltip appear |302| `--duration-slow` | `300ms` | Drawer slide, modal enter |303| `--duration-slower` | `500ms` | Page transitions, skeleton fade |304| `--ease-default` | `cubic-bezier(0.4, 0, 0.2, 1)` | General purpose easing |305| `--ease-in` | `cubic-bezier(0.4, 0, 1, 1)` | Elements leaving the screen |306| `--ease-out` | `cubic-bezier(0, 0, 0.2, 1)` | Elements entering the screen |307308**Constraint:** always respect `prefers-reduced-motion: reduce` — disable or minimize all animations.309310---311312## 10. Focus & Accessibility313314| Token | Value | Usage |315|-------|-------|-------|316| `--ring-width` | `2px` | Focus ring thickness |317| `--ring-offset` | `2px` | Gap between element and focus ring |318| `--ring-color` | `var(--ring)` | Focus ring color (defaults to primary) |319320### Contrast Requirements (WCAG AA)321322| Element Type | Minimum Ratio |323|-------------|---------------|324| Normal text (< 18px) | **4.5:1** |325| Large text (≥ 18px or ≥ 14px bold) | **3:1** |326| UI components (borders, icons) | **3:1** |327| Non-text contrast (graphs, charts) | **3:1** |328329---330331## CSS Variable Template332333Minimal starter for any project — copy and customize:334335```css336@layer base {337 :root {338 /* Surfaces */339 --background: 210 20% 98%;340 --foreground: 220 26% 16%;341 --card: 0 0% 100%;342 --card-foreground: 220 26% 16%;343 --popover: 0 0% 100%;344 --popover-foreground: 220 26% 16%;345 --muted: 210 40% 96%;346 --muted-foreground: 215 16% 47%;347348 /* Interactive */349 --primary: 221 83% 53%; /* ← your brand color */350 --primary-foreground: 0 0% 100%;351 --secondary: 210 40% 96%;352 --secondary-foreground: 220 26% 16%;353 --accent: 210 40% 96%;354 --accent-foreground: 220 26% 16%;355356 /* Feedback */357 --destructive: 0 72% 51%;358 --destructive-foreground: 0 0% 100%;359 --success: 160 84% 39%;360 --success-foreground: 0 0% 100%;361 --warning: 32 95% 44%;362 --warning-foreground: 26 83% 14%;363 --info: 221 83% 53%;364 --info-foreground: 0 0% 100%;365366 /* Structure */367 --border: 220 13% 91%;368 --input: 218 14% 86%;369 --ring: var(--primary);370371 /* Geometry */372 --radius: 0.5rem;373374 /* Shadows */375 --shadow-sm: 0 2px 4px rgba(0,0,0,0.06);376 --shadow-md: 0 4px 16px rgba(0,0,0,0.08);377 --shadow-lg: 0 8px 24px rgba(0,0,0,0.10);378379 /* Motion */380 --duration-fast: 150ms;381 --duration-normal: 200ms;382 --duration-slow: 300ms;383384 /* Focus */385 --ring-width: 2px;386 --ring-offset: 2px;387 }388389 .dark {390 --background: 222 84% 5%;391 --foreground: 210 40% 96%;392 --card: 222 47% 11%;393 --card-foreground: 210 40% 96%;394 --popover: 222 47% 11%;395 --popover-foreground: 210 40% 96%;396 --muted: 217 33% 17%;397 --muted-foreground: 215 20% 65%;398399 --primary: 217 91% 60%;400 --primary-foreground: 222 47% 11%;401 --secondary: 217 33% 17%;402 --secondary-foreground: 210 40% 96%;403 --accent: 217 33% 17%;404 --accent-foreground: 210 40% 96%;405406 --destructive: 0 63% 31%;407 --destructive-foreground: 210 40% 98%;408 --success: 142 69% 58%;409 --success-foreground: 144 61% 10%;410 --warning: 48 96% 53%;411 --warning-foreground: 22 78% 10%;412 --info: 217 91% 60%;413 --info-foreground: 222 47% 11%;414415 --border: 217 33% 17%;416 --input: 217 33% 17%;417 --ring: 224 76% 48%;418419 --shadow-sm: 0 2px 4px rgba(0,0,0,0.20);420 --shadow-md: 0 4px 16px rgba(0,0,0,0.25);421 --shadow-lg: 0 8px 24px rgba(0,0,0,0.30);422 }423424 @media (prefers-reduced-motion: reduce) {425 *, *::before, *::after {426 animation-duration: 0.01ms !important;427 transition-duration: 0.01ms !important;428 }429 }430}431```432433---434435## Integration with Plugin Commands436437| Command | How it uses this reference |438|---------|--------------------------|439| `/pwdev-uiux:theme create` | Generates a customized version of the CSS template above |440| `/pwdev-uiux:theme validate` | Checks all foreground/background pairs against contrast requirements |441| `/pwdev-uiux:theme from-figma` | Maps Figma variables to this token structure |442| `/pwdev-uiux:scan` | Audits existing UI against these tokens |443| `/pwdev-uiux:push-to-figma tokens` | Syncs these tokens to Figma variables |