glyph-ai 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -0
- package/bundled/overlay/overlay.js +63 -0
- package/bundled/server/context/brand-references.d.ts +7 -0
- package/bundled/server/context/brand-references.d.ts.map +1 -0
- package/bundled/server/context/brand-references.js +20 -0
- package/bundled/server/context/brand-references.js.map +1 -0
- package/bundled/server/context/design-philosophy.d.ts +6 -0
- package/bundled/server/context/design-philosophy.d.ts.map +1 -0
- package/bundled/server/context/design-philosophy.js +82 -0
- package/bundled/server/context/design-philosophy.js.map +1 -0
- package/bundled/server/context/design-system-loader.d.ts +11 -0
- package/bundled/server/context/design-system-loader.d.ts.map +1 -0
- package/bundled/server/context/design-system-loader.js +169 -0
- package/bundled/server/context/design-system-loader.js.map +1 -0
- package/bundled/server/context/design-system.d.ts +7 -0
- package/bundled/server/context/design-system.d.ts.map +1 -0
- package/bundled/server/context/design-system.js +75 -0
- package/bundled/server/context/design-system.js.map +1 -0
- package/bundled/server/context/prompt-builder.d.ts +15 -0
- package/bundled/server/context/prompt-builder.d.ts.map +1 -0
- package/bundled/server/context/prompt-builder.js +123 -0
- package/bundled/server/context/prompt-builder.js.map +1 -0
- package/bundled/server/context/token-template.d.ts +36 -0
- package/bundled/server/context/token-template.d.ts.map +1 -0
- package/bundled/server/context/token-template.js +226 -0
- package/bundled/server/context/token-template.js.map +1 -0
- package/bundled/server/data/design-systems/apple-design-system.md +474 -0
- package/bundled/server/data/design-systems/arc-design-system.md +922 -0
- package/bundled/server/data/design-systems/claude-ai-design-system.md +1443 -0
- package/bundled/server/data/design-systems/elevenlabs-design-system.md +669 -0
- package/bundled/server/data/design-systems/generating_design.md +9 -0
- package/bundled/server/data/design-systems/linear-design-system.md +607 -0
- package/bundled/server/data/design-systems/notion-design-system.md +866 -0
- package/bundled/server/data/design-systems/raycast-design-system.md +709 -0
- package/bundled/server/data/design-systems/stripe-design-system.md +592 -0
- package/bundled/server/data/design-systems/vercel-design-system.md +824 -0
- package/bundled/server/data/design.md +971 -0
- package/bundled/server/index.d.ts +2 -0
- package/bundled/server/index.d.ts.map +1 -0
- package/bundled/server/index.js +310 -0
- package/bundled/server/index.js.map +1 -0
- package/bundled/server/mcp/tools/apply-variation.d.ts +3 -0
- package/bundled/server/mcp/tools/apply-variation.d.ts.map +1 -0
- package/bundled/server/mcp/tools/apply-variation.js +43 -0
- package/bundled/server/mcp/tools/apply-variation.js.map +1 -0
- package/bundled/server/mcp/tools/generate-variations.d.ts +3 -0
- package/bundled/server/mcp/tools/generate-variations.d.ts.map +1 -0
- package/bundled/server/mcp/tools/generate-variations.js +58 -0
- package/bundled/server/mcp/tools/generate-variations.js.map +1 -0
- package/bundled/server/mcp/tools/index.d.ts +3 -0
- package/bundled/server/mcp/tools/index.d.ts.map +1 -0
- package/bundled/server/mcp/tools/index.js +11 -0
- package/bundled/server/mcp/tools/index.js.map +1 -0
- package/bundled/server/mcp/tools/scan-design-system.d.ts +3 -0
- package/bundled/server/mcp/tools/scan-design-system.d.ts.map +1 -0
- package/bundled/server/mcp/tools/scan-design-system.js +27 -0
- package/bundled/server/mcp/tools/scan-design-system.js.map +1 -0
- package/bundled/server/mcp/tools/submit-variations.d.ts +3 -0
- package/bundled/server/mcp/tools/submit-variations.d.ts.map +1 -0
- package/bundled/server/mcp/tools/submit-variations.js +50 -0
- package/bundled/server/mcp/tools/submit-variations.js.map +1 -0
- package/bundled/server/mcp-entry.d.ts +2 -0
- package/bundled/server/mcp-entry.d.ts.map +1 -0
- package/bundled/server/mcp-entry.js +56 -0
- package/bundled/server/mcp-entry.js.map +1 -0
- package/bundled/server/preview/css-resolver.d.ts +6 -0
- package/bundled/server/preview/css-resolver.d.ts.map +1 -0
- package/bundled/server/preview/css-resolver.js +57 -0
- package/bundled/server/preview/css-resolver.js.map +1 -0
- package/bundled/server/preview/html-builder.d.ts +6 -0
- package/bundled/server/preview/html-builder.d.ts.map +1 -0
- package/bundled/server/preview/html-builder.js +85 -0
- package/bundled/server/preview/html-builder.js.map +1 -0
- package/bundled/server/telemetry.d.ts +4 -0
- package/bundled/server/telemetry.d.ts.map +1 -0
- package/bundled/server/telemetry.js +71 -0
- package/bundled/server/telemetry.js.map +1 -0
- package/bundled/server/types.d.ts +69 -0
- package/bundled/server/types.d.ts.map +1 -0
- package/bundled/server/types.js +2 -0
- package/bundled/server/types.js.map +1 -0
- package/bundled/server/variations/file-writer.d.ts +5 -0
- package/bundled/server/variations/file-writer.d.ts.map +1 -0
- package/bundled/server/variations/file-writer.js +29 -0
- package/bundled/server/variations/file-writer.js.map +1 -0
- package/bundled/server/variations/git-utils.d.ts +3 -0
- package/bundled/server/variations/git-utils.d.ts.map +1 -0
- package/bundled/server/variations/git-utils.js +23 -0
- package/bundled/server/variations/git-utils.js.map +1 -0
- package/bundled/server/variations/store.d.ts +11 -0
- package/bundled/server/variations/store.d.ts.map +1 -0
- package/bundled/server/variations/store.js +52 -0
- package/bundled/server/variations/store.js.map +1 -0
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +299 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/stop.d.ts +2 -0
- package/dist/commands/stop.d.ts.map +1 -0
- package/dist/commands/stop.js +32 -0
- package/dist/commands/stop.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -0
- package/package.json +35 -0
|
@@ -0,0 +1,971 @@
|
|
|
1
|
+
# Design System
|
|
2
|
+
|
|
3
|
+
This document serves two purposes:
|
|
4
|
+
|
|
5
|
+
1. **A constraint system** — the rules, token structures, and component guidelines that all generated interfaces must adhere to, regardless of aesthetic direction.
|
|
6
|
+
2. **A living token file** — when an agent reads this document alongside a codebase, it fills in the token values below based on what it finds, resolves any inconsistencies with the user, and uses the completed file as the source of truth for all subsequent generation.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Agent Instructions
|
|
11
|
+
|
|
12
|
+
> These instructions are for Claude Code, Cursor, or any agent with filesystem access. Read this section first and determine which mode applies before doing anything else.
|
|
13
|
+
|
|
14
|
+
### Step 1 — Determine the operating mode
|
|
15
|
+
|
|
16
|
+
Ask the user (or infer from their request) which of the following modes applies:
|
|
17
|
+
|
|
18
|
+
**Mode A — Extract & Codify**
|
|
19
|
+
> "My existing designs work. Turn them into a design system."
|
|
20
|
+
|
|
21
|
+
The user wants their current design conventions captured and systematized. Do not change anything aesthetically. Your job is to observe, extract, and document.
|
|
22
|
+
|
|
23
|
+
**Mode B — Improve & Codify**
|
|
24
|
+
> "My existing designs need work. Improve them and create a design system."
|
|
25
|
+
|
|
26
|
+
The user wants their design leveled up while keeping their intent intact. You will analyze what exists, propose a refined version, fill in the tokens with the improved values, and apply those values back to the codebase.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
### Step 2 — Read the codebase
|
|
31
|
+
|
|
32
|
+
Before filling in any tokens, scan the codebase for design signals. Look in:
|
|
33
|
+
|
|
34
|
+
- CSS files, Tailwind config, CSS modules, styled-components, or any file with style definitions
|
|
35
|
+
- Component files for inline styles or class usage patterns
|
|
36
|
+
- Global stylesheets (`globals.css`, `index.css`, `app.css`, `theme.ts`, `tokens.ts`, etc.)
|
|
37
|
+
- Any existing design token files (`tokens.json`, `theme.js`, etc.)
|
|
38
|
+
|
|
39
|
+
Extract the following from what you find:
|
|
40
|
+
|
|
41
|
+
| Signal | What to look for |
|
|
42
|
+
|---|---|
|
|
43
|
+
| Colors | Every hex, rgb, hsl, or Tailwind color value used. Group by frequency and role. |
|
|
44
|
+
| Typefaces | Font family declarations, Google Fonts imports, `@font-face` blocks |
|
|
45
|
+
| Font sizes | Every `font-size`, `text-*` class, or size value used |
|
|
46
|
+
| Font weights | Every `font-weight` or `font-*` weight class used |
|
|
47
|
+
| Spacing | Padding and margin values. Identify the base unit and scale. |
|
|
48
|
+
| Border radius | Every `border-radius` or `rounded-*` value used |
|
|
49
|
+
| Shadows | Every `box-shadow` value |
|
|
50
|
+
| Breakpoints | Media query breakpoints defined or used |
|
|
51
|
+
| Component patterns | Recurring UI structures: cards, buttons, inputs, nav, modals |
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
### Step 3 — Identify and resolve inconsistencies
|
|
56
|
+
|
|
57
|
+
Before filling in the token template, check for conflicts. For each category below, if you find more than one value competing for the same role, **stop and ask the user to choose one before proceeding**.
|
|
58
|
+
|
|
59
|
+
Use this exact prompt format when surfacing a conflict:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
I found [N] values being used for [role]. Which should be the canonical token?
|
|
63
|
+
|
|
64
|
+
Option A: [value] — used in [files/components]
|
|
65
|
+
Option B: [value] — used in [files/components]
|
|
66
|
+
Option C: [value] — used in [files/components] (if applicable)
|
|
67
|
+
|
|
68
|
+
Pick one, or tell me a new value to use instead.
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**Conflicts to check for:**
|
|
72
|
+
|
|
73
|
+
- [ ] Multiple primary/accent colors (most common)
|
|
74
|
+
- [ ] Multiple base font families
|
|
75
|
+
- [ ] Inconsistent border radius values for the same component type (e.g. some buttons at 4px, some at 8px)
|
|
76
|
+
- [ ] Spacing values that don't resolve to a consistent base unit
|
|
77
|
+
- [ ] Multiple shadow levels used interchangeably
|
|
78
|
+
- [ ] Mixed heading weight conventions (some h2s at 500, others at 700)
|
|
79
|
+
|
|
80
|
+
Do not guess or average. Always ask.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
### Step 4 — Fill in the token template
|
|
85
|
+
|
|
86
|
+
Once you have extracted all values and resolved all conflicts, fill in **Section 15: Active Token Values** below. This is the canonical source of truth the agent uses for all code generation going forward.
|
|
87
|
+
|
|
88
|
+
If operating in **Mode B**, apply the improvement guidelines in Section 16 before filling in tokens. Use the improved values — not the raw extracted ones — as the final token set.
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
### Step 5 — Apply tokens to the codebase (Mode B only)
|
|
93
|
+
|
|
94
|
+
If the user requested improvements (Mode B):
|
|
95
|
+
|
|
96
|
+
1. Replace all hardcoded color, spacing, radius, shadow, and font values in the codebase with references to the new CSS custom properties.
|
|
97
|
+
2. Update component styles to match the improved token values.
|
|
98
|
+
3. Do not restructure component logic — only modify styles.
|
|
99
|
+
4. After applying, summarize what changed in a brief changelog comment at the bottom of this file.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## 1. Guiding Principles
|
|
104
|
+
|
|
105
|
+
Before generating any interface, the agent must:
|
|
106
|
+
|
|
107
|
+
1. **Choose a clear aesthetic direction** and commit to it. Vague or blended aesthetics produce incoherent results.
|
|
108
|
+
2. **Establish a conceptual anchor** — one word or phrase that describes the feeling of the UI (e.g. "surgical", "warm", "kinetic", "archival").
|
|
109
|
+
3. **Apply tokens consistently** — never deviate from defined spacing, type scale, and color roles mid-component.
|
|
110
|
+
4. **Default to restraint** — when uncertain, do less. Complexity must be earned by context.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## 2. Color
|
|
115
|
+
|
|
116
|
+
### Roles
|
|
117
|
+
|
|
118
|
+
Every color used must be assigned to one of these semantic roles. Never apply color arbitrarily.
|
|
119
|
+
|
|
120
|
+
| Role | Description |
|
|
121
|
+
|---|---|
|
|
122
|
+
| `background` | Page or surface base |
|
|
123
|
+
| `surface` | Cards, panels, modals — elevated above background |
|
|
124
|
+
| `border` | Dividers, outlines, separators |
|
|
125
|
+
| `text-primary` | Primary readable content |
|
|
126
|
+
| `text-secondary` | Supporting labels, captions, metadata |
|
|
127
|
+
| `text-disabled` | Inactive or non-interactive content |
|
|
128
|
+
| `accent` | Brand or action color — used sparingly |
|
|
129
|
+
| `accent-hover` | Hover state of accent |
|
|
130
|
+
| `destructive` | Errors, delete actions, warnings |
|
|
131
|
+
| `success` | Confirmations, completion states |
|
|
132
|
+
|
|
133
|
+
### Rules
|
|
134
|
+
|
|
135
|
+
- **Use CSS custom properties** for all color values. Never hardcode hex values inline.
|
|
136
|
+
- **Palette size**: Limit to 6–8 colors per UI. Additional shades must derive from the core palette (e.g. `accent` at 10% opacity for hover backgrounds).
|
|
137
|
+
- **Contrast**: Text on any background must meet WCAG AA minimum (4.5:1 for body, 3:1 for large text/UI elements).
|
|
138
|
+
- **Accent restraint**: The accent color should occupy no more than ~10–15% of visual surface area. If it appears everywhere, it means nothing.
|
|
139
|
+
- **Dark and light modes**: If the UI supports both, define both in tokens. Never assume one mode.
|
|
140
|
+
|
|
141
|
+
### Anti-patterns
|
|
142
|
+
|
|
143
|
+
- ❌ Purple gradients on white — overused AI default
|
|
144
|
+
- ❌ More than two colors competing for attention in a single component
|
|
145
|
+
- ❌ Using accent color for non-interactive decorative elements
|
|
146
|
+
- ❌ Low-contrast text rationalized as "secondary" — still must pass AA
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## 3. Typography
|
|
151
|
+
|
|
152
|
+
### Typeface Selection
|
|
153
|
+
|
|
154
|
+
- Choose **two typefaces maximum** per UI: one for display/headings, one for body/UI. A single well-chosen typeface with varied weights is also acceptable.
|
|
155
|
+
- Typefaces must be **loaded from a reliable CDN** (e.g. Google Fonts, Bunny Fonts) or declared as system font stacks.
|
|
156
|
+
- **Avoid**: Inter, Roboto, Arial, and system-ui as the sole type choice. These are defaults, not decisions.
|
|
157
|
+
- **Prefer**: Typefaces with clear personality that matches the conceptual anchor — geometric sans, humanist, transitional serif, monospace, slab serif, etc.
|
|
158
|
+
|
|
159
|
+
### Type Scale
|
|
160
|
+
|
|
161
|
+
Use a consistent modular scale. Suggested base: `1rem` (16px) with a 1.25 or 1.333 ratio.
|
|
162
|
+
|
|
163
|
+
| Token | Suggested Size | Usage |
|
|
164
|
+
|---|---|---|
|
|
165
|
+
| `text-xs` | 0.75rem | Captions, badges, timestamps |
|
|
166
|
+
| `text-sm` | 0.875rem | Labels, secondary UI text |
|
|
167
|
+
| `text-base` | 1rem | Body copy, form inputs |
|
|
168
|
+
| `text-lg` | 1.125rem | Lead text, emphasized body |
|
|
169
|
+
| `text-xl` | 1.25rem | Subheadings, card titles |
|
|
170
|
+
| `text-2xl` | 1.5rem | Section headings |
|
|
171
|
+
| `text-3xl` | 1.875rem | Page titles |
|
|
172
|
+
| `text-4xl+` | 2.25rem+ | Display / hero text |
|
|
173
|
+
|
|
174
|
+
### Line Height & Spacing
|
|
175
|
+
|
|
176
|
+
| Context | Line Height |
|
|
177
|
+
|---|---|
|
|
178
|
+
| Body text | 1.6–1.7 |
|
|
179
|
+
| UI labels / buttons | 1.2–1.3 |
|
|
180
|
+
| Display headings | 1.0–1.15 |
|
|
181
|
+
|
|
182
|
+
- **Letter spacing**: Tighten large headings (`-0.02em` to `-0.04em`). Loosen small caps or labels (`0.05em` to `0.1em`). Body text: default (0).
|
|
183
|
+
- **Max line length**: 60–75 characters for readable body copy. Never let text span full viewport width unconstrained.
|
|
184
|
+
|
|
185
|
+
### Rules
|
|
186
|
+
|
|
187
|
+
- **Never mix more than two type sizes within a single component** unless establishing a clear hierarchy.
|
|
188
|
+
- **Font weight** is a hierarchy tool — use it intentionally. Three weights maximum per UI (e.g. 400, 500, 700).
|
|
189
|
+
- **Avoid italic for UI labels** — use weight or color for emphasis instead.
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## 4. Spacing
|
|
194
|
+
|
|
195
|
+
### Scale
|
|
196
|
+
|
|
197
|
+
All spacing values must come from a defined scale. Use multiples of a base unit (4px recommended).
|
|
198
|
+
|
|
199
|
+
| Token | Value | Usage |
|
|
200
|
+
|---|---|---|
|
|
201
|
+
| `space-1` | 4px | Tight internal padding, icon gaps |
|
|
202
|
+
| `space-2` | 8px | Component internal spacing |
|
|
203
|
+
| `space-3` | 12px | Small gaps between related elements |
|
|
204
|
+
| `space-4` | 16px | Standard padding unit |
|
|
205
|
+
| `space-6` | 24px | Section separation within components |
|
|
206
|
+
| `space-8` | 32px | Between components |
|
|
207
|
+
| `space-12` | 48px | Between sections |
|
|
208
|
+
| `space-16` | 64px | Major layout sections |
|
|
209
|
+
| `space-24` | 96px | Hero / page-level breathing room |
|
|
210
|
+
|
|
211
|
+
### Rules
|
|
212
|
+
|
|
213
|
+
- **Never use arbitrary values** like `margin: 13px`. All spacing must map to a token.
|
|
214
|
+
- **Consistent internal padding**: Components of the same type must share padding values (e.g. all cards use `space-6` internal padding).
|
|
215
|
+
- **Whitespace is intentional** — generous spacing signals clarity and confidence. Cramped UIs signal poor decisions, not information density.
|
|
216
|
+
- **Vertical rhythm**: Maintain consistent spacing between typographic elements. Headings should have more space above than below.
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## 5. Layout
|
|
221
|
+
|
|
222
|
+
### Grid
|
|
223
|
+
|
|
224
|
+
- Use a **12-column grid** for complex layouts, **4-column** for mobile.
|
|
225
|
+
- Define a **max content width** and center it. Recommended: `1200px–1440px` for full layouts, `720px` for reading/form-heavy pages.
|
|
226
|
+
- Use **CSS Grid** for two-dimensional layout, **Flexbox** for one-dimensional (rows, stacks, nav bars).
|
|
227
|
+
|
|
228
|
+
### Responsive Breakpoints
|
|
229
|
+
|
|
230
|
+
| Name | Min Width | Typical Usage |
|
|
231
|
+
|---|---|---|
|
|
232
|
+
| `sm` | 640px | Large phones, small tablets |
|
|
233
|
+
| `md` | 768px | Tablets |
|
|
234
|
+
| `lg` | 1024px | Laptops |
|
|
235
|
+
| `xl` | 1280px | Desktops |
|
|
236
|
+
| `2xl` | 1536px | Large screens |
|
|
237
|
+
|
|
238
|
+
- **Mobile-first**: Write base styles for mobile, layer up with breakpoints.
|
|
239
|
+
- **Never hide critical content on mobile** — simplify layout, not information.
|
|
240
|
+
|
|
241
|
+
### Rules
|
|
242
|
+
|
|
243
|
+
- **Align to the grid** — elements that break the grid must do so intentionally (e.g. a full-bleed image, an overlapping decorative element). Accidental misalignment is always wrong.
|
|
244
|
+
- **Consistent gutters**: Gutter width must be uniform across a layout tier (e.g. 24px gutters on desktop everywhere, not 24px in one section and 16px in another).
|
|
245
|
+
- **Group related elements visually** — proximity implies relationship. Elements that belong together must be spaced tighter than elements that don't.
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## 6. Borders & Radius
|
|
250
|
+
|
|
251
|
+
### Border
|
|
252
|
+
|
|
253
|
+
- **Default border**: `1px solid var(--border)` — never thicker unless intentionally expressive.
|
|
254
|
+
- **Border as separator**: Use `border-bottom` or `border-top` for dividers, not full-box borders on list items.
|
|
255
|
+
- **Avoid decorative borders** that don't communicate structure.
|
|
256
|
+
|
|
257
|
+
### Radius
|
|
258
|
+
|
|
259
|
+
Define a radius scale and apply it consistently by component type.
|
|
260
|
+
|
|
261
|
+
| Token | Value | Usage |
|
|
262
|
+
|---|---|---|
|
|
263
|
+
| `radius-sm` | 4px | Badges, tags, small inputs |
|
|
264
|
+
| `radius-md` | 8px | Buttons, inputs, cards |
|
|
265
|
+
| `radius-lg` | 12px | Modals, panels, popovers |
|
|
266
|
+
| `radius-xl` | 16px | Large cards, image containers |
|
|
267
|
+
| `radius-full` | 9999px | Pills, avatar circles, toggles |
|
|
268
|
+
|
|
269
|
+
- **Consistency within component type**: All buttons share one radius value. All cards share one radius value. Never mix radii within the same component class.
|
|
270
|
+
- **Sharp vs. rounded**: The radius choice contributes to aesthetic personality. Commit to one direction — tight/sharp for utilitarian, generous/rounded for approachable — and apply it uniformly.
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
## 7. Elevation & Shadow
|
|
275
|
+
|
|
276
|
+
Shadows communicate hierarchy and separation. Use them intentionally, not decoratively.
|
|
277
|
+
|
|
278
|
+
| Level | Usage | Suggested Value |
|
|
279
|
+
|---|---|---|
|
|
280
|
+
| `shadow-sm` | Subtle card lift | `0 1px 3px rgba(0,0,0,0.08)` |
|
|
281
|
+
| `shadow-md` | Dropdowns, popovers | `0 4px 12px rgba(0,0,0,0.10)` |
|
|
282
|
+
| `shadow-lg` | Modals, floating panels | `0 8px 32px rgba(0,0,0,0.14)` |
|
|
283
|
+
| `shadow-none` | Flat surfaces, no elevation | — |
|
|
284
|
+
|
|
285
|
+
### Rules
|
|
286
|
+
|
|
287
|
+
- **One elevation level per component** — never stack multiple shadows on the same element.
|
|
288
|
+
- **Dark mode**: Replace box shadows with borders or background differentiation (`surface` token) — shadows don't read on dark backgrounds.
|
|
289
|
+
- **Don't use shadows as decoration** — they should communicate that something is above another layer.
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
## 8. Iconography
|
|
294
|
+
|
|
295
|
+
- Use a **single icon library** per project. Don't mix Heroicons with Lucide with Material — inconsistent stroke weights and styles clash.
|
|
296
|
+
- **Preferred**: Lucide, Heroicons, Phosphor (all consistent, open-source, multiple weights).
|
|
297
|
+
- **Size**: Icons must align to the type scale of their context. Icon beside `text-base` label → 16px icon. Icon in a heading → match heading cap height.
|
|
298
|
+
- **Stroke weight**: Match the weight of the chosen icon set to the overall aesthetic. Light strokes = refined. Heavier strokes = bold/accessible.
|
|
299
|
+
- **Never use emoji as functional UI icons.**
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
## 9. Motion & Animation
|
|
304
|
+
|
|
305
|
+
Motion must serve communication, not decoration.
|
|
306
|
+
|
|
307
|
+
### Principles
|
|
308
|
+
|
|
309
|
+
- **Purposeful**: Every animation must have a reason — feedback, orientation, hierarchy, or delight.
|
|
310
|
+
- **Fast**: UI transitions should feel instant but smooth. Most transitions: `150ms–300ms`. Entrances: up to `400ms`.
|
|
311
|
+
- **Easing**: Use `ease-out` for elements entering the screen (decelerating = natural). Use `ease-in` for exits. Avoid `linear` except for looping animations (spinners).
|
|
312
|
+
- **Reduced motion**: Always respect `prefers-reduced-motion`. Wrap all non-essential animations in a media query check.
|
|
313
|
+
|
|
314
|
+
### Common Patterns
|
|
315
|
+
|
|
316
|
+
| Pattern | Duration | Easing |
|
|
317
|
+
|---|---|---|
|
|
318
|
+
| Button hover state | 100–150ms | ease-out |
|
|
319
|
+
| Dropdown/popover open | 150–200ms | ease-out |
|
|
320
|
+
| Modal entrance | 200–300ms | ease-out |
|
|
321
|
+
| Page section reveal | 300–500ms | ease-out |
|
|
322
|
+
| Toast notification | 250ms in / 200ms out | ease-out / ease-in |
|
|
323
|
+
| Skeleton shimmer | 1.5s loop | linear |
|
|
324
|
+
|
|
325
|
+
### Rules
|
|
326
|
+
|
|
327
|
+
- **Stagger, don't overwhelm**: If animating a list of items in, stagger by `50–80ms` per item. Don't animate more than 5–6 items in a sequence.
|
|
328
|
+
- **Don't animate layout properties** (`width`, `height`, `top`, `left`) — use `transform` and `opacity` for performance.
|
|
329
|
+
- ❌ Avoid: Bouncy springs on functional UI elements, excessive particle effects, animations that delay interaction.
|
|
330
|
+
- ❌ Avoid: Animating everything on page load — one well-executed entrance is more effective than a cascade of movement.
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
## 10. Component Guidelines
|
|
335
|
+
|
|
336
|
+
### Buttons
|
|
337
|
+
|
|
338
|
+
- **Hierarchy**: One primary action per view. Secondary and ghost variants for supporting actions.
|
|
339
|
+
- **Sizing**: Minimum tap target 44×44px (mobile). Desktop: height `36px` (sm), `40px` (md), `48px` (lg).
|
|
340
|
+
- **States**: Every button must have `default`, `hover`, `active`, `focus`, and `disabled` states defined.
|
|
341
|
+
- **Labels**: Verb-first ("Save changes", "Delete account", not "Changes" or "Account deletion").
|
|
342
|
+
- ❌ Never use more than one primary button per section.
|
|
343
|
+
|
|
344
|
+
### Inputs & Forms
|
|
345
|
+
|
|
346
|
+
- **Label above input**, always. Placeholder text is not a label.
|
|
347
|
+
- **Error messages** appear below the input in `destructive` color with an icon.
|
|
348
|
+
- **Focus state**: Must be visible — `2px outline` offset by `2px` using the `accent` color.
|
|
349
|
+
- **Input height**: Match button height for the same size tier (consistent rhythm).
|
|
350
|
+
- **Disabled state**: Reduced opacity (`0.4–0.5`) + `cursor: not-allowed`.
|
|
351
|
+
|
|
352
|
+
### Cards
|
|
353
|
+
|
|
354
|
+
- One consistent internal padding token (e.g. `space-6` everywhere).
|
|
355
|
+
- Clear visual separation from background via `surface` color, `shadow-sm`, or `border`.
|
|
356
|
+
- Don't overload a card — one primary action, one primary data point.
|
|
357
|
+
|
|
358
|
+
### Navigation
|
|
359
|
+
|
|
360
|
+
- **Active state** must be unambiguous — not just a color change, but weight or indicator.
|
|
361
|
+
- **Mobile nav**: Hamburger menus are acceptable; bottom tab bars are preferred for primary navigation on mobile apps.
|
|
362
|
+
- Never rely solely on color to indicate active state (accessibility).
|
|
363
|
+
|
|
364
|
+
### Modals & Dialogs
|
|
365
|
+
|
|
366
|
+
- Always include a visible close affordance (× button or explicit "Cancel").
|
|
367
|
+
- **Backdrop**: Semi-transparent overlay (`rgba(0,0,0,0.4–0.6)`) behind the modal.
|
|
368
|
+
- **Focus trap**: Keyboard focus must be trapped inside an open modal.
|
|
369
|
+
- **Max width**: Modals should not exceed `560px` for forms/confirmations, `800px` for content-heavy dialogs.
|
|
370
|
+
|
|
371
|
+
### Empty States
|
|
372
|
+
|
|
373
|
+
- Every list, table, or data view must have an empty state.
|
|
374
|
+
- Empty states must include: an illustration or icon, a clear label, and a primary call to action where appropriate.
|
|
375
|
+
- ❌ Never show a blank white box with no content.
|
|
376
|
+
|
|
377
|
+
### Loading States
|
|
378
|
+
|
|
379
|
+
- **Skeleton screens** over spinners for content-heavy loads (cards, lists, tables).
|
|
380
|
+
- **Inline spinners** for button actions and small fetch operations.
|
|
381
|
+
- **Progress indicators** for long operations with knowable duration.
|
|
382
|
+
- All loading states must communicate that something is happening — never leave the user with a frozen UI.
|
|
383
|
+
|
|
384
|
+
---
|
|
385
|
+
|
|
386
|
+
## 11. Accessibility Baselines
|
|
387
|
+
|
|
388
|
+
These are non-negotiable floors, not aspirational targets.
|
|
389
|
+
|
|
390
|
+
- **Color contrast**: AA minimum for all text. AAA preferred for body copy.
|
|
391
|
+
- **Keyboard navigation**: All interactive elements reachable and operable via keyboard.
|
|
392
|
+
- **Focus indicators**: Never remove focus outlines. Style them to match the design system.
|
|
393
|
+
- **Semantic HTML**: Use correct elements (`<button>` for actions, `<a>` for navigation, heading hierarchy, `<label>` for inputs).
|
|
394
|
+
- **ARIA**: Only use ARIA attributes when semantic HTML is insufficient. Don't over-ARIA.
|
|
395
|
+
- **Alt text**: All meaningful images have descriptive `alt` attributes. Decorative images use `alt=""`.
|
|
396
|
+
- **Touch targets**: Minimum 44×44px on mobile.
|
|
397
|
+
|
|
398
|
+
---
|
|
399
|
+
|
|
400
|
+
## 12. Anti-patterns (Global)
|
|
401
|
+
|
|
402
|
+
The following are prohibited in all generated interfaces regardless of aesthetic direction:
|
|
403
|
+
|
|
404
|
+
| Anti-pattern | Why |
|
|
405
|
+
|---|---|
|
|
406
|
+
| Hardcoded color values (`#3B82F6` inline) | Breaks theming and token system |
|
|
407
|
+
| Arbitrary spacing values (`margin: 13px`) | Breaks spatial consistency |
|
|
408
|
+
| More than 2 typefaces | Visual noise, loading overhead |
|
|
409
|
+
| Missing hover/focus/disabled states | Incomplete component contracts |
|
|
410
|
+
| Color as the only differentiator for state | Accessibility failure |
|
|
411
|
+
| Placeholder as label | Disappears on input; fails accessibility |
|
|
412
|
+
| Shadows on dark mode surfaces | Invisible, looks broken |
|
|
413
|
+
| Animations on layout properties | Causes jank and repaints |
|
|
414
|
+
| Blank empty states | Disorienting UX |
|
|
415
|
+
| Mixing icon libraries | Inconsistent visual language |
|
|
416
|
+
| Generic purple gradient on white | Overused AI aesthetic default |
|
|
417
|
+
| Full-width body text (no max-width) | Unreadable line lengths |
|
|
418
|
+
|
|
419
|
+
---
|
|
420
|
+
|
|
421
|
+
## 13. Token Reference Template
|
|
422
|
+
|
|
423
|
+
Use this template when initializing a new project's CSS custom properties:
|
|
424
|
+
|
|
425
|
+
```css
|
|
426
|
+
:root {
|
|
427
|
+
/* Color */
|
|
428
|
+
--color-background: ;
|
|
429
|
+
--color-surface: ;
|
|
430
|
+
--color-border: ;
|
|
431
|
+
--color-text-primary: ;
|
|
432
|
+
--color-text-secondary: ;
|
|
433
|
+
--color-text-disabled: ;
|
|
434
|
+
--color-accent: ;
|
|
435
|
+
--color-accent-hover: ;
|
|
436
|
+
--color-destructive: ;
|
|
437
|
+
--color-success: ;
|
|
438
|
+
|
|
439
|
+
/* Typography */
|
|
440
|
+
--font-display: ;
|
|
441
|
+
--font-body: ;
|
|
442
|
+
|
|
443
|
+
--text-xs: 0.75rem;
|
|
444
|
+
--text-sm: 0.875rem;
|
|
445
|
+
--text-base: 1rem;
|
|
446
|
+
--text-lg: 1.125rem;
|
|
447
|
+
--text-xl: 1.25rem;
|
|
448
|
+
--text-2xl: 1.5rem;
|
|
449
|
+
--text-3xl: 1.875rem;
|
|
450
|
+
--text-4xl: 2.25rem;
|
|
451
|
+
|
|
452
|
+
/* Spacing */
|
|
453
|
+
--space-1: 4px;
|
|
454
|
+
--space-2: 8px;
|
|
455
|
+
--space-3: 12px;
|
|
456
|
+
--space-4: 16px;
|
|
457
|
+
--space-6: 24px;
|
|
458
|
+
--space-8: 32px;
|
|
459
|
+
--space-12: 48px;
|
|
460
|
+
--space-16: 64px;
|
|
461
|
+
--space-24: 96px;
|
|
462
|
+
|
|
463
|
+
/* Radius */
|
|
464
|
+
--radius-sm: 4px;
|
|
465
|
+
--radius-md: 8px;
|
|
466
|
+
--radius-lg: 12px;
|
|
467
|
+
--radius-xl: 16px;
|
|
468
|
+
--radius-full: 9999px;
|
|
469
|
+
|
|
470
|
+
/* Shadow */
|
|
471
|
+
--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
|
|
472
|
+
--shadow-md: 0 4px 12px rgba(0, 0, 0, 0.10);
|
|
473
|
+
--shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.14);
|
|
474
|
+
}
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
---
|
|
478
|
+
|
|
479
|
+
## 14. Aesthetic Direction: Precision Dark
|
|
480
|
+
|
|
481
|
+
**Conceptual anchor**: Surgical. Clinical. Unhurried.
|
|
482
|
+
|
|
483
|
+
Inspired by the visual language of ElevenLabs — dark-mode-first, typographically restrained, almost no decorative color. Every element earns its place. The UI feels like a tool built by people who trust the product to speak for itself.
|
|
484
|
+
|
|
485
|
+
---
|
|
486
|
+
|
|
487
|
+
### 14.1 Personality
|
|
488
|
+
|
|
489
|
+
| Attribute | Value |
|
|
490
|
+
|---|---|
|
|
491
|
+
| Mode | Dark-first |
|
|
492
|
+
| Density | Low-to-medium. Breathing room over information density. |
|
|
493
|
+
| Personality | Restrained, precise, confident |
|
|
494
|
+
| Color usage | Near-monochromatic. One accent, used sparingly. |
|
|
495
|
+
| Motion | Minimal. Functional only. |
|
|
496
|
+
| Radius | Tight. Sharp-edged components. |
|
|
497
|
+
| Borders | Subtle. Structure via contrast, not heavy lines. |
|
|
498
|
+
|
|
499
|
+
---
|
|
500
|
+
|
|
501
|
+
### 14.2 Color Tokens
|
|
502
|
+
|
|
503
|
+
```css
|
|
504
|
+
:root {
|
|
505
|
+
/* Backgrounds */
|
|
506
|
+
--color-background: #0a0a0a; /* Near-black page base */
|
|
507
|
+
--color-surface: #111111; /* Cards, sidebars, panels */
|
|
508
|
+
--color-surface-raised: #1a1a1a; /* Hover state surfaces, nested panels */
|
|
509
|
+
|
|
510
|
+
/* Borders */
|
|
511
|
+
--color-border: #222222; /* Default border — barely visible */
|
|
512
|
+
--color-border-strong: #333333; /* Emphasized dividers, active states */
|
|
513
|
+
|
|
514
|
+
/* Text */
|
|
515
|
+
--color-text-primary: #f5f5f5; /* Primary content */
|
|
516
|
+
--color-text-secondary: #888888; /* Labels, metadata, captions */
|
|
517
|
+
--color-text-disabled: #444444; /* Inactive elements */
|
|
518
|
+
--color-text-inverse: #0a0a0a; /* Text on accent backgrounds */
|
|
519
|
+
|
|
520
|
+
/* Accent */
|
|
521
|
+
--color-accent: #e8e8e8; /* Off-white — primary interactive */
|
|
522
|
+
--color-accent-hover: #ffffff; /* Full white on hover */
|
|
523
|
+
--color-accent-subtle: rgba(232, 232, 232, 0.08); /* Hover fill on ghost elements */
|
|
524
|
+
|
|
525
|
+
/* Semantic */
|
|
526
|
+
--color-destructive: #ef4444;
|
|
527
|
+
--color-destructive-subtle: rgba(239, 68, 68, 0.10);
|
|
528
|
+
--color-success: #22c55e;
|
|
529
|
+
--color-success-subtle: rgba(34, 197, 94, 0.10);
|
|
530
|
+
}
|
|
531
|
+
```
|
|
532
|
+
|
|
533
|
+
**Color usage rules for this aesthetic:**
|
|
534
|
+
- The accent is off-white, not a hue. This keeps the palette near-monochromatic and avoids competing focal points.
|
|
535
|
+
- Use `--color-accent` only for primary buttons, active states, and critical interactive affordances.
|
|
536
|
+
- Surface differentiation is done through subtle background lightness steps (`#0a0a0a` → `#111` → `#1a1a1a`), not shadows.
|
|
537
|
+
- No gradients on UI elements. Gradients are permitted only on illustrative/hero visuals and must be subtle (low-contrast, dark-on-dark).
|
|
538
|
+
- ❌ No colored glows, no neon accents, no brand-color fills on surfaces.
|
|
539
|
+
|
|
540
|
+
---
|
|
541
|
+
|
|
542
|
+
### 14.3 Typography Tokens
|
|
543
|
+
|
|
544
|
+
```css
|
|
545
|
+
:root {
|
|
546
|
+
--font-display: 'Geist', 'DM Sans', sans-serif; /* Clean geometric sans */
|
|
547
|
+
--font-body: 'Geist', 'DM Sans', sans-serif; /* Unified — one family */
|
|
548
|
+
--font-mono: 'Geist Mono', 'JetBrains Mono', monospace;
|
|
549
|
+
|
|
550
|
+
--font-weight-regular: 400;
|
|
551
|
+
--font-weight-medium: 500;
|
|
552
|
+
--font-weight-semibold: 600;
|
|
553
|
+
}
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
**Typography rules for this aesthetic:**
|
|
557
|
+
- One typeface throughout. Hierarchy is created through size and weight alone — not through font mixing.
|
|
558
|
+
- Headings: `font-weight: 500` or `600`. Never heavy/bold (700+) — this aesthetic avoids aggression.
|
|
559
|
+
- Body: `font-weight: 400`. `line-height: 1.6`.
|
|
560
|
+
- Labels and UI metadata: `font-weight: 400–500`, `--text-sm`, `--color-text-secondary`.
|
|
561
|
+
- Monospace for any code, API keys, file names, or data values.
|
|
562
|
+
- Letter spacing on headings: `-0.02em` to `-0.03em`. Tighten, don't loosen.
|
|
563
|
+
- ❌ No decorative typefaces. No serif. No display fonts with personality — the restraint is the personality.
|
|
564
|
+
|
|
565
|
+
---
|
|
566
|
+
|
|
567
|
+
### 14.4 Spacing Behavior
|
|
568
|
+
|
|
569
|
+
This aesthetic uses **generous vertical space** and **tight horizontal padding**.
|
|
570
|
+
|
|
571
|
+
- Page-level sections: `--space-16` to `--space-24` vertical separation.
|
|
572
|
+
- Component internal padding: `--space-4` (16px) horizontal, `--space-3` (12px) vertical for standard density.
|
|
573
|
+
- Between a label and its value: `--space-1` to `--space-2`.
|
|
574
|
+
- Between sibling components: `--space-6` to `--space-8`.
|
|
575
|
+
- Content max-width: `720px` for reading/form views. `1100px` for dashboards.
|
|
576
|
+
|
|
577
|
+
---
|
|
578
|
+
|
|
579
|
+
### 14.5 Border & Radius
|
|
580
|
+
|
|
581
|
+
```css
|
|
582
|
+
:root {
|
|
583
|
+
--radius-sm: 4px; /* Badges, tags */
|
|
584
|
+
--radius-md: 6px; /* Buttons, inputs — keep it tight */
|
|
585
|
+
--radius-lg: 8px; /* Cards, panels */
|
|
586
|
+
--radius-xl: 10px; /* Modals — still restrained */
|
|
587
|
+
--radius-full: 9999px;
|
|
588
|
+
}
|
|
589
|
+
```
|
|
590
|
+
|
|
591
|
+
- Radius is **deliberately small**. The sharpness signals precision.
|
|
592
|
+
- Borders default to `1px solid var(--color-border)` — barely visible, structure through contrast not lines.
|
|
593
|
+
- No heavy border treatments. No 2px borders except for active/selected component states.
|
|
594
|
+
|
|
595
|
+
---
|
|
596
|
+
|
|
597
|
+
### 14.6 Elevation & Shadows
|
|
598
|
+
|
|
599
|
+
- **Shadows are not used** as the primary elevation signal in dark mode.
|
|
600
|
+
- Elevation is communicated via background color stepping:
|
|
601
|
+
- Page → `#0a0a0a`
|
|
602
|
+
- Sidebar / panel → `#111111`
|
|
603
|
+
- Card / modal → `#1a1a1a`
|
|
604
|
+
- If a shadow is needed (e.g. a floating dropdown), use:
|
|
605
|
+
```css
|
|
606
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
|
|
607
|
+
```
|
|
608
|
+
- ❌ No colorful or glowing shadows.
|
|
609
|
+
|
|
610
|
+
---
|
|
611
|
+
|
|
612
|
+
### 14.7 Component Specifics
|
|
613
|
+
|
|
614
|
+
**Buttons**
|
|
615
|
+
- Primary: `background: var(--color-accent)` (off-white), `color: var(--color-text-inverse)`, `radius: var(--radius-md)`.
|
|
616
|
+
- Secondary/Ghost: transparent background, `border: 1px solid var(--color-border-strong)`, text `--color-text-primary`. On hover: `background: var(--color-accent-subtle)`.
|
|
617
|
+
- Destructive: ghost by default, text in `--color-destructive`. Reserve filled destructive for confirmation dialogs only.
|
|
618
|
+
- Height: `36px` (sm), `40px` (md — default). No large buttons unless hero context.
|
|
619
|
+
- Padding: `12px 16px` (md).
|
|
620
|
+
|
|
621
|
+
**Inputs**
|
|
622
|
+
- Background: `var(--color-surface)`.
|
|
623
|
+
- Border: `1px solid var(--color-border)`. On focus: `1px solid var(--color-border-strong)` + `outline: 2px solid rgba(232,232,232,0.15)`.
|
|
624
|
+
- No colored focus rings — keep it monochromatic.
|
|
625
|
+
- Placeholder: `var(--color-text-disabled)`.
|
|
626
|
+
|
|
627
|
+
**Cards / Panels**
|
|
628
|
+
- Background: `var(--color-surface)`.
|
|
629
|
+
- Border: `1px solid var(--color-border)`. No shadow.
|
|
630
|
+
- Internal padding: `--space-6` (24px).
|
|
631
|
+
- Header/body division: `border-bottom: 1px solid var(--color-border)`, not a background color change.
|
|
632
|
+
|
|
633
|
+
**Navigation (Sidebar)**
|
|
634
|
+
- Background: matches `--color-surface` or `--color-background` — flush with page.
|
|
635
|
+
- Active item: `background: var(--color-surface-raised)`, `color: var(--color-text-primary)`. No colored indicator bar — background shift is sufficient.
|
|
636
|
+
- Inactive items: `--color-text-secondary`.
|
|
637
|
+
- Icon + label pairs: `--space-2` gap, icons at 16px.
|
|
638
|
+
|
|
639
|
+
**Data / Labels**
|
|
640
|
+
- Key-value pairs: label in `--color-text-secondary` `--text-sm`, value in `--color-text-primary` `--text-base` or `--text-sm`.
|
|
641
|
+
- Tables: no zebra striping. Row hover: `background: var(--color-surface-raised)`. Header row: `--color-text-secondary`, `--text-xs`, uppercase, `letter-spacing: 0.06em`.
|
|
642
|
+
|
|
643
|
+
---
|
|
644
|
+
|
|
645
|
+
### 14.8 Motion Rules
|
|
646
|
+
|
|
647
|
+
This aesthetic uses **the minimum effective motion**.
|
|
648
|
+
|
|
649
|
+
- Transition duration: `150ms` for hover states, `200ms` for panel opens, `250ms` for modals.
|
|
650
|
+
- Easing: `ease-out` universally.
|
|
651
|
+
- Entrance animations: `opacity: 0 → 1` + `translateY(4px) → translateY(0)`. Subtle. Never slides more than 6–8px.
|
|
652
|
+
- ❌ No spring physics. No elastic easing. No bounce.
|
|
653
|
+
- ❌ No staggered list animations unless the list load is a primary UX moment.
|
|
654
|
+
- ❌ No background particle effects, no ambient motion.
|
|
655
|
+
|
|
656
|
+
---
|
|
657
|
+
|
|
658
|
+
### 14.9 Do / Don't Summary
|
|
659
|
+
|
|
660
|
+
| ✅ Do | ❌ Don't |
|
|
661
|
+
|---|---|
|
|
662
|
+
| Near-black backgrounds with layered surfaces | True black `#000000` — too harsh |
|
|
663
|
+
| Off-white accent, used sparingly | Colored accents (blue, purple, green) |
|
|
664
|
+
| One geometric sans typeface | Mixing fonts or using serifs |
|
|
665
|
+
| Tight radius (4–8px) | Pill-shaped cards or panels |
|
|
666
|
+
| Structure via border + bg contrast | Heavy shadows or glows |
|
|
667
|
+
| Generous vertical breathing room | Dense, packed layouts |
|
|
668
|
+
| Monochromatic palette with 1 semantic accent | Multi-color UI elements |
|
|
669
|
+
| Minimal, fast transitions | Bouncy, expressive animation |
|
|
670
|
+
| Subtle `translateY` entrance motion | Full slide-ins or dramatic reveals |
|
|
671
|
+
|
|
672
|
+
---
|
|
673
|
+
|
|
674
|
+
## 15. Active Token Values
|
|
675
|
+
|
|
676
|
+
> **Agent instructions**: This section is filled in by the agent after reading the codebase (Step 4 of the Agent Instructions above). Replace every `FILL_IN` placeholder with the extracted or improved value. Do not leave any placeholder blank — if a value cannot be determined from the codebase, make a best-judgment recommendation and flag it with a `# inferred` comment.
|
|
677
|
+
>
|
|
678
|
+
> Once filled in, this section is the canonical source of truth. All code generation must reference these tokens.
|
|
679
|
+
|
|
680
|
+
### 15.1 Metadata
|
|
681
|
+
|
|
682
|
+
```
|
|
683
|
+
Codebase path: FILL_IN
|
|
684
|
+
Mode: FILL_IN (A — Extract & Codify | B — Improve & Codify)
|
|
685
|
+
Conceptual anchor: FILL_IN (one word or phrase describing the aesthetic)
|
|
686
|
+
Date extracted: FILL_IN
|
|
687
|
+
Conflicts resolved: FILL_IN (list any, or "none")
|
|
688
|
+
```
|
|
689
|
+
|
|
690
|
+
---
|
|
691
|
+
|
|
692
|
+
### 15.2 Color Tokens
|
|
693
|
+
|
|
694
|
+
```css
|
|
695
|
+
:root {
|
|
696
|
+
/* --- Backgrounds --- */
|
|
697
|
+
--color-background: FILL_IN; /* Page base */
|
|
698
|
+
--color-surface: FILL_IN; /* Cards, panels, sidebars */
|
|
699
|
+
--color-surface-raised: FILL_IN; /* Hover surfaces, nested panels */
|
|
700
|
+
|
|
701
|
+
/* --- Borders --- */
|
|
702
|
+
--color-border: FILL_IN; /* Default border */
|
|
703
|
+
--color-border-strong: FILL_IN; /* Active states, emphasized dividers */
|
|
704
|
+
|
|
705
|
+
/* --- Text --- */
|
|
706
|
+
--color-text-primary: FILL_IN; /* Primary readable content */
|
|
707
|
+
--color-text-secondary: FILL_IN; /* Labels, captions, metadata */
|
|
708
|
+
--color-text-disabled: FILL_IN; /* Inactive elements */
|
|
709
|
+
--color-text-inverse: FILL_IN; /* Text on accent-colored backgrounds */
|
|
710
|
+
|
|
711
|
+
/* --- Accent --- */
|
|
712
|
+
--color-accent: FILL_IN; /* Primary interactive / brand color */
|
|
713
|
+
--color-accent-hover: FILL_IN; /* Accent on hover */
|
|
714
|
+
--color-accent-subtle: FILL_IN; /* Low-opacity accent for hover fills */
|
|
715
|
+
|
|
716
|
+
/* --- Semantic --- */
|
|
717
|
+
--color-destructive: FILL_IN;
|
|
718
|
+
--color-destructive-subtle: FILL_IN;
|
|
719
|
+
--color-success: FILL_IN;
|
|
720
|
+
--color-success-subtle: FILL_IN;
|
|
721
|
+
}
|
|
722
|
+
```
|
|
723
|
+
|
|
724
|
+
**Light mode** (fill in if the UI supports both modes):
|
|
725
|
+
|
|
726
|
+
```css
|
|
727
|
+
[data-theme="light"] {
|
|
728
|
+
--color-background: FILL_IN;
|
|
729
|
+
--color-surface: FILL_IN;
|
|
730
|
+
--color-surface-raised: FILL_IN;
|
|
731
|
+
--color-border: FILL_IN;
|
|
732
|
+
--color-border-strong: FILL_IN;
|
|
733
|
+
--color-text-primary: FILL_IN;
|
|
734
|
+
--color-text-secondary: FILL_IN;
|
|
735
|
+
--color-text-disabled: FILL_IN;
|
|
736
|
+
--color-text-inverse: FILL_IN;
|
|
737
|
+
--color-accent: FILL_IN;
|
|
738
|
+
--color-accent-hover: FILL_IN;
|
|
739
|
+
--color-accent-subtle: FILL_IN;
|
|
740
|
+
}
|
|
741
|
+
```
|
|
742
|
+
|
|
743
|
+
---
|
|
744
|
+
|
|
745
|
+
### 15.3 Typography Tokens
|
|
746
|
+
|
|
747
|
+
```css
|
|
748
|
+
:root {
|
|
749
|
+
--font-display: FILL_IN; /* Display / heading typeface */
|
|
750
|
+
--font-body: FILL_IN; /* Body / UI typeface */
|
|
751
|
+
--font-mono: FILL_IN; /* Code, data values, keys */
|
|
752
|
+
|
|
753
|
+
--font-weight-regular: FILL_IN; /* e.g. 400 */
|
|
754
|
+
--font-weight-medium: FILL_IN; /* e.g. 500 */
|
|
755
|
+
--font-weight-semibold: FILL_IN; /* e.g. 600 */
|
|
756
|
+
|
|
757
|
+
--text-xs: FILL_IN; /* e.g. 0.75rem */
|
|
758
|
+
--text-sm: FILL_IN; /* e.g. 0.875rem */
|
|
759
|
+
--text-base: FILL_IN; /* e.g. 1rem */
|
|
760
|
+
--text-lg: FILL_IN; /* e.g. 1.125rem */
|
|
761
|
+
--text-xl: FILL_IN; /* e.g. 1.25rem */
|
|
762
|
+
--text-2xl: FILL_IN; /* e.g. 1.5rem */
|
|
763
|
+
--text-3xl: FILL_IN; /* e.g. 1.875rem */
|
|
764
|
+
--text-4xl: FILL_IN; /* e.g. 2.25rem */
|
|
765
|
+
|
|
766
|
+
--leading-tight: FILL_IN; /* Headings, e.g. 1.1 */
|
|
767
|
+
--leading-snug: FILL_IN; /* UI labels, e.g. 1.3 */
|
|
768
|
+
--leading-normal: FILL_IN; /* Body copy, e.g. 1.6 */
|
|
769
|
+
|
|
770
|
+
--tracking-tight: FILL_IN; /* Large headings, e.g. -0.02em */
|
|
771
|
+
--tracking-normal: 0;
|
|
772
|
+
--tracking-wide: FILL_IN; /* Uppercase labels, e.g. 0.06em */
|
|
773
|
+
}
|
|
774
|
+
```
|
|
775
|
+
|
|
776
|
+
**Notes** (fill in after extraction):
|
|
777
|
+
```
|
|
778
|
+
Heading weight: FILL_IN
|
|
779
|
+
Body weight: FILL_IN
|
|
780
|
+
Max line length: FILL_IN (characters)
|
|
781
|
+
Font source: FILL_IN (Google Fonts / Bunny / self-hosted / system)
|
|
782
|
+
```
|
|
783
|
+
|
|
784
|
+
---
|
|
785
|
+
|
|
786
|
+
### 15.4 Spacing Tokens
|
|
787
|
+
|
|
788
|
+
```css
|
|
789
|
+
:root {
|
|
790
|
+
--space-base: FILL_IN; /* Base unit, e.g. 4px */
|
|
791
|
+
|
|
792
|
+
--space-1: FILL_IN; /* 1× base */
|
|
793
|
+
--space-2: FILL_IN; /* 2× base */
|
|
794
|
+
--space-3: FILL_IN; /* 3× base */
|
|
795
|
+
--space-4: FILL_IN; /* 4× base */
|
|
796
|
+
--space-6: FILL_IN; /* 6× base */
|
|
797
|
+
--space-8: FILL_IN; /* 8× base */
|
|
798
|
+
--space-12: FILL_IN; /* 12× base */
|
|
799
|
+
--space-16: FILL_IN; /* 16× base */
|
|
800
|
+
--space-24: FILL_IN; /* 24× base */
|
|
801
|
+
}
|
|
802
|
+
```
|
|
803
|
+
|
|
804
|
+
**Notes**:
|
|
805
|
+
```
|
|
806
|
+
Component internal padding (standard): FILL_IN
|
|
807
|
+
Between sibling components: FILL_IN
|
|
808
|
+
Between page sections: FILL_IN
|
|
809
|
+
Content max-width (reading): FILL_IN
|
|
810
|
+
Content max-width (dashboard): FILL_IN
|
|
811
|
+
```
|
|
812
|
+
|
|
813
|
+
---
|
|
814
|
+
|
|
815
|
+
### 15.5 Border & Radius Tokens
|
|
816
|
+
|
|
817
|
+
```css
|
|
818
|
+
:root {
|
|
819
|
+
--border-width: FILL_IN; /* e.g. 1px */
|
|
820
|
+
--border-style: FILL_IN; /* e.g. solid */
|
|
821
|
+
|
|
822
|
+
--radius-sm: FILL_IN; /* Badges, tags */
|
|
823
|
+
--radius-md: FILL_IN; /* Buttons, inputs */
|
|
824
|
+
--radius-lg: FILL_IN; /* Cards, panels */
|
|
825
|
+
--radius-xl: FILL_IN; /* Modals */
|
|
826
|
+
--radius-full: 9999px;
|
|
827
|
+
}
|
|
828
|
+
```
|
|
829
|
+
|
|
830
|
+
---
|
|
831
|
+
|
|
832
|
+
### 15.6 Shadow Tokens
|
|
833
|
+
|
|
834
|
+
```css
|
|
835
|
+
:root {
|
|
836
|
+
--shadow-sm: FILL_IN; /* Subtle card lift */
|
|
837
|
+
--shadow-md: FILL_IN; /* Dropdowns, popovers */
|
|
838
|
+
--shadow-lg: FILL_IN; /* Modals, floating panels */
|
|
839
|
+
--shadow-none: none;
|
|
840
|
+
}
|
|
841
|
+
```
|
|
842
|
+
|
|
843
|
+
**Notes**:
|
|
844
|
+
```
|
|
845
|
+
Elevation strategy: FILL_IN (shadows | background-stepping | borders | mixed)
|
|
846
|
+
Dark mode approach: FILL_IN
|
|
847
|
+
```
|
|
848
|
+
|
|
849
|
+
---
|
|
850
|
+
|
|
851
|
+
### 15.7 Motion Tokens
|
|
852
|
+
|
|
853
|
+
```css
|
|
854
|
+
:root {
|
|
855
|
+
--duration-fast: FILL_IN; /* Hover states, e.g. 150ms */
|
|
856
|
+
--duration-base: FILL_IN; /* Panel opens, e.g. 200ms */
|
|
857
|
+
--duration-slow: FILL_IN; /* Modals, entrances, e.g. 300ms */
|
|
858
|
+
|
|
859
|
+
--ease-out: cubic-bezier(0.0, 0.0, 0.2, 1);
|
|
860
|
+
--ease-in: cubic-bezier(0.4, 0.0, 1, 1);
|
|
861
|
+
--ease-inout: cubic-bezier(0.4, 0.0, 0.2, 1);
|
|
862
|
+
}
|
|
863
|
+
```
|
|
864
|
+
|
|
865
|
+
**Entrance animation pattern**:
|
|
866
|
+
```
|
|
867
|
+
FILL_IN (e.g. opacity 0→1 + translateY(4px)→0, duration: --duration-slow, easing: --ease-out)
|
|
868
|
+
```
|
|
869
|
+
|
|
870
|
+
---
|
|
871
|
+
|
|
872
|
+
### 15.8 Breakpoints
|
|
873
|
+
|
|
874
|
+
```css
|
|
875
|
+
/* FILL_IN — confirm or adjust based on codebase */
|
|
876
|
+
--breakpoint-sm: 640px;
|
|
877
|
+
--breakpoint-md: 768px;
|
|
878
|
+
--breakpoint-lg: 1024px;
|
|
879
|
+
--breakpoint-xl: 1280px;
|
|
880
|
+
--breakpoint-2xl: 1536px;
|
|
881
|
+
```
|
|
882
|
+
|
|
883
|
+
---
|
|
884
|
+
|
|
885
|
+
### 15.9 Component Conventions
|
|
886
|
+
|
|
887
|
+
> Fill in after reading component files. One row per component type found in the codebase.
|
|
888
|
+
|
|
889
|
+
| Component | Radius | Padding | Border | Shadow | Notes |
|
|
890
|
+
|---|---|---|---|---|---|
|
|
891
|
+
| Button (primary) | FILL_IN | FILL_IN | FILL_IN | FILL_IN | |
|
|
892
|
+
| Button (secondary) | FILL_IN | FILL_IN | FILL_IN | FILL_IN | |
|
|
893
|
+
| Input | FILL_IN | FILL_IN | FILL_IN | FILL_IN | |
|
|
894
|
+
| Card | FILL_IN | FILL_IN | FILL_IN | FILL_IN | |
|
|
895
|
+
| Modal | FILL_IN | FILL_IN | FILL_IN | FILL_IN | |
|
|
896
|
+
| Nav item (active) | FILL_IN | FILL_IN | FILL_IN | FILL_IN | |
|
|
897
|
+
| Badge / Tag | FILL_IN | FILL_IN | FILL_IN | FILL_IN | |
|
|
898
|
+
| Table row (hover) | FILL_IN | FILL_IN | FILL_IN | FILL_IN | |
|
|
899
|
+
|
|
900
|
+
---
|
|
901
|
+
|
|
902
|
+
## 16. Improvement Guidelines (Mode B Only)
|
|
903
|
+
|
|
904
|
+
> Read this section only if operating in **Mode B — Improve & Codify**. These are the upgrade criteria applied before filling in Section 15 tokens. Use the improved values — not the raw extracted values — when completing the token template.
|
|
905
|
+
|
|
906
|
+
When improving an existing design, evaluate each category below and apply the relevant upgrade if the existing design falls short.
|
|
907
|
+
|
|
908
|
+
### 16.1 Color
|
|
909
|
+
|
|
910
|
+
| If the codebase has… | Upgrade to… |
|
|
911
|
+
|---|---|
|
|
912
|
+
| More than 8 distinct colors | Consolidate. Map all colors to the role system in Section 2. Eliminate any that don't serve a role. |
|
|
913
|
+
| Hardcoded hex values throughout | Extract to CSS custom properties. |
|
|
914
|
+
| Low-contrast text | Adjust text or background values to meet WCAG AA. |
|
|
915
|
+
| A colored accent used everywhere | Reduce usage to interactive elements only. Create an `accent-subtle` token for hover fills. |
|
|
916
|
+
| No dark mode | Add a `[data-theme="dark"]` layer if the aesthetic warrants it. Flag if unsure. |
|
|
917
|
+
| Generic blue/purple as accent | Keep if it's intentional brand color. Flag as worth revisiting if it appears to be a framework default. |
|
|
918
|
+
|
|
919
|
+
### 16.2 Typography
|
|
920
|
+
|
|
921
|
+
| If the codebase has… | Upgrade to… |
|
|
922
|
+
|---|---|
|
|
923
|
+
| Inter, Roboto, or Arial as the only typeface | Replace with a more characterful choice that fits the aesthetic. Retain if it's an intentional brand decision — ask the user. |
|
|
924
|
+
| More than 3 font weights | Reduce to 3. Map usage to `regular`, `medium`, `semibold`. |
|
|
925
|
+
| No consistent type scale | Map all sizes to the nearest step on the modular scale. Eliminate outliers. |
|
|
926
|
+
| Heading weights at 700+ | Reduce to 500–600 for a more refined feel, unless bold is core to the aesthetic. |
|
|
927
|
+
| Inconsistent line heights | Normalize to `--leading-tight` (headings), `--leading-snug` (UI), `--leading-normal` (body). |
|
|
928
|
+
|
|
929
|
+
### 16.3 Spacing
|
|
930
|
+
|
|
931
|
+
| If the codebase has… | Upgrade to… |
|
|
932
|
+
|---|---|
|
|
933
|
+
| Arbitrary margin/padding values (e.g. 13px, 22px) | Round to nearest scale step. |
|
|
934
|
+
| No consistent base unit | Establish 4px base. Map all values. |
|
|
935
|
+
| Tight, cramped components | Increase internal padding to at least `--space-3` vertical / `--space-4` horizontal. |
|
|
936
|
+
| Excessive whitespace in dense UI | Tighten to `--space-2` / `--space-3` internal where appropriate. |
|
|
937
|
+
|
|
938
|
+
### 16.4 Radius
|
|
939
|
+
|
|
940
|
+
| If the codebase has… | Upgrade to… |
|
|
941
|
+
|---|---|
|
|
942
|
+
| Inconsistent radius across same component type | Normalize. Pick one radius per component tier. |
|
|
943
|
+
| Very high radius (≥16px) on functional components | Reduce unless the aesthetic is explicitly approachable/friendly. |
|
|
944
|
+
| 0px radius (sharp) on all components | Introduce `--radius-sm` (4px) minimum for softness, unless brutalist aesthetic is intentional. |
|
|
945
|
+
|
|
946
|
+
### 16.5 Shadows
|
|
947
|
+
|
|
948
|
+
| If the codebase has… | Upgrade to… |
|
|
949
|
+
|---|---|
|
|
950
|
+
| `box-shadow` with colored or glowing tints | Replace with neutral `rgba(0,0,0,x)` shadows. |
|
|
951
|
+
| Same shadow value used at all elevation levels | Introduce 3-level shadow scale (sm / md / lg). |
|
|
952
|
+
| Shadows on dark mode surfaces | Remove. Use background-color stepping for elevation instead. |
|
|
953
|
+
|
|
954
|
+
### 16.6 General
|
|
955
|
+
|
|
956
|
+
- **Consolidate duplication**: If the same component is implemented differently across files (different padding, different colors), unify under the token system.
|
|
957
|
+
- **Remove magic numbers**: Any value that can't be explained by the token scale should be replaced or flagged.
|
|
958
|
+
- **Don't redesign, refine**: Mode B is not a full redesign. The user's visual intent should be preserved. You are improving execution, not changing direction — unless the user explicitly asks.
|
|
959
|
+
|
|
960
|
+
---
|
|
961
|
+
|
|
962
|
+
## 17. Changelog
|
|
963
|
+
|
|
964
|
+
> The agent appends an entry here after each run. Format: date, mode, summary of changes made.
|
|
965
|
+
|
|
966
|
+
```
|
|
967
|
+
[FILL_IN date] — Mode [A/B]
|
|
968
|
+
- FILL_IN (e.g. "Extracted tokens from globals.css and 14 component files")
|
|
969
|
+
- FILL_IN (e.g. "Resolved conflict: 3 accent colors consolidated to #3B82F6")
|
|
970
|
+
- FILL_IN (e.g. "Applied improved type scale across 8 components")
|
|
971
|
+
```
|