Skip to content

Commit bb58ef3

Browse files
waleedlatif1claude
andcommitted
chore(styling): canonicalize size-* shorthand for equal height/width
Document the size-* shorthand as the canonical pattern across CLAUDE.md, AGENTS.md, .claude rules, .cursor + .agents commands, and the emcn design-review skill. Default icon size is size-[14px]. Treat h-[Npx] w-[Npx] and h-N w-N pairs as refactor targets. Also migrate the remaining occurrences in recently-deleted.tsx. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 92cca40 commit bb58ef3

8 files changed

Lines changed: 33 additions & 16 deletions

File tree

.agents/skills/emcn-design-review/SKILL.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ Use for context menus and action menus:
234234
<DropdownMenu>
235235
<DropdownMenuTrigger asChild>
236236
<Button variant="ghost">
237-
<MoreHorizontal className="h-[14px] w-[14px]" />
237+
<MoreHorizontal className="size-[14px]" />
238238
</Button>
239239
</DropdownMenuTrigger>
240240
<DropdownMenuContent align="end">
@@ -281,19 +281,21 @@ Rules:
281281
- Stack multiple skeletons for lists
282282

283283
### Icons
284-
Standard sizing — `h-[14px] w-[14px]` is the dominant pattern (400+ uses):
284+
Standard sizing — use the `size-*` shorthand. `size-[14px]` is the dominant pattern:
285285

286286
```tsx
287-
<Icon className="h-[14px] w-[14px] text-[var(--text-icon)]" />
287+
<Icon className="size-[14px] text-[var(--text-icon)]" />
288288
```
289289

290-
Size scale by frequency:
291-
1. `h-[14px] w-[14px]` — default for inline icons (most common)
292-
2. `h-[16px] w-[16px]` — slightly larger inline icons
293-
3. `h-3 w-3` (12px) — compact/tight spaces
294-
4. `h-4 w-4` (16px) — Tailwind equivalent, also common
295-
5. `h-3.5 w-3.5` (14px) — Tailwind equivalent of 14px
296-
6. `h-5 w-5` (20px) — larger icons, section headers
290+
Always prefer `size-*` over the legacy `h-* w-*` pair. `size-[14px]` is canonical; treat any `h-[Npx] w-[Npx]` or `h-N w-N` pair as a refactor target.
291+
292+
Size scale (most common first):
293+
1. `size-[14px]` — default for inline icons
294+
2. `size-[16px]` — slightly larger inline icons
295+
3. `size-3` (12px) — compact/tight spaces
296+
4. `size-4` (16px) — Tailwind equivalent
297+
5. `size-3.5` (14px) — Tailwind equivalent of 14px
298+
6. `size-5` (20px) — larger icons, section headers
297299

298300
Use `text-[var(--text-icon)]` for icon color (113+ uses in codebase).
299301

@@ -332,4 +334,5 @@ Use `text-[var(--text-icon)]` for icon color (113+ uses in codebase).
332334
- Importing from emcn subpaths instead of barrel export
333335
- Using arbitrary z-index (`z-50`, `z-[9999]`) instead of z-index tokens
334336
- Custom shadows instead of shadow tokens
335-
- Icon sizes that don't follow the established scale (default to `h-[14px] w-[14px]`)
337+
- Icon sizes that don't follow the established scale (default to `size-[14px]`)
338+
- Splitting equal height/width into `h-* w-*` pairs instead of the `size-*` shorthand

.claude/commands/emcn-design-review.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Modal `size="sm"`, title "Delete/Remove {ItemType}", `variant="destructive"` act
6565

6666
## Icons
6767

68-
Default: `h-[14px] w-[14px]` (400+ uses). Color: `text-[var(--text-icon)]`. Scale: 14px > 16px > 12px > 20px.
68+
Default: `size-[14px]`. Color: `text-[var(--text-icon)]`. Scale: 14px > 16px > 12px > 20px. Use the `size-*` shorthand — flag `h-[Npx] w-[Npx]` and `h-N w-N` pairs as refactor targets.
6969

7070
## Anti-patterns to flag
7171

