command-code 1.93.0 → 1.93.1

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.
Files changed (92) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/package.json +1 -1
  3. package/vsix/commandcode-vscode.vsix +0 -0
  4. package/dist/bundled/agent-browser/SKILL.md +0 -73
  5. package/dist/bundled/command-code-knowledge/SKILL.md +0 -68
  6. package/dist/bundled/command-code-knowledge/live-models.ts +0 -284
  7. package/dist/bundled/command-code-knowledge/reference/byok.md +0 -389
  8. package/dist/bundled/command-code-knowledge/reference/custom-agents.md +0 -341
  9. package/dist/bundled/command-code-knowledge/reference/custom-slash-commands.md +0 -423
  10. package/dist/bundled/command-code-knowledge/reference/headless.md +0 -381
  11. package/dist/bundled/command-code-knowledge/reference/hooks.md +0 -1107
  12. package/dist/bundled/command-code-knowledge/reference/mcp.md +0 -648
  13. package/dist/bundled/command-code-knowledge/reference/memory.md +0 -137
  14. package/dist/bundled/command-code-knowledge/reference/models.md +0 -144
  15. package/dist/bundled/command-code-knowledge/reference/permissions.md +0 -486
  16. package/dist/bundled/command-code-knowledge/reference/plan-mode.md +0 -283
  17. package/dist/bundled/command-code-knowledge/reference/plans.md +0 -16
  18. package/dist/bundled/command-code-knowledge/reference/product-help.md +0 -489
  19. package/dist/bundled/command-code-knowledge/reference/sessions.md +0 -377
  20. package/dist/bundled/command-code-knowledge/reference/skills.md +0 -1009
  21. package/dist/bundled/command-code-knowledge/reference/tools.md +0 -522
  22. package/dist/bundled/config/SKILL.md +0 -18
  23. package/dist/bundled/config/references/permissions.md +0 -27
  24. package/dist/bundled/config/references/settings.md +0 -50
  25. package/dist/bundled/design/SKILL.md +0 -441
  26. package/dist/bundled/design/references/accessibility.md +0 -404
  27. package/dist/bundled/design/references/border.md +0 -161
  28. package/dist/bundled/design/references/button.md +0 -192
  29. package/dist/bundled/design/references/checkup.md +0 -162
  30. package/dist/bundled/design/references/color.md +0 -245
  31. package/dist/bundled/design/references/create.md +0 -291
  32. package/dist/bundled/design/references/design-html.md +0 -227
  33. package/dist/bundled/design/references/deslop.md +0 -283
  34. package/dist/bundled/design/references/finish.md +0 -156
  35. package/dist/bundled/design/references/interaction.md +0 -186
  36. package/dist/bundled/design/references/layout.md +0 -216
  37. package/dist/bundled/design/references/media.md +0 -112
  38. package/dist/bundled/design/references/motion.md +0 -237
  39. package/dist/bundled/design/references/redesign.md +0 -197
  40. package/dist/bundled/design/references/refine.md +0 -193
  41. package/dist/bundled/design/references/relayout.md +0 -207
  42. package/dist/bundled/design/references/report-html.md +0 -235
  43. package/dist/bundled/design/references/responsive.md +0 -233
  44. package/dist/bundled/design/references/review.md +0 -164
  45. package/dist/bundled/design/references/setup.md +0 -119
  46. package/dist/bundled/design/references/severity.md +0 -111
  47. package/dist/bundled/design/references/shadow.md +0 -164
  48. package/dist/bundled/design/references/smell.md +0 -211
  49. package/dist/bundled/design/references/style-3d.md +0 -23
  50. package/dist/bundled/design/references/style-bento.md +0 -21
  51. package/dist/bundled/design/references/style-editorial.md +0 -23
  52. package/dist/bundled/design/references/style-futuristic.md +0 -21
  53. package/dist/bundled/design/references/style-glassmorphism.md +0 -52
  54. package/dist/bundled/design/references/style-maximalism.md +0 -20
  55. package/dist/bundled/design/references/style-minimalism.md +0 -21
  56. package/dist/bundled/design/references/style-neo-brutalism.md +0 -21
  57. package/dist/bundled/design/references/style-retro-futurism.md +0 -21
  58. package/dist/bundled/design/references/style-swiss.md +0 -20
  59. package/dist/bundled/design/references/style.md +0 -77
  60. package/dist/bundled/design/references/surface.md +0 -163
  61. package/dist/bundled/design/references/system.md +0 -73
  62. package/dist/bundled/design/references/typeset.md +0 -210
  63. package/dist/bundled/design/references/variants.md +0 -193
  64. package/dist/bundled/design/references/voice.md +0 -184
  65. package/dist/bundled/design/references/writing.md +0 -174
  66. package/dist/bundled/loop/SKILL.md +0 -16
  67. package/dist/bundled/mod-builder/SKILL.md +0 -135
  68. package/dist/bundled/mod-builder/examples/block-dangerous-commands.ts +0 -41
  69. package/dist/bundled/mod-builder/examples/custom-entry-renderer.ts +0 -32
  70. package/dist/bundled/mod-builder/examples/custom-tool.ts +0 -53
  71. package/dist/bundled/mod-builder/examples/flags-and-options.ts +0 -29
  72. package/dist/bundled/mod-builder/examples/input-shortcuts.ts +0 -41
  73. package/dist/bundled/mod-builder/examples/kitchen-sink.ts +0 -129
  74. package/dist/bundled/mod-builder/examples/lifecycle-hooks.ts +0 -64
  75. package/dist/bundled/mod-builder/examples/model-router.ts +0 -43
  76. package/dist/bundled/mod-builder/examples/observe-events.ts +0 -30
  77. package/dist/bundled/mod-builder/examples/pane-and-buttons.ts +0 -60
  78. package/dist/bundled/mod-builder/examples/pane-form.ts +0 -68
  79. package/dist/bundled/mod-builder/examples/permission-policy.ts +0 -34
  80. package/dist/bundled/mod-builder/examples/redact-secrets.ts +0 -46
  81. package/dist/bundled/mod-builder/examples/slash-command.ts +0 -33
  82. package/dist/bundled/mod-builder/examples/spinner-count.ts +0 -47
  83. package/dist/bundled/mod-builder/examples/stream-filter.ts +0 -70
  84. package/dist/bundled/mod-builder/reference/api.md +0 -140
  85. package/dist/bundled/mod-builder/reference/hooks-and-events.md +0 -347
  86. package/dist/bundled/mod-builder/reference/overview.md +0 -271
  87. package/dist/bundled/mod-builder/reference/packaging.md +0 -187
  88. package/dist/bundled/mod-builder/reference/ui.md +0 -253
  89. package/dist/bundled/mod-builder/reference/verify.md +0 -67
  90. package/dist/bundled/skill-builder/SKILL.md +0 -104
  91. package/dist/cli.mjs +0 -16
  92. package/dist/index.mjs +0 -2
