@tamsensedev/runner 0.10.0 → 0.18.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/LICENSE +5 -5
- package/README.md +61 -50
- package/dist/cli.js +1188 -324
- package/dist/cli.js.map +1 -1
- package/dist/recorder.cjs +42 -6
- package/dist/recorder.cjs.map +1 -1
- package/library/.claude-plugin/plugin.json +5 -5
- package/library/THIRD_PARTY_NOTICES.md +123 -123
- package/library/agents/code-architect.md +67 -67
- package/library/agents/code-explorer.md +61 -61
- package/library/agents/code-reviewer.md +73 -73
- package/library/agents/code-simplifier.md +62 -62
- package/library/agents/design-critic.md +52 -52
- package/library/agents/second-opinion.md +64 -64
- package/library/agents/security-auditor.md +86 -86
- package/library/agents/silent-failure-hunter.md +70 -70
- package/library/agents/test-coverage-analyzer.md +78 -78
- package/library/agents/test-runner.md +48 -48
- package/library/agents/ui-tester.md +50 -50
- package/library/licenses/Apache-2.0.txt +202 -202
- package/library/skills/accessibility/SKILL.md +144 -144
- package/library/skills/accessibility/references/wcag-checks.md +168 -168
- package/library/skills/addressing-review-feedback/SKILL.md +109 -109
- package/library/skills/app-screens/SKILL.md +96 -96
- package/library/skills/app-screens/references/shell-kpis-charts.md +108 -108
- package/library/skills/app-screens/references/states-density-phone.md +54 -54
- package/library/skills/app-screens/references/tables-forms-settings.md +104 -104
- package/library/skills/avoiding-generic-ai-design/SKILL.md +92 -92
- package/library/skills/avoiding-generic-ai-design/references/tells.md +112 -112
- package/library/skills/clean-commits/SKILL.md +85 -85
- package/library/skills/design-review/SKILL.md +107 -107
- package/library/skills/design-review/references/critique-passes.md +101 -101
- package/library/skills/design-review/references/screenshot-procedure.md +121 -121
- package/library/skills/differential-security-review/LICENSE +427 -427
- package/library/skills/differential-security-review/SKILL.md +105 -105
- package/library/skills/differential-security-review/references/adversarial.md +115 -115
- package/library/skills/differential-security-review/references/methodology.md +145 -145
- package/library/skills/differential-security-review/references/patterns.md +108 -108
- package/library/skills/false-positive-check/LICENSE +427 -427
- package/library/skills/false-positive-check/SKILL.md +95 -95
- package/library/skills/false-positive-check/references/bug-class-verification.md +128 -128
- package/library/skills/false-positive-check/references/deep-verification.md +113 -113
- package/library/skills/false-positive-check/references/evidence-templates.md +93 -93
- package/library/skills/false-positive-check/references/false-positive-patterns.md +122 -122
- package/library/skills/false-positive-check/references/gate-reviews.md +36 -36
- package/library/skills/false-positive-check/references/standard-verification.md +80 -80
- package/library/skills/focused-implementation/SKILL.md +104 -104
- package/library/skills/implementation-plan/SKILL.md +66 -66
- package/library/skills/interface-design/SKILL.md +144 -144
- package/library/skills/interface-design/references/craft-defaults.md +130 -130
- package/library/skills/interface-design/references/new-direction.md +62 -62
- package/library/skills/interface-design/references/writing.md +52 -52
- package/library/skills/interface-polish/SKILL.md +103 -103
- package/library/skills/interface-polish/references/detail-rules.md +154 -154
- package/library/skills/interface-polish/references/worst-case-data.md +158 -158
- package/library/skills/motion-design/SKILL.md +106 -106
- package/library/skills/motion-design/references/recipes.md +243 -243
- package/library/skills/postgres-performance/SKILL.md +97 -97
- package/library/skills/postgres-performance/references/rules.md +265 -265
- package/library/skills/project-orientation/SKILL.md +77 -77
- package/library/skills/reviewing-changes/SKILL.md +183 -183
- package/library/skills/safe-database-changes/SKILL.md +111 -111
- package/library/skills/safe-database-changes/references/backfills.md +75 -75
- package/library/skills/safe-database-changes/references/migration-tools.md +69 -69
- package/library/skills/safe-database-changes/references/postgres-ddl.md +199 -199
- package/library/skills/security-review/SKILL.md +132 -132
- package/library/skills/security-review/references/checks-by-area.md +107 -107
- package/library/skills/security-review/references/do-not-report.md +86 -86
- package/library/skills/spec-writing/SKILL.md +144 -144
- package/library/skills/systematic-debugging/SKILL.md +130 -130
- package/library/skills/systematic-debugging/references/flaky-tests.md +51 -51
- package/library/skills/systematic-debugging/references/root-cause-tracing.md +55 -55
- package/library/skills/task-interview/SKILL.md +84 -84
- package/library/skills/test-driven-development/SKILL.md +116 -116
- package/library/skills/test-driven-development/references/writing-good-tests.md +85 -85
- package/library/skills/ui-testing/SKILL.md +102 -102
- package/library/skills/ui-testing/references/headless-check.md +295 -280
- package/library/skills/ui-testing/references/local-stand.md +51 -51
- package/library/skills/ui-testing/references/playwright-patterns.md +134 -134
- package/library/skills/ui-testing/references/recording.md +61 -58
- package/library/skills/verification-before-completion/SKILL.md +113 -113
- package/library/skills/web-interface-guidelines/SKILL.md +202 -202
- package/package.json +46 -46
|
@@ -1,144 +1,144 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: interface-design
|
|
3
|
-
description: Use when building or changing anything people see in a web or app UI (a screen, page, component, restyle, layout, typography, colour or spacing). Covers following the project's design system, hierarchy, type and spacing scales, colour and depth, states, real content, and looking at the rendered result before finishing.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Interface design
|
|
7
|
-
|
|
8
|
-
The goal is an interface that looks decided, not just correct: one thing leads, the type and spacing follow a system, colour means something, every state exists, and the result belongs to this product. Generated UI usually fails by defaulting, not by breaking. This skill is the process for deciding.
|
|
9
|
-
|
|
10
|
-
## What wins when rules disagree
|
|
11
|
-
|
|
12
|
-
1. **The task's explicit wording.** If it asks for a new look, a specific colour or a pattern, do that.
|
|
13
|
-
2. **The project's own design sources**: DESIGN.md (or a design section in CLAUDE.md / AGENTS.md), theme and token files, the component library, Storybook, and existing screens that do the same job. These always beat any rule or banned pattern in this library. If the product already has a look, extend it.
|
|
14
|
-
3. **The craft rules and default numbers in this library.** Numbers here are defaults for when the project has none.
|
|
15
|
-
4. **Taste lists** such as `avoiding-generic-ai-design`. They describe defaults to avoid when a choice is free; they never override the project.
|
|
16
|
-
|
|
17
|
-
The accessibility floor is not taste: if a project token fails contrast or a component has no focus style, use the nearest passing token or add the missing state, and say so in the report. Details live in the `accessibility` skill.
|
|
18
|
-
|
|
19
|
-
Nobody will answer questions during the run. When something is unclear, decide, write the assumption down, and list it in the final report.
|
|
20
|
-
|
|
21
|
-
## Step 1: Find what already exists
|
|
22
|
-
|
|
23
|
-
Before writing UI code, spend a few minutes on:
|
|
24
|
-
|
|
25
|
-
- Design documents: `DESIGN.md`, `docs/design*`, design notes in CLAUDE.md / AGENTS.md / CONTRIBUTING.
|
|
26
|
-
- Tokens: CSS custom properties, Tailwind config or `@theme`, SCSS variables, a theme object, design-token JSON.
|
|
27
|
-
- Components: the project's `Button`, `Input`, `Dialog`, `Table`, layout shells, icon set, and any headless primitives already installed.
|
|
28
|
-
- The nearest sibling screen that does a similar job. It shows spacing, density, headings, empty states and copy tone in practice.
|
|
29
|
-
- The styling system (Tailwind, CSS modules, plain CSS, CSS-in-JS, a UI kit) and lint rules about styles.
|
|
30
|
-
|
|
31
|
-
Write a short note for yourself:
|
|
32
|
-
|
|
33
|
-
```
|
|
34
|
-
Design sources: DESIGN.md, src/styles/tokens.css, components/ui/*
|
|
35
|
-
Look: light, neutral greys, one blue accent, 8px radius, borders not shadows, Inter 14px body
|
|
36
|
-
Sibling screen: /settings/members (same table, same empty state)
|
|
37
|
-
Gaps: no warning colour token, no skeleton component
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## Step 2: Extend, or choose a fresh direction
|
|
41
|
-
|
|
42
|
-
- **Extend (the default).** The product has screens, tokens or a component library. Use them. New surfaces should look like they shipped with the rest. Fill gaps (a missing token, a missing state) in the project's own style and name them in the report.
|
|
43
|
-
- **Fresh direction.** Only when the product has no UI yet, or the task explicitly asks for a new look. Then choose one coherent direction yourself (nobody will pick for you), following [references/new-direction.md](references/new-direction.md), and state the direction in the report.
|
|
44
|
-
|
|
45
|
-
Never mix: do not bring a new palette, font or radius into one corner of an existing product because it "looks better".
|
|
46
|
-
|
|
47
|
-
## Step 3: Name the job of the screen
|
|
48
|
-
|
|
49
|
-
Write three lines before building:
|
|
50
|
-
|
|
51
|
-
- **Who and when.** "Support lead, many times a day, on a laptop." Not "users".
|
|
52
|
-
- **The verb.** What they must get done here: approve, find the failed deploy, invite a teammate.
|
|
53
|
-
- **The focal element.** The one thing that answers the screen's question. It must win through size, weight, contrast or the space around it; everything else is deliberately demoted.
|
|
54
|
-
|
|
55
|
-
Dashboards, tables, admin, settings and other screens people work in: also follow `app-screens`. Landing and marketing pages: see the pages section of [references/new-direction.md](references/new-direction.md).
|
|
56
|
-
|
|
57
|
-
## Step 4: Build with what exists
|
|
58
|
-
|
|
59
|
-
Controls, in this order:
|
|
60
|
-
|
|
61
|
-
1. Native HTML that does the job (`<button>`, `<a href>`, `<input>`, `<dialog>`, `<details>`, `<label>`).
|
|
62
|
-
2. The project's component for it.
|
|
63
|
-
3. An accessible headless primitive the project already has (Radix, React Aria, Ark, Headless UI, Reka UI, Bits UI, Angular CDK and similar).
|
|
64
|
-
4. Hand-rolled only as a last resort, and then with the full contract: keyboard (arrows, Enter, Escape), focus trap and return, ARIA roles and states, click outside, scroll lock for overlays.
|
|
65
|
-
|
|
66
|
-
Styling, in this order: the design system's component or variant, then a shared component you extract on the second real reuse, then semantic tokens, then a one-off utility for a genuine one-off. Bind to semantic tokens (`bg-surface`, `var(--text-muted)`), not literals (`#fff`, `gray-500`, `13px`). Never introduce a second styling system or a new UI library for looks.
|
|
67
|
-
|
|
68
|
-
## Craft rules
|
|
69
|
-
|
|
70
|
-
Exact default numbers are in [references/craft-defaults.md](references/craft-defaults.md). Use the project's values first.
|
|
71
|
-
|
|
72
|
-
**Hierarchy**
|
|
73
|
-
- One focal point per view. Promote it and demote the rest: secondary actions as secondary buttons or text, metadata in a muted tone.
|
|
74
|
-
- Build tiers from size, weight and colour together. A 14px label at 500 in the secondary text colour and a 14px value at 600 in the primary colour separate better than two sizes two pixels apart.
|
|
75
|
-
- If you squint and cannot tell title, body and metadata apart, the hierarchy is too weak.
|
|
76
|
-
|
|
77
|
-
**Type**
|
|
78
|
-
- A scale, not sizes picked by feel: product UI steps by about 1.2 to 1.25, expressive pages by about 1.333. Four to six sizes on a screen, two or three weights.
|
|
79
|
-
- Sentence case for headings, buttons, labels, tabs and table headers, unless the project already uses another case.
|
|
80
|
-
- Leave letter-spacing at the font's default. Only large display text (about 32px and up) may be tightened slightly, -0.01em to -0.02em. Never change it on body text. Keep the project's values if it already sets them.
|
|
81
|
-
- Reading text 45 to 75 characters per line. `text-wrap: balance` on headings, `pretty` on short paragraphs.
|
|
82
|
-
- Tabular figures (`font-variant-numeric: tabular-nums`) on numbers that update or line up in columns.
|
|
83
|
-
|
|
84
|
-
**Space and layout**
|
|
85
|
-
- One spacing scale on a 4px base. Tight inside a group, clearly larger between groups, more space above a heading than below it.
|
|
86
|
-
- Group by proximity before adding boxes. Cards are for things that are actually separate objects; never nest cards.
|
|
87
|
-
- Shared edges: text blocks start on two or three left edges per screen, not six. Rows of cards share a bottom edge. Choose the column count from the number of items so nothing is orphaned.
|
|
88
|
-
- Responsive changes are structural (sidebar folds, table becomes a list, columns stack), not just smaller. Nothing scrolls sideways at 320 to 390px.
|
|
89
|
-
|
|
90
|
-
**Colour**
|
|
91
|
-
- Roles, not swatches: background, surface, raised, border, text (primary, secondary, muted, disabled), accent, focus, success, warning, danger, info.
|
|
92
|
-
- Neutrals carry the structure. The accent goes on primary actions, current selection and meaning, roughly 10% of the screen at most. Colour never decorates.
|
|
93
|
-
- One meaning per colour across the product. Never colour alone: add text, an icon or position.
|
|
94
|
-
- Contrast: text 4.5:1 (placeholders included), large text, icons, control borders and focus indicators 3:1.
|
|
95
|
-
|
|
96
|
-
**Depth and shape**
|
|
97
|
-
- One depth strategy for the product: borders, tone steps, or soft shadows. A border or a shadow on a surface, not both. Real shadows belong to things that float (menus, popovers, dialogs, toasts).
|
|
98
|
-
- One radius scale. Controls follow their cards. Nested corners are concentric: outer radius = inner radius + padding.
|
|
99
|
-
|
|
100
|
-
**States**
|
|
101
|
-
- Every control: default, hover, focus-visible, active, disabled (and why it is disabled), loading where it triggers work.
|
|
102
|
-
- Every data block: loading (skeleton at the final size, no layout shift), empty (says why and offers the next action), error (what failed, what to do, a retry), one item, many items, long values. Use `interface-polish` to stress-test with worst-case data.
|
|
103
|
-
|
|
104
|
-
**Content**
|
|
105
|
-
- Use the task's real content and the product's real words. Never invent metrics, customer names or logos, testimonials, ratings, prices or data. Where content is missing, use clearly neutral placeholders ("Project name", "0 items") or sample data labelled as such, and list them in the report.
|
|
106
|
-
- Copy rules (verbs on buttons, errors, empty states, sentence case) are in [references/writing.md](references/writing.md).
|
|
107
|
-
|
|
108
|
-
## Step 5: Look at the rendered result
|
|
109
|
-
|
|
110
|
-
Code review of your own CSS will read your intentions into it. Look at pixels.
|
|
111
|
-
|
|
112
|
-
1. Start the app as `ui-testing` describes (dev server, seed data, login).
|
|
113
|
-
2. Take screenshots of each changed screen at 1440, 768 and 390px wide, plus the states you built, following the procedure in `design-review`. When you try several directions, number them ("Design option 1", "Design option 2") in the recordings and in the screenshots you attach, each with a purpose that says what it tries.
|
|
114
|
-
3. Open the images and judge them: does the focal element win, do edges line up, does the phone layout work, is any text clipped or overlapping, does it look like the rest of the product?
|
|
115
|
-
4. Fix the three worst problems, take new screenshots, look again. Three rounds at most.
|
|
116
|
-
|
|
117
|
-
If the app cannot be started or no browser is available, reason from the code, and say in the report that the rendered check did not run and why.
|
|
118
|
-
|
|
119
|
-
## Before you finish
|
|
120
|
-
|
|
121
|
-
- [ ] Squint test: the focal element and the groups read in the right order.
|
|
122
|
-
- [ ] Swap test: with the product name hidden, would this screen look the same as any template? If yes, the free choices were defaulted (see `avoiding-generic-ai-design`).
|
|
123
|
-
- [ ] Every value comes from a token or the project's scale; no new one-off colours, sizes or radii without a reason.
|
|
124
|
-
- [ ] All states above exist and were looked at.
|
|
125
|
-
- [ ] 390px: no sideways scroll, targets at least 44px tall, inputs at least 16px font.
|
|
126
|
-
- [ ] Contrast and visible focus checked on the changed elements.
|
|
127
|
-
- [ ] Copy is real, short and consistent with the rest of the product.
|
|
128
|
-
|
|
129
|
-
## Common mistakes
|
|
130
|
-
|
|
131
|
-
- Restyling a product's existing components "to look better" instead of using them.
|
|
132
|
-
- Everything the same size and weight, so nothing leads.
|
|
133
|
-
- An accent colour on every button, tab and icon.
|
|
134
|
-
- Hard-coded colours and spacing next to an existing token set.
|
|
135
|
-
- Only the happy path built: no loading, empty or error state.
|
|
136
|
-
- Declaring it done without ever looking at a screenshot.
|
|
137
|
-
|
|
138
|
-
## Report
|
|
139
|
-
|
|
140
|
-
Say briefly: the design sources you followed; whether you extended the existing look or chose a fresh direction (and the direction, if fresh); any tokens or states you had to add; placeholder or sample content that must be replaced; which screens and widths you looked at, and anything you could not check.
|
|
141
|
-
|
|
142
|
-
Related: `app-screens`, `avoiding-generic-ai-design`, `interface-polish`, `motion-design`, `web-interface-guidelines`, `design-review`, `accessibility`, `ui-testing`.
|
|
143
|
-
|
|
144
|
-
Sources: adapted from Dammyjay93/interface-design (MIT), pbakaus/impeccable reference files (Apache-2.0, changed: rewritten and condensed, tool and question steps removed), jakubkrehel/make-interfaces-feel-better (MIT), Leonxlnx/taste-skill (MIT).
|
|
1
|
+
---
|
|
2
|
+
name: interface-design
|
|
3
|
+
description: Use when building or changing anything people see in a web or app UI (a screen, page, component, restyle, layout, typography, colour or spacing). Covers following the project's design system, hierarchy, type and spacing scales, colour and depth, states, real content, and looking at the rendered result before finishing.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Interface design
|
|
7
|
+
|
|
8
|
+
The goal is an interface that looks decided, not just correct: one thing leads, the type and spacing follow a system, colour means something, every state exists, and the result belongs to this product. Generated UI usually fails by defaulting, not by breaking. This skill is the process for deciding.
|
|
9
|
+
|
|
10
|
+
## What wins when rules disagree
|
|
11
|
+
|
|
12
|
+
1. **The task's explicit wording.** If it asks for a new look, a specific colour or a pattern, do that.
|
|
13
|
+
2. **The project's own design sources**: DESIGN.md (or a design section in CLAUDE.md / AGENTS.md), theme and token files, the component library, Storybook, and existing screens that do the same job. These always beat any rule or banned pattern in this library. If the product already has a look, extend it.
|
|
14
|
+
3. **The craft rules and default numbers in this library.** Numbers here are defaults for when the project has none.
|
|
15
|
+
4. **Taste lists** such as `avoiding-generic-ai-design`. They describe defaults to avoid when a choice is free; they never override the project.
|
|
16
|
+
|
|
17
|
+
The accessibility floor is not taste: if a project token fails contrast or a component has no focus style, use the nearest passing token or add the missing state, and say so in the report. Details live in the `accessibility` skill.
|
|
18
|
+
|
|
19
|
+
Nobody will answer questions during the run. When something is unclear, decide, write the assumption down, and list it in the final report.
|
|
20
|
+
|
|
21
|
+
## Step 1: Find what already exists
|
|
22
|
+
|
|
23
|
+
Before writing UI code, spend a few minutes on:
|
|
24
|
+
|
|
25
|
+
- Design documents: `DESIGN.md`, `docs/design*`, design notes in CLAUDE.md / AGENTS.md / CONTRIBUTING.
|
|
26
|
+
- Tokens: CSS custom properties, Tailwind config or `@theme`, SCSS variables, a theme object, design-token JSON.
|
|
27
|
+
- Components: the project's `Button`, `Input`, `Dialog`, `Table`, layout shells, icon set, and any headless primitives already installed.
|
|
28
|
+
- The nearest sibling screen that does a similar job. It shows spacing, density, headings, empty states and copy tone in practice.
|
|
29
|
+
- The styling system (Tailwind, CSS modules, plain CSS, CSS-in-JS, a UI kit) and lint rules about styles.
|
|
30
|
+
|
|
31
|
+
Write a short note for yourself:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
Design sources: DESIGN.md, src/styles/tokens.css, components/ui/*
|
|
35
|
+
Look: light, neutral greys, one blue accent, 8px radius, borders not shadows, Inter 14px body
|
|
36
|
+
Sibling screen: /settings/members (same table, same empty state)
|
|
37
|
+
Gaps: no warning colour token, no skeleton component
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Step 2: Extend, or choose a fresh direction
|
|
41
|
+
|
|
42
|
+
- **Extend (the default).** The product has screens, tokens or a component library. Use them. New surfaces should look like they shipped with the rest. Fill gaps (a missing token, a missing state) in the project's own style and name them in the report.
|
|
43
|
+
- **Fresh direction.** Only when the product has no UI yet, or the task explicitly asks for a new look. Then choose one coherent direction yourself (nobody will pick for you), following [references/new-direction.md](references/new-direction.md), and state the direction in the report.
|
|
44
|
+
|
|
45
|
+
Never mix: do not bring a new palette, font or radius into one corner of an existing product because it "looks better".
|
|
46
|
+
|
|
47
|
+
## Step 3: Name the job of the screen
|
|
48
|
+
|
|
49
|
+
Write three lines before building:
|
|
50
|
+
|
|
51
|
+
- **Who and when.** "Support lead, many times a day, on a laptop." Not "users".
|
|
52
|
+
- **The verb.** What they must get done here: approve, find the failed deploy, invite a teammate.
|
|
53
|
+
- **The focal element.** The one thing that answers the screen's question. It must win through size, weight, contrast or the space around it; everything else is deliberately demoted.
|
|
54
|
+
|
|
55
|
+
Dashboards, tables, admin, settings and other screens people work in: also follow `app-screens`. Landing and marketing pages: see the pages section of [references/new-direction.md](references/new-direction.md).
|
|
56
|
+
|
|
57
|
+
## Step 4: Build with what exists
|
|
58
|
+
|
|
59
|
+
Controls, in this order:
|
|
60
|
+
|
|
61
|
+
1. Native HTML that does the job (`<button>`, `<a href>`, `<input>`, `<dialog>`, `<details>`, `<label>`).
|
|
62
|
+
2. The project's component for it.
|
|
63
|
+
3. An accessible headless primitive the project already has (Radix, React Aria, Ark, Headless UI, Reka UI, Bits UI, Angular CDK and similar).
|
|
64
|
+
4. Hand-rolled only as a last resort, and then with the full contract: keyboard (arrows, Enter, Escape), focus trap and return, ARIA roles and states, click outside, scroll lock for overlays.
|
|
65
|
+
|
|
66
|
+
Styling, in this order: the design system's component or variant, then a shared component you extract on the second real reuse, then semantic tokens, then a one-off utility for a genuine one-off. Bind to semantic tokens (`bg-surface`, `var(--text-muted)`), not literals (`#fff`, `gray-500`, `13px`). Never introduce a second styling system or a new UI library for looks.
|
|
67
|
+
|
|
68
|
+
## Craft rules
|
|
69
|
+
|
|
70
|
+
Exact default numbers are in [references/craft-defaults.md](references/craft-defaults.md). Use the project's values first.
|
|
71
|
+
|
|
72
|
+
**Hierarchy**
|
|
73
|
+
- One focal point per view. Promote it and demote the rest: secondary actions as secondary buttons or text, metadata in a muted tone.
|
|
74
|
+
- Build tiers from size, weight and colour together. A 14px label at 500 in the secondary text colour and a 14px value at 600 in the primary colour separate better than two sizes two pixels apart.
|
|
75
|
+
- If you squint and cannot tell title, body and metadata apart, the hierarchy is too weak.
|
|
76
|
+
|
|
77
|
+
**Type**
|
|
78
|
+
- A scale, not sizes picked by feel: product UI steps by about 1.2 to 1.25, expressive pages by about 1.333. Four to six sizes on a screen, two or three weights.
|
|
79
|
+
- Sentence case for headings, buttons, labels, tabs and table headers, unless the project already uses another case.
|
|
80
|
+
- Leave letter-spacing at the font's default. Only large display text (about 32px and up) may be tightened slightly, -0.01em to -0.02em. Never change it on body text. Keep the project's values if it already sets them.
|
|
81
|
+
- Reading text 45 to 75 characters per line. `text-wrap: balance` on headings, `pretty` on short paragraphs.
|
|
82
|
+
- Tabular figures (`font-variant-numeric: tabular-nums`) on numbers that update or line up in columns.
|
|
83
|
+
|
|
84
|
+
**Space and layout**
|
|
85
|
+
- One spacing scale on a 4px base. Tight inside a group, clearly larger between groups, more space above a heading than below it.
|
|
86
|
+
- Group by proximity before adding boxes. Cards are for things that are actually separate objects; never nest cards.
|
|
87
|
+
- Shared edges: text blocks start on two or three left edges per screen, not six. Rows of cards share a bottom edge. Choose the column count from the number of items so nothing is orphaned.
|
|
88
|
+
- Responsive changes are structural (sidebar folds, table becomes a list, columns stack), not just smaller. Nothing scrolls sideways at 320 to 390px.
|
|
89
|
+
|
|
90
|
+
**Colour**
|
|
91
|
+
- Roles, not swatches: background, surface, raised, border, text (primary, secondary, muted, disabled), accent, focus, success, warning, danger, info.
|
|
92
|
+
- Neutrals carry the structure. The accent goes on primary actions, current selection and meaning, roughly 10% of the screen at most. Colour never decorates.
|
|
93
|
+
- One meaning per colour across the product. Never colour alone: add text, an icon or position.
|
|
94
|
+
- Contrast: text 4.5:1 (placeholders included), large text, icons, control borders and focus indicators 3:1.
|
|
95
|
+
|
|
96
|
+
**Depth and shape**
|
|
97
|
+
- One depth strategy for the product: borders, tone steps, or soft shadows. A border or a shadow on a surface, not both. Real shadows belong to things that float (menus, popovers, dialogs, toasts).
|
|
98
|
+
- One radius scale. Controls follow their cards. Nested corners are concentric: outer radius = inner radius + padding.
|
|
99
|
+
|
|
100
|
+
**States**
|
|
101
|
+
- Every control: default, hover, focus-visible, active, disabled (and why it is disabled), loading where it triggers work.
|
|
102
|
+
- Every data block: loading (skeleton at the final size, no layout shift), empty (says why and offers the next action), error (what failed, what to do, a retry), one item, many items, long values. Use `interface-polish` to stress-test with worst-case data.
|
|
103
|
+
|
|
104
|
+
**Content**
|
|
105
|
+
- Use the task's real content and the product's real words. Never invent metrics, customer names or logos, testimonials, ratings, prices or data. Where content is missing, use clearly neutral placeholders ("Project name", "0 items") or sample data labelled as such, and list them in the report.
|
|
106
|
+
- Copy rules (verbs on buttons, errors, empty states, sentence case) are in [references/writing.md](references/writing.md).
|
|
107
|
+
|
|
108
|
+
## Step 5: Look at the rendered result
|
|
109
|
+
|
|
110
|
+
Code review of your own CSS will read your intentions into it. Look at pixels.
|
|
111
|
+
|
|
112
|
+
1. Start the app as `ui-testing` describes (dev server, seed data, login).
|
|
113
|
+
2. Take screenshots of each changed screen at 1440, 768 and 390px wide, plus the states you built, following the procedure in `design-review`. When you try several directions, number them ("Design option 1", "Design option 2") in the recordings and in the screenshots you attach, each with a purpose that says what it tries.
|
|
114
|
+
3. Open the images and judge them: does the focal element win, do edges line up, does the phone layout work, is any text clipped or overlapping, does it look like the rest of the product?
|
|
115
|
+
4. Fix the three worst problems, take new screenshots, look again. Three rounds at most.
|
|
116
|
+
|
|
117
|
+
If the app cannot be started or no browser is available, reason from the code, and say in the report that the rendered check did not run and why.
|
|
118
|
+
|
|
119
|
+
## Before you finish
|
|
120
|
+
|
|
121
|
+
- [ ] Squint test: the focal element and the groups read in the right order.
|
|
122
|
+
- [ ] Swap test: with the product name hidden, would this screen look the same as any template? If yes, the free choices were defaulted (see `avoiding-generic-ai-design`).
|
|
123
|
+
- [ ] Every value comes from a token or the project's scale; no new one-off colours, sizes or radii without a reason.
|
|
124
|
+
- [ ] All states above exist and were looked at.
|
|
125
|
+
- [ ] 390px: no sideways scroll, targets at least 44px tall, inputs at least 16px font.
|
|
126
|
+
- [ ] Contrast and visible focus checked on the changed elements.
|
|
127
|
+
- [ ] Copy is real, short and consistent with the rest of the product.
|
|
128
|
+
|
|
129
|
+
## Common mistakes
|
|
130
|
+
|
|
131
|
+
- Restyling a product's existing components "to look better" instead of using them.
|
|
132
|
+
- Everything the same size and weight, so nothing leads.
|
|
133
|
+
- An accent colour on every button, tab and icon.
|
|
134
|
+
- Hard-coded colours and spacing next to an existing token set.
|
|
135
|
+
- Only the happy path built: no loading, empty or error state.
|
|
136
|
+
- Declaring it done without ever looking at a screenshot.
|
|
137
|
+
|
|
138
|
+
## Report
|
|
139
|
+
|
|
140
|
+
Say briefly: the design sources you followed; whether you extended the existing look or chose a fresh direction (and the direction, if fresh); any tokens or states you had to add; placeholder or sample content that must be replaced; which screens and widths you looked at, and anything you could not check.
|
|
141
|
+
|
|
142
|
+
Related: `app-screens`, `avoiding-generic-ai-design`, `interface-polish`, `motion-design`, `web-interface-guidelines`, `design-review`, `accessibility`, `ui-testing`.
|
|
143
|
+
|
|
144
|
+
Sources: adapted from Dammyjay93/interface-design (MIT), pbakaus/impeccable reference files (Apache-2.0, changed: rewritten and condensed, tool and question steps removed), jakubkrehel/make-interfaces-feel-better (MIT), Leonxlnx/taste-skill (MIT).
|
|
@@ -1,130 +1,130 @@
|
|
|
1
|
-
# Craft defaults
|
|
2
|
-
|
|
3
|
-
Read this when the project has no value for something you need (a type size, a spacing step, a radius, a colour role). Every number below is a default. If the project's tokens, DESIGN.md or existing screens say otherwise, they win.
|
|
4
|
-
|
|
5
|
-
## Type
|
|
6
|
-
|
|
7
|
-
**Scales.** Pick one ratio and step it from the body size. Round to whole pixels.
|
|
8
|
-
|
|
9
|
-
| Use | Ratio | Example steps (px) |
|
|
10
|
-
|---|---|---|
|
|
11
|
-
| Dense product UI | 1.2 | 12, 14, 16, 20, 24 |
|
|
12
|
-
| Most product UI | 1.25 | 12, 14, 16, 18, 22, 28 |
|
|
13
|
-
| Marketing and editorial pages | 1.333 | 16, 21, 28, 38, 50, 67 |
|
|
14
|
-
|
|
15
|
-
Product screens use fixed sizes in rem, not fluid `clamp()` headings. Marketing pages may let display type respond to width, with a cap of about 6rem.
|
|
16
|
-
|
|
17
|
-
**Roles for product UI** (common clean sets: 12/14/16/24, 12/14/18/24):
|
|
18
|
-
|
|
19
|
-
| Role | Size | Weight | Line height |
|
|
20
|
-
|---|---|---|---|
|
|
21
|
-
| Page title | 20 to 28px (24 default) | 600 | 1.25 |
|
|
22
|
-
| Section or card title | 16px | 500 to 600 | 1.4 |
|
|
23
|
-
| Body, table cells, nav | 14px (13px in very dense tools) | 400 | 20px at 14px |
|
|
24
|
-
| Reading text (help, articles) | 16px | 400 | 24px at 16px (1.5) |
|
|
25
|
-
| Labels, metadata, axis ticks | 12px | 400 to 500 | 16px |
|
|
26
|
-
| Smallest text anywhere | 11px | 500 | 16px |
|
|
27
|
-
|
|
28
|
-
- Body line height 1.45 to 1.6; headings 1.1 to 1.3; display 0.95 to 1.1.
|
|
29
|
-
- Measure: 45 to 75 characters for prose (65 to 75 ideal). Tables and dense data may run wider.
|
|
30
|
-
- Weights: at most three per screen. 700 does one job (a title, or money).
|
|
31
|
-
- Letter-spacing: 0 for body and UI text. Display text from about 32px may go to -0.01em or -0.02em. Do not go tighter than -0.03em.
|
|
32
|
-
- Case: sentence case for headings, buttons, labels, tabs, menu items and table headers. Avoid all-caps labels unless the project uses them.
|
|
33
|
-
- Families: one well-tuned sans covers product UI. A second family needs one clear job (monospace for code and IDs, a display face for marketing headlines). Never three.
|
|
34
|
-
- Phones: form inputs at 16px or more, or iOS Safari zooms the page on focus.
|
|
35
|
-
- Light text on dark surfaces: add a little line height (about +0.05) and consider one step more weight.
|
|
36
|
-
|
|
37
|
-
## Spacing
|
|
38
|
-
|
|
39
|
-
Base unit 4px. Scale: 4, 8, 12, 16, 20, 24, 32, 40, 48, 64, 80, 96.
|
|
40
|
-
|
|
41
|
-
| Context | Default |
|
|
42
|
-
|---|---|
|
|
43
|
-
| Icon to label | 6 to 8px |
|
|
44
|
-
| Inside a control (vertical, horizontal) | 6 to 8px, 12 to 16px |
|
|
45
|
-
| Between related fields | 16px |
|
|
46
|
-
| Card padding | 16 to 24px (20 default) |
|
|
47
|
-
| Gap between cards | 16px, the same horizontally and vertically |
|
|
48
|
-
| Between sections of a screen | 32 to 48px |
|
|
49
|
-
| Page gutter, desktop | 24 to 40px |
|
|
50
|
-
| Page gutter, phone | 16 to 20px |
|
|
51
|
-
| Between sections of a marketing page | 96 to 160px |
|
|
52
|
-
|
|
53
|
-
- Padding is symmetrical unless content needs otherwise. An icon button side may be 2px less than the text side for optical balance.
|
|
54
|
-
- Density is three settings moved together: row height, padding and type size. Do not shrink type and keep the padding.
|
|
55
|
-
|
|
56
|
-
## Sizes of controls and rows
|
|
57
|
-
|
|
58
|
-
| Element | Default |
|
|
59
|
-
|---|---|
|
|
60
|
-
| Button and input height, desktop | 32 to 36px (28 in dense toolbars, 40 in long forms) |
|
|
61
|
-
| Button and input height, phone | 44px |
|
|
62
|
-
| Hit area | 44 x 44px on touch, at least 40 x 40 in dense desktop UI (WCAG 2.2 minimum 24 x 24). Extend small controls with padding or a pseudo-element; hit areas never overlap |
|
|
63
|
-
| Table row | 40 to 48px; 32 to 36px dense |
|
|
64
|
-
| List row with avatar and two lines | 56 to 72px |
|
|
65
|
-
| Sidebar width | 224 to 256px; icon rail 48 to 56px |
|
|
66
|
-
| Top bar height | 48 to 56px |
|
|
67
|
-
| Icons | 16px inline and in nav (14 to 20), 1.5px stroke beside regular text, 2px beside semibold |
|
|
68
|
-
|
|
69
|
-
## Colour
|
|
70
|
-
|
|
71
|
-
- **Contrast (WCAG AA):** text and placeholders 4.5:1; text 24px and up (or 18.7px bold and up) 3:1; icons, control borders, focus indicators and chart marks that carry meaning 3:1 against what they sit on.
|
|
72
|
-
- **Text tiers:** primary, secondary, muted (all at 4.5:1 or better), and disabled. On white, about #111 / #4b5563 / #6b6b6b is the lightest set that still passes. Two greys that are close (#999 and #aaa) read as one grey used twice.
|
|
73
|
-
- **Accent budget:** one accent hue, used for the primary action, the current selection, focus and data highlights. Roughly 60% dominant neutral, 30% secondary neutral, 10% accent at most. Many good product screens have under 5% coloured pixels.
|
|
74
|
-
- **Status:** success, warning, danger, info as pale tint backgrounds with dark text of the same hue for chips and banners; solid colour only for small marks. Example pairs: success #dcfae5 / #04250e, danger #ffedea / #831c1e, warning #fffbeb / #92400e. Green text on white needs a dark green (about #247b50) to reach 4.5:1.
|
|
75
|
-
- **Neutrals:** a little tint from the brand hue is fine if the project already does it; pure greys are fine too. Sidebars use the page background (or one step off it), not a dark or saturated block beside a light canvas.
|
|
76
|
-
- **Dark mode:** design it, do not invert. Elevation by lightness: base, then about +4 to +8% lightness per raised level. Borders around rgba(255,255,255,0.06 to 0.12). Desaturate status colours slightly. Set `color-scheme: dark`.
|
|
77
|
-
- **New palettes:** define them in OKLCH when the project has no colour space convention; vary lightness, lower chroma near white and black.
|
|
78
|
-
|
|
79
|
-
## Depth
|
|
80
|
-
|
|
81
|
-
Choose one strategy per product and hold it:
|
|
82
|
-
|
|
83
|
-
| Strategy | Suits |
|
|
84
|
-
|---|---|
|
|
85
|
-
| 1px borders, low contrast (about #e5e7eb to #ededed on white, 1.1 to 1.3:1) | Dense tools, tables, admin |
|
|
86
|
-
| Tone steps (surface one step lighter or darker than the page) | Calm apps, dark themes |
|
|
87
|
-
| Soft shadows | Consumer apps with few layers |
|
|
88
|
-
|
|
89
|
-
- A resting card gets a border or a tone step, or at most a faint shadow (about `0 1px 2px rgb(0 0 0 / 0.06)`). Not a 1px border plus a wide soft shadow.
|
|
90
|
-
- A shadow can stand in for a border: `0 0 0 1px rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.06), 0 2px 4px rgb(0 0 0 / 0.04)`; on dark, `0 0 0 1px rgb(255 255 255 / 0.08)`.
|
|
91
|
-
- Floating layers (menus, popovers, dialogs, toasts) get a real shadow with an offset and blur, one level above their parent. Never a zero-offset coloured glow.
|
|
92
|
-
- Keep real borders for dividers, table rules and input outlines.
|
|
93
|
-
|
|
94
|
-
## Radius
|
|
95
|
-
|
|
96
|
-
Choose a tight or a soft scale once:
|
|
97
|
-
|
|
98
|
-
| Scale | Chips | Controls | Cards | Dialogs |
|
|
99
|
-
|---|---|---|---|---|
|
|
100
|
-
| Tight | 4px | 6px | 8px | 12px |
|
|
101
|
-
| Soft | 6px or full | 8 to 10px | 12 to 16px | 16 to 20px |
|
|
102
|
-
|
|
103
|
-
- Concentric nesting: outer radius = inner radius + padding. When the padding is over about 24px, treat the layers as separate.
|
|
104
|
-
- Pill (fully round) shapes are for chips, toggles and small buttons, not cards.
|
|
105
|
-
- Images in rows: circles for people, 2 to 4px for artwork and logos, the card radius for photos inside cards.
|
|
106
|
-
|
|
107
|
-
## Motion
|
|
108
|
-
|
|
109
|
-
Short form; full guidance in `motion-design`.
|
|
110
|
-
|
|
111
|
-
| Interaction | Duration | Easing |
|
|
112
|
-
|---|---|---|
|
|
113
|
-
| Press feedback | 100 to 160ms | ease-out |
|
|
114
|
-
| Hover, colour change | 100 to 150ms | ease |
|
|
115
|
-
| Tooltip, small popover | 125 to 200ms | ease-out |
|
|
116
|
-
| Dropdown, menu | 150 to 250ms | ease-out |
|
|
117
|
-
| Dialog, drawer | 200 to 300ms (up to 500 for large drawers) | ease-out |
|
|
118
|
-
| Exit | about 75% of the enter | ease-out |
|
|
119
|
-
|
|
120
|
-
Strong ease-out: `cubic-bezier(0.23, 1, 0.32, 1)`. On-screen movement: `cubic-bezier(0.77, 0, 0.175, 1)`. Never `ease-in` for UI. Respect `prefers-reduced-motion`.
|
|
121
|
-
|
|
122
|
-
## Browser details people notice
|
|
123
|
-
|
|
124
|
-
- Focus ring: 2px, offset 2px, in the accent or a high-contrast colour, on `:focus-visible`.
|
|
125
|
-
- Text selection colour from the palette when the project themes it.
|
|
126
|
-
- `-webkit-font-smoothing: antialiased` on the root (macOS) if the project does not already set it.
|
|
127
|
-
- Images: explicit width and height or `aspect-ratio`; a 1px inset outline at `rgb(0 0 0 / 0.1)` on light (`rgb(255 255 255 / 0.1)` on dark) separates photos from same-colour backgrounds.
|
|
128
|
-
- Leave scrollbars native in product UI unless the project already styles them.
|
|
129
|
-
|
|
130
|
-
Sources: numbers condensed from Dammyjay93/interface-design (MIT), Leonxlnx/taste-skill app-screens reference (MIT), jakubkrehel/make-interfaces-feel-better (MIT), emilkowalski/skills (MIT) and pbakaus/impeccable craft-floor, operate, typeset, colorize and layout references (Apache-2.0, changed: rewritten as defaults under the project's own system).
|
|
1
|
+
# Craft defaults
|
|
2
|
+
|
|
3
|
+
Read this when the project has no value for something you need (a type size, a spacing step, a radius, a colour role). Every number below is a default. If the project's tokens, DESIGN.md or existing screens say otherwise, they win.
|
|
4
|
+
|
|
5
|
+
## Type
|
|
6
|
+
|
|
7
|
+
**Scales.** Pick one ratio and step it from the body size. Round to whole pixels.
|
|
8
|
+
|
|
9
|
+
| Use | Ratio | Example steps (px) |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| Dense product UI | 1.2 | 12, 14, 16, 20, 24 |
|
|
12
|
+
| Most product UI | 1.25 | 12, 14, 16, 18, 22, 28 |
|
|
13
|
+
| Marketing and editorial pages | 1.333 | 16, 21, 28, 38, 50, 67 |
|
|
14
|
+
|
|
15
|
+
Product screens use fixed sizes in rem, not fluid `clamp()` headings. Marketing pages may let display type respond to width, with a cap of about 6rem.
|
|
16
|
+
|
|
17
|
+
**Roles for product UI** (common clean sets: 12/14/16/24, 12/14/18/24):
|
|
18
|
+
|
|
19
|
+
| Role | Size | Weight | Line height |
|
|
20
|
+
|---|---|---|---|
|
|
21
|
+
| Page title | 20 to 28px (24 default) | 600 | 1.25 |
|
|
22
|
+
| Section or card title | 16px | 500 to 600 | 1.4 |
|
|
23
|
+
| Body, table cells, nav | 14px (13px in very dense tools) | 400 | 20px at 14px |
|
|
24
|
+
| Reading text (help, articles) | 16px | 400 | 24px at 16px (1.5) |
|
|
25
|
+
| Labels, metadata, axis ticks | 12px | 400 to 500 | 16px |
|
|
26
|
+
| Smallest text anywhere | 11px | 500 | 16px |
|
|
27
|
+
|
|
28
|
+
- Body line height 1.45 to 1.6; headings 1.1 to 1.3; display 0.95 to 1.1.
|
|
29
|
+
- Measure: 45 to 75 characters for prose (65 to 75 ideal). Tables and dense data may run wider.
|
|
30
|
+
- Weights: at most three per screen. 700 does one job (a title, or money).
|
|
31
|
+
- Letter-spacing: 0 for body and UI text. Display text from about 32px may go to -0.01em or -0.02em. Do not go tighter than -0.03em.
|
|
32
|
+
- Case: sentence case for headings, buttons, labels, tabs, menu items and table headers. Avoid all-caps labels unless the project uses them.
|
|
33
|
+
- Families: one well-tuned sans covers product UI. A second family needs one clear job (monospace for code and IDs, a display face for marketing headlines). Never three.
|
|
34
|
+
- Phones: form inputs at 16px or more, or iOS Safari zooms the page on focus.
|
|
35
|
+
- Light text on dark surfaces: add a little line height (about +0.05) and consider one step more weight.
|
|
36
|
+
|
|
37
|
+
## Spacing
|
|
38
|
+
|
|
39
|
+
Base unit 4px. Scale: 4, 8, 12, 16, 20, 24, 32, 40, 48, 64, 80, 96.
|
|
40
|
+
|
|
41
|
+
| Context | Default |
|
|
42
|
+
|---|---|
|
|
43
|
+
| Icon to label | 6 to 8px |
|
|
44
|
+
| Inside a control (vertical, horizontal) | 6 to 8px, 12 to 16px |
|
|
45
|
+
| Between related fields | 16px |
|
|
46
|
+
| Card padding | 16 to 24px (20 default) |
|
|
47
|
+
| Gap between cards | 16px, the same horizontally and vertically |
|
|
48
|
+
| Between sections of a screen | 32 to 48px |
|
|
49
|
+
| Page gutter, desktop | 24 to 40px |
|
|
50
|
+
| Page gutter, phone | 16 to 20px |
|
|
51
|
+
| Between sections of a marketing page | 96 to 160px |
|
|
52
|
+
|
|
53
|
+
- Padding is symmetrical unless content needs otherwise. An icon button side may be 2px less than the text side for optical balance.
|
|
54
|
+
- Density is three settings moved together: row height, padding and type size. Do not shrink type and keep the padding.
|
|
55
|
+
|
|
56
|
+
## Sizes of controls and rows
|
|
57
|
+
|
|
58
|
+
| Element | Default |
|
|
59
|
+
|---|---|
|
|
60
|
+
| Button and input height, desktop | 32 to 36px (28 in dense toolbars, 40 in long forms) |
|
|
61
|
+
| Button and input height, phone | 44px |
|
|
62
|
+
| Hit area | 44 x 44px on touch, at least 40 x 40 in dense desktop UI (WCAG 2.2 minimum 24 x 24). Extend small controls with padding or a pseudo-element; hit areas never overlap |
|
|
63
|
+
| Table row | 40 to 48px; 32 to 36px dense |
|
|
64
|
+
| List row with avatar and two lines | 56 to 72px |
|
|
65
|
+
| Sidebar width | 224 to 256px; icon rail 48 to 56px |
|
|
66
|
+
| Top bar height | 48 to 56px |
|
|
67
|
+
| Icons | 16px inline and in nav (14 to 20), 1.5px stroke beside regular text, 2px beside semibold |
|
|
68
|
+
|
|
69
|
+
## Colour
|
|
70
|
+
|
|
71
|
+
- **Contrast (WCAG AA):** text and placeholders 4.5:1; text 24px and up (or 18.7px bold and up) 3:1; icons, control borders, focus indicators and chart marks that carry meaning 3:1 against what they sit on.
|
|
72
|
+
- **Text tiers:** primary, secondary, muted (all at 4.5:1 or better), and disabled. On white, about #111 / #4b5563 / #6b6b6b is the lightest set that still passes. Two greys that are close (#999 and #aaa) read as one grey used twice.
|
|
73
|
+
- **Accent budget:** one accent hue, used for the primary action, the current selection, focus and data highlights. Roughly 60% dominant neutral, 30% secondary neutral, 10% accent at most. Many good product screens have under 5% coloured pixels.
|
|
74
|
+
- **Status:** success, warning, danger, info as pale tint backgrounds with dark text of the same hue for chips and banners; solid colour only for small marks. Example pairs: success #dcfae5 / #04250e, danger #ffedea / #831c1e, warning #fffbeb / #92400e. Green text on white needs a dark green (about #247b50) to reach 4.5:1.
|
|
75
|
+
- **Neutrals:** a little tint from the brand hue is fine if the project already does it; pure greys are fine too. Sidebars use the page background (or one step off it), not a dark or saturated block beside a light canvas.
|
|
76
|
+
- **Dark mode:** design it, do not invert. Elevation by lightness: base, then about +4 to +8% lightness per raised level. Borders around rgba(255,255,255,0.06 to 0.12). Desaturate status colours slightly. Set `color-scheme: dark`.
|
|
77
|
+
- **New palettes:** define them in OKLCH when the project has no colour space convention; vary lightness, lower chroma near white and black.
|
|
78
|
+
|
|
79
|
+
## Depth
|
|
80
|
+
|
|
81
|
+
Choose one strategy per product and hold it:
|
|
82
|
+
|
|
83
|
+
| Strategy | Suits |
|
|
84
|
+
|---|---|
|
|
85
|
+
| 1px borders, low contrast (about #e5e7eb to #ededed on white, 1.1 to 1.3:1) | Dense tools, tables, admin |
|
|
86
|
+
| Tone steps (surface one step lighter or darker than the page) | Calm apps, dark themes |
|
|
87
|
+
| Soft shadows | Consumer apps with few layers |
|
|
88
|
+
|
|
89
|
+
- A resting card gets a border or a tone step, or at most a faint shadow (about `0 1px 2px rgb(0 0 0 / 0.06)`). Not a 1px border plus a wide soft shadow.
|
|
90
|
+
- A shadow can stand in for a border: `0 0 0 1px rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.06), 0 2px 4px rgb(0 0 0 / 0.04)`; on dark, `0 0 0 1px rgb(255 255 255 / 0.08)`.
|
|
91
|
+
- Floating layers (menus, popovers, dialogs, toasts) get a real shadow with an offset and blur, one level above their parent. Never a zero-offset coloured glow.
|
|
92
|
+
- Keep real borders for dividers, table rules and input outlines.
|
|
93
|
+
|
|
94
|
+
## Radius
|
|
95
|
+
|
|
96
|
+
Choose a tight or a soft scale once:
|
|
97
|
+
|
|
98
|
+
| Scale | Chips | Controls | Cards | Dialogs |
|
|
99
|
+
|---|---|---|---|---|
|
|
100
|
+
| Tight | 4px | 6px | 8px | 12px |
|
|
101
|
+
| Soft | 6px or full | 8 to 10px | 12 to 16px | 16 to 20px |
|
|
102
|
+
|
|
103
|
+
- Concentric nesting: outer radius = inner radius + padding. When the padding is over about 24px, treat the layers as separate.
|
|
104
|
+
- Pill (fully round) shapes are for chips, toggles and small buttons, not cards.
|
|
105
|
+
- Images in rows: circles for people, 2 to 4px for artwork and logos, the card radius for photos inside cards.
|
|
106
|
+
|
|
107
|
+
## Motion
|
|
108
|
+
|
|
109
|
+
Short form; full guidance in `motion-design`.
|
|
110
|
+
|
|
111
|
+
| Interaction | Duration | Easing |
|
|
112
|
+
|---|---|---|
|
|
113
|
+
| Press feedback | 100 to 160ms | ease-out |
|
|
114
|
+
| Hover, colour change | 100 to 150ms | ease |
|
|
115
|
+
| Tooltip, small popover | 125 to 200ms | ease-out |
|
|
116
|
+
| Dropdown, menu | 150 to 250ms | ease-out |
|
|
117
|
+
| Dialog, drawer | 200 to 300ms (up to 500 for large drawers) | ease-out |
|
|
118
|
+
| Exit | about 75% of the enter | ease-out |
|
|
119
|
+
|
|
120
|
+
Strong ease-out: `cubic-bezier(0.23, 1, 0.32, 1)`. On-screen movement: `cubic-bezier(0.77, 0, 0.175, 1)`. Never `ease-in` for UI. Respect `prefers-reduced-motion`.
|
|
121
|
+
|
|
122
|
+
## Browser details people notice
|
|
123
|
+
|
|
124
|
+
- Focus ring: 2px, offset 2px, in the accent or a high-contrast colour, on `:focus-visible`.
|
|
125
|
+
- Text selection colour from the palette when the project themes it.
|
|
126
|
+
- `-webkit-font-smoothing: antialiased` on the root (macOS) if the project does not already set it.
|
|
127
|
+
- Images: explicit width and height or `aspect-ratio`; a 1px inset outline at `rgb(0 0 0 / 0.1)` on light (`rgb(255 255 255 / 0.1)` on dark) separates photos from same-colour backgrounds.
|
|
128
|
+
- Leave scrollbars native in product UI unless the project already styles them.
|
|
129
|
+
|
|
130
|
+
Sources: numbers condensed from Dammyjay93/interface-design (MIT), Leonxlnx/taste-skill app-screens reference (MIT), jakubkrehel/make-interfaces-feel-better (MIT), emilkowalski/skills (MIT) and pbakaus/impeccable craft-floor, operate, typeset, colorize and layout references (Apache-2.0, changed: rewritten as defaults under the project's own system).
|