Skip to content

Commit cb260b9

Browse files
paulpopusJessRynkarPatrikKozakJarrodMFlesch
authored
feat: v4 UI redesign (#16331)
- [ ] array ([PR](#16370)) - [ ] blocks ([PR](#16384)) - [ ] checkbox - [ ] code - [x] collapsible ([PR](#16365)) - [ ] date - [ ] email - [ ] group - [ ] join - [ ] json - [ ] number ([PR](#16419)) - [x] point ([PR](#16406))) - [ ] radio ([PR](#16411)) - [ ] relationship - [ ] richText - [ ] row - [ ] select - [ ] tabs - [ ] text - [ ] textarea - [ ] upload ([PR](#16422)) --------- Co-authored-by: Jessica Rynkar <jrynkar@figma.com> Co-authored-by: Jessica Rynkar <67977755+JessRynkar@users.noreply.github.com> Co-authored-by: Patrik Kozak <35232443+PatrikKozak@users.noreply.github.com> Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com> Co-authored-by: Jarrod Flesch <30633324+JarrodMFlesch@users.noreply.github.com>
1 parent 15b18cc commit cb260b9

276 files changed

Lines changed: 8322 additions & 3868 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/skills/ui4-review/SKILL.md

Lines changed: 231 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,231 @@
1+
---
2+
name: ui4-review
3+
description: Review UI4 CSS migrations for proper token usage. Checks that CSS variables are used instead of hardcoded values.
4+
---
5+
6+
# UI4 Review
7+
8+
Reviews CSS changes and **auto-fixes** token violations.
9+
10+
---
11+
12+
## Process
13+
14+
### Step 1: Get Changed CSS Files
15+
16+
```bash
17+
git status --porcelain | grep '\.css$'
18+
```
19+
20+
### Step 2: Review & Auto-Fix Each File
21+
22+
For each changed CSS file:
23+
24+
1. Read the file
25+
2. Identify violations
26+
3. **Apply fixes immediately** using replace_string_in_file
27+
4. Report what was fixed
28+
29+
---
30+
31+
## Violations to Flag
32+
33+
### Spacing (CRITICAL)
34+
35+
**Bad:**
36+
37+
```css
38+
padding: 8px;
39+
padding: 0.5rem;
40+
gap: 16px;
41+
margin: 1rem;
42+
```
43+
44+
**Good:**
45+
46+
```css
47+
padding: var(--spacer-2);
48+
gap: var(--spacer-3);
49+
margin: var(--spacer-3);
50+
```
51+
52+
**Token reference:**
53+
| Value | Token |
54+
|-------|-------|
55+
| 0 | `--spacer-0` |
56+
| 4px / 0.25rem | `--spacer-1` |
57+
| 8px / 0.5rem | `--spacer-2` |
58+
| 12px / 0.75rem | `--spacer-2-5` |
59+
| 16px / 1rem | `--spacer-3` |
60+
| 24px / 1.5rem | `--spacer-4` |
61+
| 32px / 2rem | `--spacer-5` |
62+
| 40px / 2.5rem | `--spacer-6` |
63+
64+
**Exceptions:**
65+
66+
- `1px` borders are OK
67+
- `0` is OK (no token needed)
68+
- Percentage values are OK
69+
- `100%`, `auto`, `inherit` are OK
70+
71+
---
72+
73+
### Colors (CRITICAL)
74+
75+
**Bad:**
76+
77+
```css
78+
background: #f5f5f5;
79+
color: rgba(0, 0, 0, 0.9);
80+
border-color: #e6e6e6;
81+
```
82+
83+
**Good:**
84+
85+
```css
86+
background: var(--bg-default-secondary);
87+
color: var(--text-default-default);
88+
border-color: var(--border-default-default);
89+
```
90+
91+
**Token prefixes:**
92+
93+
- Background: `--bg-*`
94+
- Text: `--text-*`
95+
- Border: `--border-*`
96+
- Icon: `--icon-*`
97+
98+
**Prefer canonical shorthands** (defined in colors.css under "Canonical Shorthands"):
99+
100+
| Full Token | Preferred Shorthand |
101+
| --------------------------- | ------------------- |
102+
| `--icon-default-default` | `--icon-default` |
103+
| `--icon-default-secondary` | `--icon-secondary` |
104+
| `--icon-default-tertiary` | `--icon-tertiary` |
105+
| `--text-default-default` | `--text-default` |
106+
| `--text-default-secondary` | `--text-secondary` |
107+
| `--text-default-tertiary` | `--text-tertiary` |
108+
| `--bg-default-default` | `--bg-default` |
109+
| `--bg-default-secondary` | `--bg-secondary` |
110+
| `--bg-default-hover` | `--bg-hover` |
111+
| `--bg-selected-default` | `--bg-selected` |
112+
| `--border-default-default` | `--border-default` |
113+
| `--border-default-strong` | `--border-strong` |
114+
| `--border-selected-default` | `--border-selected` |
115+
116+
**Always use the shorthand when available.** Check colors.css for the full list.
117+
118+
---
119+
120+
### Border Radius (CRITICAL)
121+
122+
**Bad:**
123+
124+
```css
125+
border-radius: 4px;
126+
border-radius: 5px;
127+
border-radius: 0.3125rem;
128+
```
129+
130+
**Good:**
131+
132+
```css
133+
border-radius: var(--radius-medium);
134+
border-radius: var(--radius-small);
135+
border-radius: var(--radius-full);
136+
```
137+
138+
**Token reference:**
139+
| Value | Token |
140+
|-------|-------|
141+
| 0 | `--radius-none` |
142+
| 2px / 0.125rem | `--radius-small` |
143+
| 5px / 0.3125rem | `--radius-medium` |
144+
| 13px / 0.8125rem | `--radius-large` |
145+
| 9999px | `--radius-full` |
146+
147+
---
148+
149+
### Typography (MODERATE)
150+
151+
**Bad:**
152+
153+
```css
154+
font-size: 11px;
155+
line-height: 16px;
156+
font-weight: 550;
157+
```
158+
159+
**Good:**
160+
161+
```css
162+
font-size: var(--text-body-medium-font-size);
163+
line-height: var(--text-body-medium-line-height);
164+
font-weight: var(--text-body-medium-font-weight);
165+
```
166+
167+
---
168+
169+
### Old Theme Variables (CRITICAL)
170+
171+
Flag any usage of legacy variables:
172+
173+
**Bad:**
174+
175+
```css
176+
var(--theme-elevation-0)
177+
var(--theme-elevation-50)
178+
var(--theme-elevation-100)
179+
var(--theme-error-100)
180+
var(--theme-text)
181+
var(--style-radius-m)
182+
```
183+
184+
These must be replaced with new tokens.
185+
186+
---
187+
188+
## Behavior: AUTO-FIX
189+
190+
**Do NOT just report violations. FIX THEM.**
191+
192+
For each violation:
193+
194+
1. Identify the exact line and value
195+
2. Determine the correct token replacement
196+
3. Use `replace_string_in_file` to fix it immediately
197+
4. Report what was fixed
198+
199+
**Only flag (don't fix) when:**
200+
201+
- No matching token exists (e.g., 18px badge size)
202+
- Value is intentional (e.g., `1px` border, `0`)
203+
- Ambiguous replacement
204+
205+
---
206+
207+
## Output Format
208+
209+
After auto-fixing, report:
210+
211+
```
212+
## Auto-Fixed
213+
214+
✅ Collapsible/index.css:9 — `height: 2rem` → `height: var(--spacer-5)`
215+
✅ Collapsible/index.css:120 — `width: 2rem` → `width: var(--spacer-5)`
216+
217+
## Flagged (Manual Review)
218+
219+
⚠️ ErrorPill/index.css:15 — `height: 1.125rem` (18px) — no matching token
220+
```
221+
222+
---
223+
224+
## Summary
225+
226+
After all fixes, provide a simple summary:
227+
228+
| File | Fixed | Flagged |
229+
| --------------------- | ----- | ------- |
230+
| Collapsible/index.css | 2 | 1 |
231+
| ErrorPill/index.css | 0 | 2 |

0 commit comments

Comments
 (0)