ui-mirror-skill 1.0.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 +95 -0
- package/bin/cli.mjs +121 -0
- package/package.json +34 -0
- package/skill/SKILL.md +751 -0
- package/skill/references/analysis-dimensions.md +382 -0
- package/skill/references/component-catalog.md +758 -0
- package/skill/references/css-token-mapping.md +359 -0
- package/skill/references/output-template.md +249 -0
- package/skill/scripts/compare_tokens.py +741 -0
- package/skill/scripts/download_screenshot.py +125 -0
- package/skill/scripts/extract_design_tokens.py +617 -0
- package/skill/scripts/generate_migration.py +580 -0
- package/skill/scripts/generate_radar_chart.py +267 -0
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
# UI Mirror: 7-Axis Analysis Rubric
|
|
2
|
+
|
|
3
|
+
> This rubric defines how to systematically compare a benchmark website's UI against the current project's design system.
|
|
4
|
+
> Each axis includes extraction targets, mapping conventions, scoring criteria, and key comparison questions.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Axis 1: Layout
|
|
9
|
+
|
|
10
|
+
**Description**: Analyze the overall page structure -- grid system, column count, max-width constraints, sidebar/main/aside arrangement, header/footer positioning, and responsive breakpoints.
|
|
11
|
+
|
|
12
|
+
### CSS Properties to Extract
|
|
13
|
+
- `display` (grid | flex | block)
|
|
14
|
+
- `grid-template-columns`, `grid-template-rows`, `grid-template-areas`
|
|
15
|
+
- `max-width`, `min-width`, `width` (container)
|
|
16
|
+
- `position` (sticky | fixed | relative) for header/footer
|
|
17
|
+
- `@media` breakpoint values
|
|
18
|
+
- `gap`, `column-gap`, `row-gap`
|
|
19
|
+
- `flex-direction`, `flex-wrap`, `flex-basis`
|
|
20
|
+
- `overflow`, `min-height`, `height` (viewport units)
|
|
21
|
+
|
|
22
|
+
### Mapping to Tailwind Conventions
|
|
23
|
+
| Benchmark Pattern | Tailwind / shadcn Equivalent |
|
|
24
|
+
|---|---|
|
|
25
|
+
| `max-width: 1280px` | `max-w-7xl` (1280px) |
|
|
26
|
+
| `grid-template-columns: 1fr 3fr` | `grid grid-cols-[1fr_3fr]` or sidebar pattern |
|
|
27
|
+
| `position: sticky; top: 0` | `sticky top-0` |
|
|
28
|
+
| 2-column sidebar+main | `SidebarProvider` + `Sidebar` + `SidebarInset` |
|
|
29
|
+
| `@media (min-width: 768px)` | `md:` prefix |
|
|
30
|
+
| `@media (min-width: 1024px)` | `lg:` prefix |
|
|
31
|
+
| `@media (min-width: 1280px)` | `xl:` prefix |
|
|
32
|
+
| `min-height: 100svh` | `min-h-svh` |
|
|
33
|
+
|
|
34
|
+
### 5-Point Scoring Rubric
|
|
35
|
+
| Score | Description |
|
|
36
|
+
|-------|-------------|
|
|
37
|
+
| 1 | Completely different layout paradigm (e.g., benchmark uses CSS Grid areas vs project's flex column) |
|
|
38
|
+
| 2 | Same general approach but different column ratios, breakpoints, or container widths |
|
|
39
|
+
| 3 | Similar structure; minor differences in gap sizes, max-width, or breakpoint triggers |
|
|
40
|
+
| 4 | Nearly identical; only 1-2 minor property differences (e.g., slightly different sidebar width) |
|
|
41
|
+
| 5 | Identical layout system, breakpoints, and spatial relationships |
|
|
42
|
+
|
|
43
|
+
### Key Comparison Questions
|
|
44
|
+
1. Does the benchmark use a sidebar layout? If so, how does its width compare to the project's `--sidebar-width: 16rem`?
|
|
45
|
+
2. What is the main content max-width? Does it match any Tailwind `max-w-*` value?
|
|
46
|
+
3. Are headers sticky or fixed? What z-index layer?
|
|
47
|
+
4. What breakpoints trigger layout shifts? Do they align with Tailwind's default `sm/md/lg/xl/2xl`?
|
|
48
|
+
5. Is the layout a 1-column, 2-column, or 3-column system? Does it collapse responsively?
|
|
49
|
+
6. Does the benchmark use CSS Grid areas or Flexbox for its primary layout?
|
|
50
|
+
7. Is there an inset/floating sidebar variant like the project's `SidebarInset`?
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Axis 2: Color
|
|
55
|
+
|
|
56
|
+
**Description**: Analyze the complete color palette -- primary, secondary, accent, background, text, muted, destructive, gradients, and opacity values. All extracted colors MUST be converted to OKLCH format for direct comparison with project tokens.
|
|
57
|
+
|
|
58
|
+
### CSS Properties to Extract
|
|
59
|
+
- `color`, `background-color`, `background` (gradients)
|
|
60
|
+
- `border-color`, `outline-color`
|
|
61
|
+
- `box-shadow` color components
|
|
62
|
+
- `opacity`, `rgba()`/`oklch()` alpha channels
|
|
63
|
+
- `--custom-property` color definitions
|
|
64
|
+
- `fill`, `stroke` (SVG elements)
|
|
65
|
+
- `accent-color`, `caret-color`
|
|
66
|
+
|
|
67
|
+
### Mapping to Tailwind Conventions
|
|
68
|
+
| Benchmark Pattern | Tailwind / shadcn Equivalent |
|
|
69
|
+
|---|---|
|
|
70
|
+
| Primary brand color | `--primary: oklch(0.575 0.215 276)` / `bg-primary` |
|
|
71
|
+
| Light background | `--background: oklch(0.97 0.003 276)` / `bg-background` |
|
|
72
|
+
| Card/surface white | `--card: oklch(1 0 0)` / `bg-card` |
|
|
73
|
+
| Muted/secondary bg | `--muted: oklch(0.955 0.005 276)` / `bg-muted` |
|
|
74
|
+
| Faint text | `--muted-foreground: oklch(0.52 0.01 276)` / `text-muted-foreground` |
|
|
75
|
+
| Error/danger red | `--destructive: oklch(0.577 0.245 27.325)` / `bg-destructive` |
|
|
76
|
+
| Border gray | `--border: oklch(0.91 0.005 276)` / `border-border` |
|
|
77
|
+
| Opacity variants | Slash notation: `bg-primary/10`, `shadow-primary/20` |
|
|
78
|
+
| Success state | `bg-emerald-50 text-emerald-700` |
|
|
79
|
+
| Warning state | `bg-amber-50 text-amber-700` |
|
|
80
|
+
| Error state | `bg-red-50 text-red-700` |
|
|
81
|
+
|
|
82
|
+
### Color Conversion Formula
|
|
83
|
+
```
|
|
84
|
+
HEX -> sRGB -> Linear RGB -> OKLCH
|
|
85
|
+
Use: https://oklch.com/ or CSS `oklch()` spec
|
|
86
|
+
Format: oklch(L C H) where L=[0,1], C=[0,0.4], H=[0,360]
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### 5-Point Scoring Rubric
|
|
90
|
+
| Score | Description |
|
|
91
|
+
|-------|-------------|
|
|
92
|
+
| 1 | Entirely different palette (different hue family, different lightness strategy) |
|
|
93
|
+
| 2 | Same general warmth/coolness but different hues; significant lightness/chroma gaps |
|
|
94
|
+
| 3 | Similar palette family; 2-3 tokens need remapping; minor hue/chroma differences |
|
|
95
|
+
| 4 | Very close; 1 token difference (e.g., primary hue shifted 10-20 degrees) |
|
|
96
|
+
| 5 | Identical palette within OKLCH delta-E < 0.02 across all tokens |
|
|
97
|
+
|
|
98
|
+
### Key Comparison Questions
|
|
99
|
+
1. What is the benchmark's primary hue? How far is it from the project's purple hue (276)?
|
|
100
|
+
2. Does the benchmark use a warm or cool neutral palette? typical shadcn/ui uses cool-purple-tinted neutrals.
|
|
101
|
+
3. Are there gradients? many projects avoid gradients in the core system.
|
|
102
|
+
4. How many semantic color roles does the benchmark define? Does it exceed the project's token set?
|
|
103
|
+
5. Does the benchmark use opacity/alpha for layering? At what values vs the project's `/10`, `/20`, `/50`?
|
|
104
|
+
6. Is dark mode present? check if project is light-mode only per design rules.
|
|
105
|
+
7. Are state colors (success/warning/error) from the same family as the project's emerald/amber/red?
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Axis 3: Typography
|
|
110
|
+
|
|
111
|
+
**Description**: Analyze font families, size scale, weight distribution, line-height, letter-spacing, and any special text treatments (uppercase, truncation, monospace usage).
|
|
112
|
+
|
|
113
|
+
### CSS Properties to Extract
|
|
114
|
+
- `font-family` (identify Google Fonts or system fonts)
|
|
115
|
+
- `font-size` (build the complete type scale)
|
|
116
|
+
- `font-weight` (identify which weights are used)
|
|
117
|
+
- `line-height` (per font-size pairing)
|
|
118
|
+
- `letter-spacing`
|
|
119
|
+
- `text-transform` (uppercase, capitalize)
|
|
120
|
+
- `text-overflow`, `overflow`, `white-space` (truncation patterns)
|
|
121
|
+
- `font-feature-settings`, `font-variant-numeric`
|
|
122
|
+
|
|
123
|
+
### Mapping to Tailwind Conventions
|
|
124
|
+
| Benchmark Pattern | Tailwind / shadcn Equivalent |
|
|
125
|
+
|---|---|
|
|
126
|
+
| Sans-serif primary | `font-sans` (Pretendard + Inter) |
|
|
127
|
+
| Monospace code | `font-mono` |
|
|
128
|
+
| 12px | `text-xs` (0.75rem) |
|
|
129
|
+
| 14px | `text-sm` (0.875rem) |
|
|
130
|
+
| 16px | `text-base` (1rem) |
|
|
131
|
+
| 18px | `text-lg` (1.125rem) |
|
|
132
|
+
| 20px | `text-xl` (1.25rem) |
|
|
133
|
+
| 24px | `text-2xl` (1.5rem) |
|
|
134
|
+
| 30px | `text-3xl` (1.875rem) |
|
|
135
|
+
| 36px | `text-4xl` (2.25rem) |
|
|
136
|
+
| weight 400 | `font-normal` |
|
|
137
|
+
| weight 500 | `font-medium` |
|
|
138
|
+
| weight 600 | `font-semibold` |
|
|
139
|
+
| weight 700 | `font-bold` |
|
|
140
|
+
|
|
141
|
+
### 5-Point Scoring Rubric
|
|
142
|
+
| Score | Description |
|
|
143
|
+
|-------|-------------|
|
|
144
|
+
| 1 | Different font family category (serif vs sans-serif), wildly different scale |
|
|
145
|
+
| 2 | Same category but different specific fonts; scale has 3+ mismatches |
|
|
146
|
+
| 3 | Similar fonts (both geometric sans); scale mostly aligns with 1-2 off-steps |
|
|
147
|
+
| 4 | Very similar; same font category, same scale, minor line-height/spacing differences |
|
|
148
|
+
| 5 | Identical font stack, matching size scale, weights, and line-heights |
|
|
149
|
+
|
|
150
|
+
### Key Comparison Questions
|
|
151
|
+
1. What is the primary font family? Is it available on Google Fonts? How does its x-height compare to Pretendard/Inter?
|
|
152
|
+
2. Does the benchmark use the same 4-weight system (400/500/600/700) or more/fewer weights?
|
|
153
|
+
3. What is the body text size? typical shadcn/ui uses `text-sm` (14px) for most body content.
|
|
154
|
+
4. Are there any hardcoded pixel sizes that don't map to Tailwind's scale?
|
|
155
|
+
5. Does the benchmark use `letter-spacing`? default Tailwind rarely adjusts letter-spacing.
|
|
156
|
+
6. Is there a distinct heading scale? How does it map to `text-lg` through `text-4xl`?
|
|
157
|
+
7. Does the benchmark use tabular numbers (`font-variant-numeric: tabular-nums`) for data displays?
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Axis 4: Icons & Graphics
|
|
162
|
+
|
|
163
|
+
**Description**: Identify the icon library, icon sizing conventions, color treatment, illustration/graphic style, and any decorative elements (gradients, patterns, blobs).
|
|
164
|
+
|
|
165
|
+
### CSS Properties to Extract
|
|
166
|
+
- `width`, `height` on SVG/icon elements
|
|
167
|
+
- `stroke-width`
|
|
168
|
+
- `color`/`fill`/`stroke` on icons
|
|
169
|
+
- `viewBox` dimensions (to identify icon set)
|
|
170
|
+
- Background decorative patterns/images
|
|
171
|
+
|
|
172
|
+
### Mapping to Tailwind Conventions
|
|
173
|
+
| Benchmark Pattern | Tailwind / shadcn Equivalent |
|
|
174
|
+
|---|---|
|
|
175
|
+
| 16x16 icons | `size-4` (Lucide default) |
|
|
176
|
+
| 20x20 icons | `size-5` |
|
|
177
|
+
| 24x24 icons | `size-6` |
|
|
178
|
+
| Icon color inherits text | `className="size-4"` (inherits `currentColor`) |
|
|
179
|
+
| Icon + text gap | `gap-2` (8px) in flex container |
|
|
180
|
+
| Lucide icons | `lucide-react` (the project's icon library - CP3) |
|
|
181
|
+
|
|
182
|
+
### Icon Library Identification
|
|
183
|
+
| Library | Identifiers |
|
|
184
|
+
|---------|-------------|
|
|
185
|
+
| **Lucide** | `viewBox="0 0 24 24"`, stroke-based, `stroke-width="2"`, `stroke-linecap="round"` |
|
|
186
|
+
| **Heroicons** | `viewBox="0 0 24 24"` (outline) or `viewBox="0 0 20 20"` (solid), Tailwind ecosystem |
|
|
187
|
+
| **Font Awesome** | `viewBox="0 0 512 512"` or similar large viewBox, filled style |
|
|
188
|
+
| **Phosphor** | `viewBox="0 0 256 256"`, multiple weights (thin/light/regular/bold/fill/duotone) |
|
|
189
|
+
| **Material Icons** | `viewBox="0 0 24 24"`, filled or outlined variants, Google design |
|
|
190
|
+
| **Custom/SVG sprites** | Non-standard viewBox, inline SVG without library wrapper |
|
|
191
|
+
|
|
192
|
+
### 5-Point Scoring Rubric
|
|
193
|
+
| Score | Description |
|
|
194
|
+
|-------|-------------|
|
|
195
|
+
| 1 | Different icon library category (filled vs stroke), different default size, no overlap |
|
|
196
|
+
| 2 | Different library but similar style; sizes mostly align |
|
|
197
|
+
| 3 | Same style family (stroke-based); some icons have equivalents, some need custom SVG |
|
|
198
|
+
| 4 | Same or compatible library; minor size/stroke-width differences |
|
|
199
|
+
| 5 | Identical icon library and conventions |
|
|
200
|
+
|
|
201
|
+
### Key Comparison Questions
|
|
202
|
+
1. What icon library does the benchmark use? Is it Lucide (the project's library)?
|
|
203
|
+
2. What is the default icon size? typical shadcn/ui uses `size-4` (16px) per CP3.
|
|
204
|
+
3. Are icons stroke-based or filled? typical shadcn/ui uses Lucide's stroke style.
|
|
205
|
+
4. Does the benchmark use icon-only buttons? the project may have `size="icon"` variant.
|
|
206
|
+
5. Are there decorative illustrations or graphics beyond icons? What style?
|
|
207
|
+
6. Does the benchmark use emoji as pseudo-icons?
|
|
208
|
+
7. Is there an icon color system independent of text color?
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## Axis 5: Spacing
|
|
213
|
+
|
|
214
|
+
**Description**: Analyze padding, margin, and gap patterns across all page sections, cards, buttons, and inline elements. Map all values to Tailwind's 4px-based spacing scale.
|
|
215
|
+
|
|
216
|
+
### CSS Properties to Extract
|
|
217
|
+
- `padding`, `padding-top/right/bottom/left`
|
|
218
|
+
- `margin`, `margin-top/right/bottom/left`
|
|
219
|
+
- `gap`, `row-gap`, `column-gap`
|
|
220
|
+
- `inset`, `top/right/bottom/left` (for positioned elements)
|
|
221
|
+
|
|
222
|
+
### Mapping to Tailwind Conventions
|
|
223
|
+
| Benchmark Pattern | Tailwind / shadcn Equivalent | Rule |
|
|
224
|
+
|---|---|---|
|
|
225
|
+
| 4px | `gap-1`, `p-1` | S1 |
|
|
226
|
+
| 8px | `gap-2`, `p-2` | S1 |
|
|
227
|
+
| 12px | `gap-3`, `p-3` | S1 |
|
|
228
|
+
| 16px | `gap-4`, `p-4` | S1, S2 (card padding) |
|
|
229
|
+
| 24px | `gap-6`, `p-6` | S2 (page padding) |
|
|
230
|
+
| Page-level padding | `p-6` (24px) | S2 |
|
|
231
|
+
| Card header padding | `px-4 pt-4` | S2 |
|
|
232
|
+
| Card content padding | `px-4 pb-4` | S2 |
|
|
233
|
+
| Section gap (between cards) | `gap-4` (16px) | S3 |
|
|
234
|
+
| Internal element gap | `gap-2` (8px) | S3 |
|
|
235
|
+
| Card internal gap | `gap-2` (8px) | Card component |
|
|
236
|
+
|
|
237
|
+
### Spacing Scale Reference (Tailwind 4px base)
|
|
238
|
+
```
|
|
239
|
+
0 = 0px 0.5 = 2px 1 = 4px 1.5 = 6px
|
|
240
|
+
2 = 8px 2.5 = 10px 3 = 12px 3.5 = 14px
|
|
241
|
+
4 = 16px 5 = 20px 6 = 24px 7 = 28px
|
|
242
|
+
8 = 32px 9 = 36px 10 = 40px 11 = 44px
|
|
243
|
+
12 = 48px 14 = 56px 16 = 64px 20 = 80px
|
|
244
|
+
24 = 96px 28 = 112px 32 = 128px 36 = 144px
|
|
245
|
+
40 = 160px 44 = 176px 48 = 192px 52 = 208px
|
|
246
|
+
56 = 224px 60 = 240px 64 = 256px 72 = 288px
|
|
247
|
+
80 = 320px 96 = 384px
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### 5-Point Scoring Rubric
|
|
251
|
+
| Score | Description |
|
|
252
|
+
|-------|-------------|
|
|
253
|
+
| 1 | Completely different spacing philosophy (e.g., 5px base, irregular increments) |
|
|
254
|
+
| 2 | Some 4px-aligned values but many off-grid spacings (7px, 13px, 18px) |
|
|
255
|
+
| 3 | Mostly 4px-aligned; a few off-grid values that need rounding |
|
|
256
|
+
| 4 | All values map to Tailwind scale; minor differences in which specific steps are used |
|
|
257
|
+
| 5 | Identical spacing patterns (same page padding, card padding, gap hierarchy) |
|
|
258
|
+
|
|
259
|
+
### Key Comparison Questions
|
|
260
|
+
1. Does the benchmark use a 4px or 8px base grid? typical shadcn/ui uses 4px (Tailwind default).
|
|
261
|
+
2. What is the page-level padding? typical shadcn/ui uses `p-6` (24px) per S2.
|
|
262
|
+
3. What is the card internal padding? typical shadcn/ui uses `px-4 pt-4` / `px-4 pb-4` per S2.
|
|
263
|
+
4. Is the section-to-section gap consistent? typical shadcn/ui uses `gap-4` per S3.
|
|
264
|
+
5. Are there any arbitrary pixel values that don't fall on the 4px grid?
|
|
265
|
+
6. Does the benchmark have tighter or looser spacing than the current project overall?
|
|
266
|
+
7. What is the gap between icon and text label? typical shadcn/ui uses `gap-2` (8px).
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## Axis 6: Components
|
|
271
|
+
|
|
272
|
+
**Description**: Compare the styling of major UI components -- Card, Button, Input, Navigation, Table, Modal/Dialog, and Badge. Focus on structural CSS differences, not behavioral logic.
|
|
273
|
+
|
|
274
|
+
### CSS Properties to Extract (per component)
|
|
275
|
+
|
|
276
|
+
**Card**: `border-radius`, `border`, `box-shadow`, `background`, `padding`
|
|
277
|
+
**Button**: `border-radius`, `height`, `padding`, `font-size`, `font-weight`, `box-shadow`, `background`, hover/active/disabled states
|
|
278
|
+
**Input**: `border-radius`, `height`, `border`, `box-shadow`, `padding`, `font-size`, focus states
|
|
279
|
+
**Navigation/Nav**: `background`, `width`, `height`, active/hover item styles
|
|
280
|
+
**Table**: `border`, `padding`, header background, row hover, stripe pattern
|
|
281
|
+
**Modal/Dialog**: `border-radius`, `box-shadow`, overlay color, `max-width`, `padding`
|
|
282
|
+
**Badge**: `border-radius`, `padding`, `font-size`, `font-weight`, `background`
|
|
283
|
+
|
|
284
|
+
### Mapping to Tailwind Conventions
|
|
285
|
+
| Component | shadcn/ui Reference | Key Classes |
|
|
286
|
+
|---|---|---|
|
|
287
|
+
| Card | `<Card>` (shadcn) | `bg-card border rounded-lg shadow-sm` |
|
|
288
|
+
| Button (default) | `<Button>` CVA | `bg-primary text-primary-foreground shadow-md shadow-primary/20 rounded-md h-9 px-4` |
|
|
289
|
+
| Button (outline) | `<Button variant="outline">` | `border bg-background shadow-xs rounded-md` |
|
|
290
|
+
| Button (ghost) | `<Button variant="ghost">` | `hover:bg-accent hover:text-accent-foreground rounded-md` |
|
|
291
|
+
| Input | `<Input>` | `border-input rounded-md shadow-sm h-9 px-3 text-sm` |
|
|
292
|
+
| Dialog | `<DialogContent>` | `bg-background rounded-lg border shadow-lg p-6 max-w-lg` |
|
|
293
|
+
| Badge (default) | `<Badge>` CVA | `bg-primary text-primary-foreground rounded-full px-2 py-0.5 text-xs` |
|
|
294
|
+
| Badge (outline) | `<Badge variant="outline">` | `border-border text-foreground rounded-full` |
|
|
295
|
+
| Table | `<Table>` | `w-full text-sm`, row: `hover:bg-muted/50 border-b`, head: `h-10 px-2 font-medium` |
|
|
296
|
+
| Sidebar | `<Sidebar>` | `bg-sidebar w-[16rem]`, item: `rounded-md p-2 text-sm` |
|
|
297
|
+
|
|
298
|
+
### 5-Point Scoring Rubric
|
|
299
|
+
| Score | Description |
|
|
300
|
+
|-------|-------------|
|
|
301
|
+
| 1 | Fundamentally different component design language (e.g., Material vs shadcn) |
|
|
302
|
+
| 2 | Same general concept but different radius, shadow, padding, and color application |
|
|
303
|
+
| 3 | Similar feel; 3-4 property overrides needed per component |
|
|
304
|
+
| 4 | Very close; 1-2 CSS property tweaks bring them into alignment |
|
|
305
|
+
| 5 | Identical component styling |
|
|
306
|
+
|
|
307
|
+
### Key Comparison Questions
|
|
308
|
+
1. Does the benchmark use `rounded-lg` for cards and `rounded-md` for buttons/inputs like the current project?
|
|
309
|
+
2. What shadow depth does the benchmark use for cards? typical shadcn/ui uses `shadow-sm` (SH2).
|
|
310
|
+
3. Are buttons the same height (`h-9`)? Same padding (`px-4`)?
|
|
311
|
+
4. Does the benchmark's dialog use `shadow-lg` like the current project?
|
|
312
|
+
5. Are badges `rounded-full` or `rounded-md`? typical shadcn/ui uses `rounded-full`.
|
|
313
|
+
6. Does the table have row hover states? What color?
|
|
314
|
+
7. Are there component variants (default/outline/ghost/destructive) similar to the project's CVA pattern?
|
|
315
|
+
8. Does the benchmark separate `CardHeader`/`CardContent` or use a flat div structure?
|
|
316
|
+
|
|
317
|
+
---
|
|
318
|
+
|
|
319
|
+
## Axis 7: Interaction
|
|
320
|
+
|
|
321
|
+
**Description**: Analyze hover states, focus indicators, transitions, animations, micro-interactions, and motion design. the project may have strict animation rules (tw-animate-css only, no framer-motion).
|
|
322
|
+
|
|
323
|
+
### CSS Properties to Extract
|
|
324
|
+
- `transition`, `transition-property`, `transition-duration`, `transition-timing-function`
|
|
325
|
+
- `animation`, `animation-name`, `animation-duration`, `@keyframes`
|
|
326
|
+
- `:hover` state changes (color, background, shadow, transform)
|
|
327
|
+
- `:focus-visible` ring/outline styles
|
|
328
|
+
- `:active` state changes
|
|
329
|
+
- `transform` (scale, translate, rotate on interaction)
|
|
330
|
+
- `cursor` values
|
|
331
|
+
- `will-change`, `backface-visibility` (performance hints)
|
|
332
|
+
|
|
333
|
+
### Mapping to Tailwind Conventions
|
|
334
|
+
| Benchmark Pattern | Tailwind / shadcn Equivalent | Rule |
|
|
335
|
+
|---|---|---|
|
|
336
|
+
| `transition: all 200ms` | `transition-all duration-200` | A2 |
|
|
337
|
+
| `transform: scale(0.98)` on active | Not common in shadcn/ui | -- |
|
|
338
|
+
| Focus ring | `focus-visible:ring-ring/50 focus-visible:ring-[3px]` | AC1 |
|
|
339
|
+
| Hover bg change | `hover:bg-accent hover:text-accent-foreground` | -- |
|
|
340
|
+
| Button hover | `hover:bg-primary/90` (default variant) | -- |
|
|
341
|
+
| Enter/exit animations | `animate-in`/`animate-out` (tw-animate-css) | A1 |
|
|
342
|
+
| Fade in | `animate-fade-in` or `data-[state=open]:fade-in-0` | A1 |
|
|
343
|
+
| No framer-motion | `tw-animate-css` classes only | A1 |
|
|
344
|
+
| Dialog enter | `zoom-in-95 fade-in-0` | Dialog component |
|
|
345
|
+
| Reduced motion | `@media (prefers-reduced-motion: reduce)` | -- |
|
|
346
|
+
|
|
347
|
+
### 5-Point Scoring Rubric
|
|
348
|
+
| Score | Description |
|
|
349
|
+
|-------|-------------|
|
|
350
|
+
| 1 | Heavy animation library (GSAP/framer-motion), complex choreographed transitions |
|
|
351
|
+
| 2 | Uses CSS animations but with different timing, easing, or interaction patterns |
|
|
352
|
+
| 3 | Similar approach (CSS transitions); minor timing/easing differences |
|
|
353
|
+
| 4 | Nearly identical; same transition properties, similar durations |
|
|
354
|
+
| 5 | Identical interaction patterns and animation library |
|
|
355
|
+
|
|
356
|
+
### Key Comparison Questions
|
|
357
|
+
1. Does the benchmark use a CSS animation library or framer-motion? check project design rules for animation constraints.
|
|
358
|
+
2. What is the standard transition duration? typical shadcn/ui uses `duration-200` as default.
|
|
359
|
+
3. How are focus indicators styled? typical shadcn/ui uses `ring-ring/50 ring-[3px]` (AC1).
|
|
360
|
+
4. Are there hover shadows or transforms? typical shadcn/ui uses `hover:bg-primary/90` for buttons.
|
|
361
|
+
5. Does the benchmark have page transition animations?
|
|
362
|
+
6. Are there scroll-triggered animations? check if project uses scroll-based animations.
|
|
363
|
+
7. Does the benchmark respect `prefers-reduced-motion`?
|
|
364
|
+
8. What micro-interactions exist (tooltip delays, dropdown easing, skeleton shimmer)?
|
|
365
|
+
|
|
366
|
+
---
|
|
367
|
+
|
|
368
|
+
## Aggregate Scoring
|
|
369
|
+
|
|
370
|
+
After scoring all 7 axes, compute the aggregate:
|
|
371
|
+
|
|
372
|
+
```
|
|
373
|
+
Overall Similarity = (Layout + Color + Typography + Icons + Spacing + Components + Interaction) / 7
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
| Range | Interpretation | Migration Effort |
|
|
377
|
+
|-------|---------------|-----------------|
|
|
378
|
+
| 1.0 - 1.9 | Fundamentally different design system | Full redesign required |
|
|
379
|
+
| 2.0 - 2.9 | Different but some structural overlap | Major token remapping + component overhaul |
|
|
380
|
+
| 3.0 - 3.9 | Moderately similar, clear migration path | Token adjustments + targeted component overrides |
|
|
381
|
+
| 4.0 - 4.9 | Very similar, minimal gaps | Minor CSS variable tweaks |
|
|
382
|
+
| 5.0 | Identical | No migration needed |
|