@@ -1,404 +0,0 @@
1
- # Accessibility: `/design a11y`
2
-
3
- This is not a checklist I run once the design is done. It is the ground the design stands on, and most of it costs nothing as long as I stop fighting the platform: the browser already gives buttons a keyboard, already reads a real label aloud, already draws a focus ring until someone writes a rule to erase it.
4
-
5
- A design that only works for a sighted mouse user is a sketch, not a design.
6
-
7
- ---
8
-
9
- ## Pre-execution checklist
10
-
11
- Before proceeding, check for existing reports in the `.commandcode/design/` directory. Look for these files:
12
-
13
- - `checkup-report.md`
14
- - `review-report.md`
15
- - `smell-report.md`
16
-
17
- If any of these files exist, read the report content and use it as context for your analysis. Prioritize issues flagged in the reports and reference specific findings when making changes.
18
-
19
- If no reports are found, proceed with the task normally.
20
-
21
- ---
22
-
23
- ## Access Follows Composition
24
-
25
- The work pattern decides which access failures hurt most.
26
-
27
- Monitor screens fail when alerts are color-only, live updates never announce, or an operator cannot acknowledge without a mouse.
28
-
29
- Operate screens fail when direct manipulation has no keyboard equivalent, focus is lost after a command, or a drag handle is the only path.
30
-
31
- Compare screens fail when table structure is faked with divs, sort controls have no state, or numbers are unreadable at zoom.
32
-
33
- Configure screens fail when labels are placeholders, errors are a red border, or the submit button is disabled until the user guesses what is wrong.
34
-
35
- Learn screens fail when headings are picked for their size, reading order jumps, or media autoplays.
36
-
37
- Decide screens fail when the one action is an unlabeled icon, or the whole pitch is an image with no alt text.
38
-
39
- Explore screens fail when filters are unreachable, results never announce their count, or hover is the only way to see anything.
40
-
41
- ---
42
-
43
- ## Access Bar
44
-
45
- `/design a11y` repairs the access system. It is not an `aria-label` sprinkle.
46
-
47
- At minimum, I inspect and repair: focus visibility, the complete keyboard path, semantic elements, accessible names, landmark and heading structure, form labels and error announcement, live regions, hit areas, alt text, reduced motion, and behavior at 200% zoom and 320px width.
48
-
49
- I make two passes before I judge anything. Pass one, the mouse is off the table — if a task cannot be finished on the keyboard, it is not finished. Pass two, I listen instead of look: every control has to say what it is called, what kind of thing it is, and what state it is in.
50
-
51
- Adding one `aria-label` is not an accessibility pass unless the user asked for that one fix.
52
-
53
- ---
54
-
55
- ## Native First, ARIA Last
56
-
57
- The first rule of ARIA is: don't use ARIA. If a native element with the semantics and behavior I need exists, I use it.
58
-
59
- | Element | Use for | What it gives me free |
60
- |---|---|---|
61
- | `<a href>` | Navigation, anything that changes the URL | Cmd/Ctrl/middle-click, right-click to copy, Enter |
62
- | `<button>` | Actions: submit, toggle, open, delete | Focus, Enter *and* Space, form semantics |
63
- | `<div onClick>` | Nothing at all | Nothing — it is styled text that happens to run code |
64
-
65
- No ARIA is better than bad ARIA. A screen reader trusts my roles, so a wrong role is worse than none. A role is a promise: `role="tab"` promises the full tab keyboard model, and I have to deliver it.
66
-
67
- The five rules I do not break:
68
-
69
- 1. Use the native element when one exists.
70
- 2. Don't change native semantics unless I truly have to.
71
- 3. Every interactive ARIA control is keyboard-operable.
72
- 4. Nothing that can hold focus may be erased with `role="presentation"` or `aria-hidden="true"`.
73
- 5. Nothing interactive ships without a name.
74
-
75
- The rule runs both directions. Anything that reads as pressable has to be pressable — and anything that is not has to stop dressing like it. Give a status badge the same shape as the buttons around it and users will keep clicking it, forever, getting nothing back.
76
-
77
- ---
78
-
79
- ## Focus Is Architecture
80
-
81
- I style `:focus-visible`, never bare `:focus`. The browser shows `:focus-visible` for keyboard and assistive tech but suppresses it for mouse clicks, where focus is already obvious.
82
-
83
- I prefer the browser's own ring, because it adapts to platform and forced-color settings without me predicting every background:
84
-
85
- ```css
86
- /* Best: keep the browser ring, give it breathing room */
87
- :focus-visible {
88
- outline-offset: 2px;
89
- }
90
-
91
- /* Custom ring when the design requires one: use the project's verified token */
92
- :focus-visible {
93
- outline: 2px solid var(--focus-ring);
94
- outline-offset: 2px;
95
- }
96
- ```
97
-
98
- A bare `outline: 2px solid` renders `currentColor`, which is not automatically safe — the ring may cross colors unrelated to the text's own background. Before I ship a custom ring I inspect the whole perimeter against every adjacent color it crosses: component fills, page surfaces, images, gradients, hover and selected states. At least a `2px` solid perimeter, or an equivalent visible area.
99
-
100
- `outline: none` and `focus:outline-none` without a verified replacement are hostile. In `forced-colors: active` I keep the default color adjustment or use a system color such as `Highlight`; I never freeze the authored color with `forced-color-adjust: none` unless the control stays perceivable.
101
-
102
- `:focus-within` groups the ring on a wrapper when an inner input takes focus — a search box with an icon inside the border.
103
-
104
- ---
105
-
106
- ## The Keyboard Path
107
-
108
- Every pointer interaction needs a keyboard path. `tabindex` has exactly two legal values:
109
-
110
- - `tabindex="0"` — puts a custom control into the tab order it should already have been in. Only for things the platform does not focus on its own.
111
- - `tabindex="-1"` — reachable from script, skipped by Tab. This is for the heading I throw focus at after a route change, the modal shell, and the inactive members of a roving group.
112
- - Anything positive — no. One positive value reorders the entire page around itself, and the actual problem is always the DOM order, so that is what I go fix.
113
-
114
- Composite widgets occupy one Tab stop and use roving tabindex: the active item is `0`, every other is `-1`, and arrow keys move both focus and the `0`.
115
-
116
- | Widget | Keys |
117
- |---|---|
118
- | Dialog | Tab/Shift+Tab cycle inside and wrap; Escape closes |
119
- | Tabs | Arrows move between tabs and wrap; Tab exits to the panel; Home/End jump to the ends |
120
- | Menu button | Enter/Space/ArrowDown opens on the first item; ArrowUp opens on the last; Escape closes and refocuses the button |
121
- | Disclosure / accordion | The header itself is a `<button aria-expanded>`, toggled by Enter or Space |
122
- | Combobox | ArrowDown opens and moves in; Enter accepts; Escape closes and returns to the input |
123
- | Listbox / radio group | Arrows move selection; one Tab stop for the whole group |
124
-
125
- Three rules hold everywhere. Escape unwinds one layer at a time, newest first — the tooltip goes before the menu it sits in, and the menu goes before the dialog holding both. Arrows travel *inside* a widget while Tab travels *between* them. And Enter submits from a focused input, except in a `<textarea>`, where it owes the user a newline and Cmd/Ctrl+Enter does the submitting.
126
-
127
- A tab set has to decide what an arrow key means. If the panels are cheap to render, arrowing onto a tab can open it outright. If switching costs a fetch or a heavy re-render, arrowing only moves focus and the user confirms with Enter or Space — otherwise skimming the row fires off every panel on the way past.
128
-
129
- ---
130
-
131
- ## Trap and Restore
132
-
133
- A modal has to hold focus inside itself. The cheapest way to get that is `inert` on whatever sits behind the dialog: one attribute, and the background stops being tabbable and stops existing for assistive tech at the same time.
134
-
135
- ```js
136
- // On open
137
- appContent.inert = true;
138
- (dialog.querySelector("[autofocus]") ??
139
- dialog.querySelector("button, [href], input, select, textarea"))?.focus();
140
-
141
- // On close
142
- appContent.inert = false;
143
- trigger?.focus(); // always return focus to what opened it
144
- ```
145
-
146
- Native `<dialog>` with `showModal()` gives me the trap, the inert background, and Escape handling for free, so I prefer it. A custom overlay that cannot use `<dialog>` needs `role="dialog"`, `aria-modal="true"`, and an accessible name via `aria-labelledby` pointing at its heading.
147
-
148
- Either way: on open, focus the first focusable element — but for a destructive confirmation, focus the *least* destructive action. On close, return focus to the trigger; if the trigger is gone, move focus to the nearest logical container. Add `overscroll-behavior: contain` so scrolling inside never scrolls the page behind it.
149
-
150
- **Client-side navigation** changes the screen and tells nobody. The page never reloads, so focus stays wherever it was and a screen reader announces nothing at all. I do that work by hand: retitle the document for wherever the user has landed, then throw focus at the new view's `<h1>` — `tabindex="-1"` makes it a legal target — or at `<main>` if there is no heading. Going back or forward restores the old scroll position; going somewhere new starts at the top.
151
-
152
- ---
153
-
154
- ## Accessible Names
155
-
156
- When several naming sources compete, the winner is decided in this order: `aria-labelledby`, then `aria-label`, then whatever the platform derives (`<label>`, text content, `alt`), and `title` only if nothing else exists.
157
-
158
- I reach for visible text or `aria-labelledby` first. `aria-label` is a string nobody can see, which means it quietly falls out of step with the interface it describes, and translation tooling treats it unevenly.
159
-
160
- ```tsx
161
- // Name from visible text, icon hidden
162
- <button>
163
- <TrashIcon aria-hidden="true" /> Delete
164
- </button>
165
-
166
- // Icon-only, explicit name
167
- <button aria-label="Delete">
168
- <TrashIcon aria-hidden="true" />
169
- </button>
170
- ```
171
-
172
- Whatever the user can read on the control has to be contained in the name the control reports. Label a button "Send" on screen and `"Submit message"` underneath, and someone driving the interface by voice says "click Send" and nothing happens.
173
-
174
- Brand names, code tokens, and identifiers get `translate="no"`, so machine translation leaves them alone instead of mangling them.
175
-
176
- | Mistake | Why it fails |
177
- |---|---|
178
- | `aria-label` on a plain `<div>` or `<span>` | Names on role-less, non-interactive elements are ignored |
179
- | `<button role="button">` | Redundant role: noise, no benefit |
180
- | `aria-hidden="true"` on or above a focusable element | A Tab stop that does not exist for screen readers |
181
- | `aria-labelledby`/`aria-describedby` aimed at an ID that isn't there | Fails without a warning: the control ends up nameless |
182
- | `role="menu"` on site navigation | `menu` promises app-style arrow keys; site nav is `<nav>` with a list |
183
-
184
- ---
185
-
186
- ## Structure Is Navigation
187
-
188
- There is exactly one primary `<main>` on the page. The other structural elements — `<header>`, `<nav>`, `<aside>`, `<footer>` — become the waypoints a screen-reader user jumps between, so when two of the same kind exist I name them apart: `<nav aria-label="Primary">` next to `<nav aria-label="Breadcrumbs">`.
189
-
190
- Headings describe their sections and form a coherent outline. One page-level `<h1>` with properly nested levels is the recommended default. Headings are structure, not styling — I pick the level semantically and set the visual size in CSS, never the reverse.
191
-
192
- When repeated navigation or chrome precedes the content, the first focusable element is a skip link:
193
-
194
- ```css
195
- .skip-link { position: absolute; inset-inline-start: -999px; }
196
- .skip-link:focus { inset-inline-start: 16px; top: 16px; }
197
- ```
198
-
199
- In-page anchor targets get `scroll-margin-top` so a sticky header does not swallow them. `<title>` matches the current context, most specific first: `Billing · Settings · Acme`.
200
-
201
- ---
202
-
203
- ## Forms
204
-
205
- The label has to be wired to the field, not merely near it: `<label for>` aimed at the input's `id`, or a `<label>` wrapped around it. Placeholder text does not qualify. It vanishes at the first keystroke — exactly when the user most needs to remember what they are filling in — and it usually fails contrast on the way out.
206
-
207
- Label and field are one target, not two. If the words "Send me updates" do not toggle the checkbox, there is a dead strip between them, and I close it.
208
-
209
- The complete error pattern:
210
-
211
- ```html
212
- <label for="email">Email</label>
213
- <input id="email" type="email" autocomplete="email"
214
- aria-invalid="true" aria-describedby="email-error" />
215
- <p id="email-error">Enter a valid email address.</p>
216
- ```
217
-
218
- - `aria-invalid="true"` goes on while the field is wrong and comes back off the moment it is right.
219
- - `aria-describedby` ties the field to the message beneath it, so the two are read as one thing rather than as an orphaned sentence.
220
- - Errors render inline next to their field with text or an icon. A red border alone is color-only and fails.
221
- - Submitting a broken form throws focus at the first thing that failed. I do not need to announce it separately; landing there says it.
222
- - I do not disable submit until the form is valid. A disabled action hides what must be fixed. I keep it enabled until the request starts, then disable it with a spinner **while keeping the original label** — the label is what tells assistive tech which button is busy.
223
- - I accept free text and validate after; I never filter characters as the user types. I trim before validating, because autocomplete and text expansion add trailing spaces.
224
-
225
- `autocomplete` with a meaningful `name` fills a form in one tap and is a WCAG requirement for fields about the user:
226
-
227
- | Field | `autocomplete` |
228
- |---|---|
229
- | Name | `name`, or `given-name` / `family-name` |
230
- | Email / phone | `email` / `tel` |
231
- | Address | `street-address`, `address-line1`, `postal-code`, `country` |
232
- | Card | `cc-number`, `cc-exp`, `cc-csc`, `cc-name` |
233
- | Login | `username`, `current-password` |
234
- | Signup / reset | `new-password` |
235
- | 2FA code | `one-time-code` |
236
-
237
- Correct `type` and `inputmode` pick the right mobile keyboard: `type="email"` / `url` / `tel`; `type="text" inputmode="numeric"` for OTP, PIN, and card numbers (keeps text semantics, no spinner); `type="text" inputmode="decimal"` for money; `type="number"` only for a true numeric quantity. `spellcheck="false"` on emails, codes, and usernames.
238
-
239
- I never block paste — users paste passwords and one-time codes — and I stay compatible with password managers: a real `<form>`, correct `autocomplete`, no fake inputs.
240
-
241
- **Disabled states.** Native `disabled` supplies the platform's complete behavior: out of the tab order, no activation, `:disabled` styling, excluded from submission. `aria-disabled="true"` only *announces* the state — it changes nothing else. I use it only when keeping the control discoverable is intentional, and then I block pointer and keyboard activation in code, style the state explicitly, and say nearby why the action is unavailable. Never both attributes on one element.
242
-
243
- ---
244
-
245
- ## Announcing Change
246
-
247
- I take the first of these that fits and stop there:
248
-
249
- 1. **Focus already goes there** — an opening modal, the first broken field. The movement carries the message; adding anything else means saying it twice.
250
- 2. **It belongs to one control** — a field's error, a character count. `aria-describedby` on that control.
251
- 3. **It belongs to no control and can wait** — a toast, "Saved", a result count, a loading update. A polite region, `role="status"`.
252
- 4. **It belongs to no control and cannot wait** — the form failed as a whole, the session is about to expire. `role="alert"`.
253
-
254
- For repeated polite updates I keep a stable empty region in the DOM and change its text; inserting a new polite region together with its content is announced inconsistently.
255
-
256
- ```tsx
257
- <div role="status" className="sr-only">{statusMessage}</div>
258
- ```
259
-
260
- Polite is the default and `assertive` is the exception, because reaching for `assertive` by habit is how a live region goes from helpful to hostile: it cuts off whatever sentence the user was in the middle of. I keep each message short and able to stand alone, since `aria-atomic` reads the entire region again every time any of it changes. And a toast never steals focus — it speaks from where it is, and the user keeps their hands where they were.
261
-
262
- The canonical visually-hidden pattern (Tailwind ships it as `sr-only`):
263
-
264
- ```css
265
- .sr-only {
266
- position: absolute;
267
- width: 1px; height: 1px;
268
- padding: 0; margin: -1px;
269
- overflow: hidden;
270
- clip-path: inset(50%);
271
- white-space: nowrap;
272
- border: 0;
273
- }
274
- ```
275
-
276
- The box is `1px`, not `0`, because a few screen readers walk straight past anything with no size. And this is the one job `display: none` and `visibility: hidden` cannot do: they do not hide the text visually, they delete it from the accessibility tree along with everything else.
277
-
278
- ---
279
-
280
- ## Alt Text by Purpose
281
-
282
- I choose alt by what the image *does*, not by what it looks like.
283
-
284
- | Purpose | Alt | Example |
285
- |---|---|---|
286
- | Decorative or redundant with adjacent text | `alt=""`, empty but present | Logo beside the company name in text |
287
- | Informative | The meaning it adds | `alt="Ticket QR code"` |
288
- | Functional (the image is the control) | The action or destination | Search icon → `alt="Search"`, not `alt="magnifying glass"` |
289
- | Image of text | The exact text (better: use real text) | `alt="50% off everything"` |
290
- | Complex (chart, diagram) | Short summary, full data nearby | `alt="Revenue by quarter, described below"` |
291
-
292
- Leaving `alt` off entirely is the worst of the options — with nothing to read, screen readers fall back to announcing the file name.
293
-
294
- **SVG:** decorative gets `aria-hidden="true"` and `focusable="false"`. Meaningful inline SVG gets `role="img"` plus `aria-label`. Prerecorded video needs captions, audio needs transcripts, nothing autoplays with sound, controls always render.
295
-
296
- ---
297
-
298
- ## Hit Areas
299
-
300
- What the user sees is allowed to be tiny. What the user has to hit is not.
301
-
302
- | Standard | Minimum |
303
- |---|---|
304
- | WCAG 2.5.8 (AA) | 24×24px — the hard floor |
305
- | WCAG 2.5.5 (AAA) | 44×44px |
306
- | Apple HIG | 44×44pt |
307
- | Material | 48×48dp |
308
-
309
- I treat 44px as the target for touch and 40px as a useful desktop size when density permits. Smaller controls are not automatic failures — I check the spacing, equivalent-control, inline, user-agent, and essential exceptions first. Under the spacing exception, an undersized target passes if a 24px circle centered on it does not intersect another target's circle; in the simple case, 20px targets need a 4px gap.
310
-
311
- ```css
312
- /* Expand without changing the visual size — on the label or button, never the input */
313
- .checkbox-label { position: relative; width: 20px; height: 20px; }
314
- .checkbox-label::after {
315
- content: "";
316
- position: absolute;
317
- top: 50%; left: 50%;
318
- transform: translate(-50%, -50%);
319
- width: 44px; height: 44px;
320
- }
321
- ```
322
-
323
- When the element can afford real box size I skip the pseudo-element and let the box be the target (`min-width: 44px; min-height: 44px; display: inline-grid; place-items: center`) — the browser then gets the real geometry for scrolling and gestures.
324
-
325
- **Collision rule:** two interactive elements never have overlapping hit areas. If an extended area would collide, I shrink it to the largest size that does not.
326
-
327
- `touch-action: manipulation` removes the double-tap-to-zoom delay. `-webkit-tap-highlight-color` matches the design instead of flashing gray.
328
-
329
- ---
330
-
331
- ## Motion, Zoom, and Reflow
332
-
333
- Motion is opt-in, not chased with overrides:
334
-
335
- ```css
336
- .card { /* static */ }
337
- @media (prefers-reduced-motion: no-preference) {
338
- .card { transition: transform 200ms ease-out; }
339
- }
340
- ```
341
-
342
- Inheriting a codebase too far gone to invert, I fall back to a blanket override — but I set durations to `0.01ms` instead of `none`. Zero means the browser never fires `transitionend` or `animationend`, and any script waiting on one of those events sits there forever.
343
-
344
- The preference asks for less motion, not none. What it is protecting against is vestibular upset, not the interface answering the user:
345
-
346
- | Cut it | Swap it | Leave it alone |
347
- |---|---|---|
348
- | Parallax | Anything that slides, scales, or zooms → a plain opacity crossfade | Spinners and progress indicators |
349
- | Video, GIFs, and looping decoration that start themselves | Smooth scrolling → jump straight there | State that changes instantly: hover color, the focus ring |
350
- | Spinning, and anything travelling a long way across the screen | Carousels that rotate on their own → hand them over paused | The short confirmation that a press registered |
351
-
352
- Independent of the preference: anything that moves, blinks, or updates automatically for more than 5 seconds needs a visible pause control — muted looping hero video included. Auto-dismissing toasts are for low-stakes confirmations only; anything carrying an action or an error stays until dismissed. Never put the only path to an action inside a timed element — that is data loss on a schedule.
353
-
354
- **Zoom:** all content and functionality survives 200% zoom, and the page reflows at 320px width with vertical scrolling only. Genuinely two-dimensional content (tables, maps, code blocks) scrolls inside its own container. Fixed heights are what break under zoom — `min-height` on anything containing text, and let containers grow.
355
-
356
- **rem vs px:** I respect how the codebase is set up and never introduce mixed units into someone else's system. Where I do have the choice: `rem` for `font-size`, text container `max-width`, media-query breakpoints, and spacing that should scale with text; `px` for borders, focus outline width and offset, shadow details, and fixed decorations. Breakpoints are where it matters most — at a larger base font size, a `rem` query switches to the mobile layout when the text needs it and a `px` query does not.
357
-
358
- ---
359
-
360
- ## Never Color Alone
361
-
362
- Status needs a redundant cue: an icon, text, or an underline alongside the color. Red-and-green as the only difference between two states is a failure for roughly one in twelve men.
363
-
364
- Contrast is measured between a foreground and the background it actually renders against. I identify which requirement applies, measure the rendered pair, and report the pair, its measured value, and the threshold it misses. Thresholds and the OKLCH remediation method live in [color.md](color.md#contrast-mechanics).
365
-
366
- ---
367
-
368
- ## What I Refuse
369
-
370
- - `outline: none` with no verified replacement
371
- - Calling one `aria-label` an accessibility pass
372
- - `<div onClick>` where a `<button>` or `<a href>` belongs
373
- - Placeholder used as the only label
374
- - Positive `tabindex` to fix a focus order the DOM should fix
375
- - Submit disabled until the form is valid
376
- - `assertive` live regions for routine toasts
377
- - `aria-hidden="true"` on a focusable element
378
- - Functional icon alt that describes the picture instead of the action
379
- - A modal that traps nothing and returns focus nowhere
380
- - Motion or autoplay that ignores `prefers-reduced-motion`
381
- - Fixed heights on text containers that clip at 200% zoom
382
- - Hover as the only way to reach a feature
383
- - Reporting a color contrast failure by repainting the brand without being asked
384
-
385
- ---
386
-
387
- ## How I Know Access Works
388
-
389
- - The primary task completes with the keyboard alone, start to finish
390
- - Focus is visible on every interactive element and never disappears
391
- - Every control announces a name, a role, and its state
392
- - Overlays trap focus, close on Escape, and return focus to the trigger
393
- - Every input has a real label, the right `type`, and useful `autocomplete`
394
- - Errors announce, sit beside their field, and say how to recover
395
- - No state is carried by color alone
396
- - Every hit area clears the floor and none of them overlap
397
- - Motion respects `prefers-reduced-motion` and nothing autoplays without a pause
398
- - The page works at 200% zoom and reflows at 320px without horizontal scrolling
399
- - I verified these by walking the interface, not by reading the CSS
400
-
401
- STRICT RULE — NEVER BREAK THIS
402
- Do not create report.md, any kind of report, summary, analysis file,
403
- or extra documentation. This applies every time this file is used.
404
- Generate no reports unless explicitly asked.
@@ -1,161 +0,0 @@
1
- # Border System `/design border`
2
-
3
- Borders answer one question: what belongs together, and what is separate?
4
-
5
- If a border does not clarify structure, state, focus, or containment, I remove it.
6
-
7
- ---
8
-
9
- ## Edges Follow Composition
10
-
11
- The work pattern decides where boundaries matter.
12
-
13
- Monitor screens need edges around alert severity, status groups, feeds, and changing regions.
14
-
15
- Operate screens need edges around tools, canvases, inspectors, targets, and active selections.
16
-
17
- Compare screens need row, column, header, and pinned-context boundaries.
18
-
19
- Configure screens need boundaries around choice groups, dependency clusters, previews, and commit zones.
20
-
21
- Learn screens need section boundaries only when they help pacing.
22
-
23
- Decide screens need few boundaries. Too many edges dilute the action.
24
-
25
- Explore screens need boundaries around filters, result clusters, maps, galleries, and selected paths.
26
-
27
- I do not add a border because a card feels unfinished. I add it when the work needs separation.
28
-
29
- ---
30
-
31
- ## System Bar
32
-
33
- `/design border` creates or repairs an edge system. It is not a single outline change.
34
-
35
- At minimum, I cover containers, dividers, inputs, focus rings, selected states, error states, disabled states, tables or lists when present, and cards or panels when present.
36
-
37
- Every border must have a job: separation, focus, state, containment, or density. If I cannot name the job, I remove it.
38
-
39
- ---
40
-
41
- ## What Borders Are For
42
-
43
- I use borders to separate panels, define inputs, show focus, mark state, hold tables together, and frame surfaces that need containment.
44
-
45
- I do not use borders as decoration. A border that exists only because the surface feels empty is a layout problem.
46
-
47
- ---
48
-
49
- ## Weight
50
-
51
- Most borders should be thin. Thin borders define structure without turning the interface into a wireframe.
52
-
53
- Focus and active states can use stronger weight because they carry interaction. Error states can earn stronger treatment when the field or object needs immediate attention.
54
-
55
- I avoid awkward in-between weights. A border should look deliberate: subtle, standard, or emphatic.
56
-
57
- ---
58
-
59
- ## Color
60
-
61
- Border color is semantic.
62
-
63
- Subtle borders hold cards, panels, and dividers. Default borders define inputs and controls. Strong borders mark hover, active, or selected states. Focus borders use the accent and must stay visible. Error and success borders appear only when state requires them.
64
-
65
- Dark themes need authored border values. A light theme border cannot simply be inverted.
66
-
67
- ---
68
-
69
- ## Radius
70
-
71
- Radius is part of the product's physical language.
72
-
73
- Product UI usually wants tighter corners. Brand surfaces can be softer. Data-heavy or technical systems can go square. Pills belong to pills, filters, tags, avatars, and certain segmented controls.
74
-
75
- I keep inner elements visually nested. Inner radius should feel smaller than outer radius. If nested corners fight, the surface looks careless.
76
-
77
- The math is concentric: **outer radius = inner radius + the padding between them.** A card with `8px` padding around a `12px`-radius child wants a `20px` radius, not another `12px`. Mismatched radii on closely nested surfaces is the single most common reason an interface feels subtly off.
78
-
79
- The rule applies while the layers are visually nested. Past roughly `24px` of padding they read as separate surfaces, and each radius is chosen on its own rather than forced through the formula. An established component token beats the formula when the layers are independent or the padding is deliberately asymmetric.
80
-
81
- ---
82
-
83
- ## Focus Rings
84
-
85
- Focus is the most important border-like treatment.
86
-
87
- It must be visible, offset enough to avoid clipping, shaped to match the element, and consistent across the interface. Removing focus without replacement is hostile.
88
-
89
- If a component cannot use a normal outline, I still provide a clear ring or halo that survives nearby colors.
90
-
91
- I style `:focus-visible`, not bare `:focus`, so keyboard users get the ring and mouse users usually do not. Where the design allows it, the browser's own indicator with `outline-offset: 2px` is the strongest choice, because it adapts to platform and forced-color settings without me predicting every background. A custom ring uses the project's focus token and gets checked against every color its perimeter crosses. Full mechanics, including forced-colors behavior: [accessibility.md](accessibility.md#focus-is-architecture).
92
-
93
- ---
94
-
95
- ## Dividers
96
-
97
- Dividers separate thoughts, not pixels.
98
-
99
- Horizontal dividers work when sections need a pause. Vertical dividers work when columns are close enough to confuse. Inset dividers can show hierarchy inside lists and panels.
100
-
101
- If spacing already separates the groups, I do not add a line.
102
-
103
- ---
104
-
105
- ## Tables
106
-
107
- Tables need enough structure to scan.
108
-
109
- Default tables often work best with bottom borders only. Dense data can earn full cell borders. Striped rows can replace some borders. Hover rows should change background more often than border.
110
-
111
- The header boundary deserves more clarity than ordinary row boundaries.
112
-
113
- ---
114
-
115
- ## Cards And Panels
116
-
117
- A flat card can use a subtle border. An elevated card can use shadow. Heavy border plus heavy shadow usually creates noise.
118
-
119
- I choose one containment strategy per surface. Border-led systems feel precise. Shadow-led systems feel layered. Mixed systems need a reason.
120
-
121
- ---
122
-
123
- ## Inputs
124
-
125
- Inputs need clear default, hover, focus, error, disabled, and read-only boundaries.
126
-
127
- Border color alone is rarely enough for focus. Error borders vanish when the error is fixed. Disabled borders recede without making the element look broken.
128
-
129
- ---
130
-
131
- ## What I Refuse
132
-
133
- - Side-stripe accent borders as a design shortcut
134
- - Calling one card outline a border system
135
- - Focus, error, or disabled boundaries left untouched
136
- - Double borders at component junctions
137
- - Different border colors for the same role
138
- - Strong borders everywhere
139
- - Focus rings that disappear into the background
140
- - Border and shadow both fighting for the same containment job
141
- - Random radius mixing
142
- - Borders around groups that spacing already separates
143
-
144
- ---
145
-
146
- ## How I Know Borders Work
147
-
148
- - Edge changes cover real component states, not only static cards
149
- - Structure is clearer with the border than without it
150
- - Border roles are semantic and consistent
151
- - Focus is visible everywhere
152
- - Radius feels like one system
153
- - Tables scan cleanly
154
- - Inputs communicate state without ambiguity
155
- - No side-stripe AI tell remains
156
- - The interface does not look like a wireframe
157
-
158
- STRICT RULE — NEVER BREAK THIS
159
- Do not create report.md, any kind of report, summary, analysis file,
160
- or extra documentation. This applies every time this file is used.
161
- Generate no reports unless explicitly asked.