.claude/rules/emcn-components.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@ function Label({ className, ...props }) {
3232
- Export component and variants (if using CVA)
3333
- TSDoc with usage examples
3434
- Consistent tokens: `font-medium`, `text-[12px]`, `rounded-[4px]`
35+
- Equal height/width → `size-*` (e.g. `size-[14px]`, `size-4`), never `h-[Npx] w-[Npx]` or `h-N w-N`. Default icon size is `size-[14px]`
3536
- `transition-colors` for hover states

.claude/rules/sim-styling.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ paths:
1111
1. **No inline styles** - Use Tailwind classes
1212
2. **No duplicate dark classes** - Skip `dark:` when value matches light mode
1313
3. **Exact values** - `text-[14px]`, `h-[26px]`
14-
4. **Transitions** - `transition-colors` for interactive states
14+
4. **Equal h/w → `size-*`** - Use `size-[14px]` / `size-4`, never `h-[14px] w-[14px]` or `h-4 w-4`. Default icon size is `size-[14px]`
15+
5. **Transitions** - `transition-colors` for interactive states
1516

1617
## Conditional Classes
1718

.cursor/commands/emcn-design-review.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Modal `size="sm"`, title "Delete/Remove {ItemType}", `variant="destructive"` act
6060

6161
## Icons
6262

63-
Default: `h-[14px] w-[14px]` (400+ uses). Color: `text-[var(--text-icon)]`. Scale: 14px > 16px > 12px > 20px.
63+
Default: `size-[14px]`. Color: `text-[var(--text-icon)]`. Scale: 14px > 16px > 12px > 20px. Use the `size-*` shorthand — flag `h-[Npx] w-[Npx]` and `h-N w-N` pairs as refactor targets.
6464

6565
## Anti-patterns to flag
6666

AGENTS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,12 @@ Use Tailwind only, no inline styles. Use `cn()` from `@/lib/utils` for condition
357357
<div className={cn('base-classes', isActive && 'active-classes')} />
358358
```
359359

360+
For equal height and width, use the `size-*` shorthand — never `h-[Npx] w-[Npx]` or `h-N w-N`. Default icon size is `size-[14px]`.
361+
362+
```typescript
363+
<Icon className='size-[14px] text-[var(--text-icon)]' />
364+
```
365+
360366
## EMCN Components
361367

362368
Import from `@/components/emcn`, never from subpaths (except CSS files). Use CVA when 2+ variants exist.

CLAUDE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,12 @@ Use Tailwind only, no inline styles. Use `cn()` from `@/lib/utils` for condition
347347
<div className={cn('base-classes', isActive && 'active-classes')} />
348348
```
349349

350+
For equal height and width, use the `size-*` shorthand — never `h-[Npx] w-[Npx]` or `h-N w-N`. Default icon size is `size-[14px]`.
351+
352+
```typescript
353+
<Icon className='size-[14px] text-[var(--text-icon)]' />
354+
```
355+
350356
## EMCN Components
351357

352358
Import from `@/components/emcn`, never from subpaths (except CSS files). Use CVA when 2+ variants exist.

apps/sim/app/workspace/[workspaceId]/settings/components/recently-deleted/recently-deleted.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const SORT_OPTIONS: { column: SortColumn; direction: 'asc' | 'desc'; label: stri
6262
{ column: 'type', direction: 'asc', label: 'Type (A–Z)' },
6363
]
6464

65-
const ICON_CLASS = 'h-[14px] w-[14px]'
65+
const ICON_CLASS = 'size-[14px]'
6666

6767
const RESOURCE_TYPE_TO_MOTHERSHIP: Partial<
6868
Record<Exclude<ResourceType, 'all'>, MothershipResourceType>
@@ -331,7 +331,7 @@ export function RecentlyDeleted() {
331331
<div className='flex items-center gap-2'>
332332
<div className='flex flex-1 items-center gap-2 rounded-lg border border-[var(--border)] bg-transparent px-2 py-[5px] transition-colors duration-100 dark:bg-[var(--surface-4)] dark:hover-hover:border-[var(--border-1)] dark:hover-hover:bg-[var(--surface-5)]'>
333333
<Search
334-
className='h-[14px] w-[14px] flex-shrink-0 text-[var(--text-tertiary)]'
334+
className='size-[14px] flex-shrink-0 text-[var(--text-tertiary)]'
335335
strokeWidth={2}
336336
/>
337337
<Input

0 commit comments

Comments
 (0)