@filipgutica/design-system 2.0.0 → 2.2.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.
@@ -13,6 +13,23 @@ Each section has the same parts: anatomy, tokens, states, keyboard and screen re
13
13
 
14
14
  The identity layer reads only the identity tokens (`--color-project`, `--color-project-dark`, `--font-ui`, `--font-mono`) and the terminal tokens. A core component never depends on an identity component.
15
15
 
16
+ ## Groups
17
+
18
+ The sections follow the catalogue's purpose groups, in this order. Each component keeps its layer.
19
+
20
+ | Group | Components |
21
+ | --- | --- |
22
+ | Actions | Button, quiet action |
23
+ | Selection | Checkbox and radio, radio card group, switch, toggle button, segmented control |
24
+ | Inputs | Text input and textarea, select, field wrapper, slider |
25
+ | Feedback and status | Progress, score, badge, alert |
26
+ | Containers and overlays | Surface and card, figure, dialog, drawer |
27
+ | Navigation | Navigation list, section rail, find field, breadcrumbs, pager, tabs, skip link, keyboard key |
28
+ | Code and examples | Code block |
29
+ | Identity | Command plate, terminal capture, site header, page type and helpers |
30
+
31
+ A control's **States** line names each interactive state it has. In `components.html` each control section lists the same states in `data-states`, and the Control states table shows them; a test checks the three agree.
32
+
16
33
  ## Rules for every control
17
34
 
18
35
  - **Sizes.** `sm`, `md`, and `lg` use `--control-sm`, `--control-md`, and `--control-lg` for height, with `--text-sm`, `--text-md`, and `--text-lg`. At tablet width (`max-width: 800px`) touch targets use `--control-lg`.
@@ -40,7 +57,7 @@ Layer: Core. ui: `UiButton`.
40
57
  | Danger | `--color-error-surface` fill, `--color-error` mixed 75% with `--color-text` (85% in dark), `--shadow-raise` | `--color-error` 10% into `--color-error-surface` | `--color-error` 16% into `--color-error-surface`, `--shadow-sink` |
41
58
  | Text | Transparent, `--color-link`, underlined, 4px padding | No change | No change |
42
59
 
43
- - **States.** Pressed also moves the button 1px down, for every variant but text, and applies to `aria-pressed="true"`. Busy sets `aria-busy="true"` and `disabled`, so the button takes no hover or press, with `cursor: wait`. It shows a 14px spinner before the label: a 2px `currentColor` ring with a transparent right edge, turning once every 700ms. Keep the label while busy.
60
+ - **States.** Rest, hover, pressed, focus-visible, disabled, and busy. Pressed also moves the button 1px down, for every variant but text, and applies to `aria-pressed="true"`. Busy sets `aria-busy="true"` and `disabled`, so the button takes no hover or press, with `cursor: wait`. It shows a 14px spinner before the label: a 2px `currentColor` ring with a transparent right edge, turning once every 700ms. Keep the label while busy.
44
61
  - **Danger label.** Check the label at 4.5:1 on the rest, hover, and pressed fills. Where the mix misses, use the first of `--color-text`, black, and white that reads on all three.
45
62
  - **Use.** One primary action for each decision group. The hue fill marks that action; every other action is secondary, ghost, or text.
46
63
  - **Keyboard and screen reader.** Native button behavior: Enter and Space activate it. An icon-only button needs `aria-label`.
@@ -58,37 +75,6 @@ Layer: Core. ui: the `fg-quiet-action` class.
58
75
  - **Motion.** Fill and colour change over `--duration-fast` with `--ease-out`.
59
76
  - **Forced colors.** The transparent border draws as the system edge.
60
77
 
61
- ## Text input and textarea
62
-
63
- Layer: Core. ui: `UiInput`. ui has no textarea; a textarea uses the same field recipe.
64
-
65
- - **Anatomy.** A native `<input>` or `<textarea>`. Full width, line height 1.35. Input heights follow the control size, and horizontal padding is about 9px, 10px, or 11px.
66
- - **Tokens.** Fill `--color-field-bg` (`--color-surface-raised` in light, the sunk `--color-well` well in dark), text `--color-text`, placeholder `--color-muted` at full opacity, corners `--radius-field`, border 1px `--color-field-edge` (`--color-border-subtle`), shadow `--shadow-field` (none in light, `--shadow-sink` in dark).
67
- - **States.** Rest, focus-visible (the accent edge and inset line from [field focus](#rules-for-every-control)), disabled (the `--color-well` well, no shadow), invalid (`--color-error` border), and invalid while focused (`--color-error` border and a `--color-error` inset line). A textarea keeps the same padding at the top and bottom as at the sides, and resizes vertically only.
68
- - **Keyboard and screen reader.** Each field has a visible `<label>`. A search field is the one exception: its leading magnifier and an accessible name that names the search (`aria-label`, or a visually hidden `<label>`) stand in for the visible label. A field inside a [field wrapper](#field-wrapper) gets its description and error ids from it.
69
- - **Motion.** None.
70
- - **Search.** `type="search"` keeps the native clear button, quieted to a 12px cross drawn with a `mask` (1.5px round strokes) and filled `--color-muted`, with `--space-2` before it. Hover fills it `--color-text`. The cross sits at the input's trailing edge, so inside a field wrapper with an icon or key hint the input takes the free space (`flex: 1`, `min-width: 0`) and the wrapper carries the width. The wrapper carries the field fill, edge, shadow, and focus, so the input inside it draws nothing. In forced colors the cross opts out of adjustment and fills `CanvasText`, so the mask keeps a visible fill.
71
- - **Forced colors.** The border draws as the system field edge. The inset line drops, so a focused field draws a `Highlight` outline just inside its edge. The system edge replaces the `--color-error` edge, so the invalid state relies on its error text there; see [known gaps](decisions.md#known-gaps).
72
-
73
- ## Select
74
-
75
- Layer: Core. ui: `UiSelect`.
76
-
77
- - **Anatomy.** A native `<select>` with the input's field recipe and a chevron on the right. Draw the chevron in `currentColor`, or with an 8px border corner in `--color-muted` turned 45°. Right padding leaves room for it at every size.
78
- - **Picker.** Where `appearance: base-select` is supported, the open list is a floating layer: `--color-surface-raised`, a transparent 1px border, `--radius-panel`, `--shadow-dialog`, 4px padding, at least the select's width, and at most `min(20rem, 50dvh)` tall. Options are at least 32px tall (44px on coarse pointers), with `--space-2` `--space-3` padding and corners of `--radius-panel` minus 4px. Hover fills `--color-row-hover`. An `--color-accent` check at the end marks the checked option. The check carries the state: the option's `--color-row-selected` fill equals `--color-surface-raised`. Keyboard focus is the focus ring, inset because the list scrolls. Other browsers keep the native picker.
79
- - **States.** Rest, focus-visible, disabled, invalid, and invalid while focused, as for the input.
80
- - **Keyboard and screen reader.** Native select behavior. A visible `<label>`.
81
- - **Motion.** None.
82
- - **Forced colors.** The closed field as for the input, including the `Highlight` focus outline. The picker is native.
83
-
84
- ## Field wrapper
85
-
86
- Layer: Core. ui: `UiField`.
87
-
88
- - **Anatomy.** A grid with a 6px gap: label, control, then a description or an error. The error replaces the description.
89
- - **Tokens.** Label `--text-sm` semibold `--color-text`. Description `--text-sm` `--color-muted`. Error `--text-sm` `--color-error`.
90
- - **Keyboard and screen reader.** The label's `for` names the control. The control points `aria-describedby` at the description, and `aria-errormessage` at the error with `aria-invalid="true"`.
91
-
92
78
  ## Checkbox and radio
93
79
 
94
80
  Layer: Core. ui: `UiCheckbox`. ui has no standalone radio; radio cards cover radio choices there.
@@ -136,13 +122,45 @@ Layer: Core. ui: `UiToggleButton`.
136
122
  Layer: Core. ui: `UiSegmentedControl`.
137
123
 
138
124
  - **Use.** Two to five short options that apply at once, such as a view mode or the System, Light, and Dark appearance choice. Use a select for longer lists and radio cards for options that need descriptions.
139
- - **Anatomy.** A `role="group"` with an accessible name, containing one `<button aria-pressed>` for each option. The track is undivided: `--color-well` fill, `--shadow-sink`, a transparent 1px border, and `--radius-control`. Each button is the full control height with `--space-3` padding (square when icon-only). Its thumb is a `::before` layer inset 2px inside the button, behind the label.
125
+ - **Anatomy.** A `role="group"` with an accessible name, containing one `<button aria-pressed>` for each option. The track is undivided: `--color-well` fill, `--shadow-sink`, a transparent 1px border, and `--radius-control`. Each button is the full control height (`--item`) with `--space-3` padding, and square when icon-only. At tablet width an unsized control sets `--item` to `--control-lg`, so its buttons grow to the touch size and icon-only options stay square. Its thumb is a `::before` layer inset 2px inside the button, behind the label.
140
126
  - **Tokens.** Labels are `--color-muted`. The pressed option's thumb is `--color-control-thumb` with `--shadow-raise` and no ring. Its label is `--color-segmented-current-text`: `--color-accent` where it reaches 4.5:1 on the thumb, on the page and on a surface, and otherwise the first of `--color-text`, black, and white that does. An icon-only option needs 3:1. Hover on an unpressed option shows the thumb at 45% and turns the label `--color-text`.
141
127
  - **States.** Rest, hover, pressed, focus-visible (an inset ring, so it hugs the thumb instead of crossing into the next option), and disabled.
142
128
  - **Keyboard and screen reader.** Each option is its own Tab stop; Space and Enter press it. Icon-only options use the label as `aria-label` and `title`.
143
129
  - **Motion.** Hover fades the label colour over `--duration-fast` with `--ease-out`. When the reader changes the choice, one thumb glides from the old option to the new one. Start the new thumb's left and right edges where the old thumb was, then animate each edge home with CSS `ease`. The leading edge takes 260ms and the trailing edge 300ms, so the thumb stretches a little on the way. Labels cross-fade their colour over 260ms. If a glide is cut short, start the next one from the thumb's current position. There is no motion on first render, on a value restored from storage, or on a theme change: allow glides only after the first frame. Reduced motion moves the thumb at once.
144
130
  - **Forced colors.** The pressed option draws `Highlight` behind `HighlightText`. Its focus ring is `CanvasText`: the option opts out of adjustment, and the ring sits on the track.
145
131
 
132
+ ## Text input and textarea
133
+
134
+ Layer: Core. ui: `UiInput`. ui has no textarea; a textarea uses the same field recipe.
135
+
136
+ - **Anatomy.** A native `<input>` or `<textarea>`. Full width, line height 1.35. Input heights follow the control size, and horizontal padding is about 9px, 10px, or 11px.
137
+ - **Tokens.** Fill `--color-field-bg` (`--color-surface-raised` in light, the sunk `--color-well` well in dark), text `--color-text`, placeholder `--color-muted` at full opacity, corners `--radius-field`, border 1px `--color-field-edge` (`--color-border-subtle`), shadow `--shadow-field` (none in light, `--shadow-sink` in dark).
138
+ - **States.** Rest, focus-visible (the accent edge and inset line from [field focus](#rules-for-every-control)), disabled (the `--color-well` well, no shadow), invalid (`--color-error` border), and invalid while focused (`--color-error` border and a `--color-error` inset line). A textarea keeps the same padding at the top and bottom as at the sides, and resizes vertically only.
139
+ - **Keyboard and screen reader.** Each field has a visible `<label>`. A search field is the one exception: its leading magnifier and an accessible name that names the search (`aria-label`, or a visually hidden `<label>`) stand in for the visible label. A field inside a [field wrapper](#field-wrapper) gets its description and error ids from it.
140
+ - **Motion.** None.
141
+ - **Search.** `type="search"` keeps the native clear button, quieted to a 12px cross drawn with a `mask` (1.5px round strokes) and filled `--color-muted`, with `--space-2` before it. Hover fills it `--color-text`. The cross sits at the input's trailing edge, so inside a field wrapper with an icon or key hint the input takes the free space (`flex: 1`, `min-width: 0`) and the wrapper carries the width. The wrapper carries the field fill, edge, shadow, and focus, so the input inside it draws nothing. In forced colors the cross opts out of adjustment and fills `CanvasText`, so the mask keeps a visible fill.
142
+ - **Forced colors.** The border draws as the system field edge. The inset line drops, so a focused field draws a `Highlight` outline just inside its edge. The system edge replaces the `--color-error` edge, so the invalid state relies on its error text there; see [known gaps](decisions.md#known-gaps).
143
+
144
+ ## Select
145
+
146
+ Layer: Core. ui: `UiSelect`.
147
+
148
+ - **Anatomy.** A native `<select>` with the input's field recipe and a chevron on the right. Draw the chevron in `currentColor`, or with an 8px border corner in `--color-muted` turned 45°. Right padding leaves room for it at every size.
149
+ - **Picker.** Where `appearance: base-select` is supported, the open list is a floating layer: `--color-surface-raised`, a transparent 1px border, `--radius-panel`, `--shadow-dialog`, 4px padding, at least the select's width, and at most `min(20rem, 50dvh)` tall. Options are at least 32px tall (44px on coarse pointers), with `--space-2` `--space-3` padding and corners of `--radius-panel` minus 4px. Hover fills `--color-row-hover`. An `--color-accent` check at the end marks the checked option. The check carries the state: the option's `--color-row-selected` fill equals `--color-surface-raised`. Keyboard focus is the focus ring, inset because the list scrolls. Other browsers keep the native picker.
150
+ - **States.** Rest, focus-visible, disabled, invalid, and invalid while focused, as for the input.
151
+ - **Keyboard and screen reader.** Native select behavior. A visible `<label>`.
152
+ - **Motion.** None.
153
+ - **Forced colors.** The closed field as for the input, including the `Highlight` focus outline. The picker is native.
154
+
155
+ ## Field wrapper
156
+
157
+ Layer: Core. ui: `UiField`.
158
+
159
+ - **Anatomy.** A grid with a 6px gap: label, control, then a description or an error. The error replaces the description.
160
+ - **Tokens.** Label `--text-sm` semibold `--color-text`. Description `--text-sm` `--color-muted`. Error `--text-sm` `--color-error`.
161
+ - **States.** Rest, and invalid: the error replaces the description, and the control takes its own invalid state.
162
+ - **Keyboard and screen reader.** The label's `for` names the control. The control points `aria-describedby` at the description, and `aria-errormessage` at the error with `aria-invalid="true"`.
163
+
146
164
  ## Slider
147
165
 
148
166
  Layer: Core. ui: `UiSlider`.
@@ -169,16 +187,6 @@ Layer: Core. ui: `UiScore`.
169
187
  - **Keyboard and screen reader.** The pips are `aria-hidden`; the text value carries the score.
170
188
  - **Forced colors.** Filled pips redraw in `Highlight` with `forced-color-adjust: none`.
171
189
 
172
- ## Tabs
173
-
174
- Layer: Core. ui: `UiTabs`.
175
-
176
- - **Anatomy.** A `role="tablist"` with no rule below it and a 12px gap below it. It scrolls sideways when needed, and a 24px mask fades each clipped edge. Scrolling clips on every side, so the list has 4px (`--space-1`) padding all round: it keeps the selected tab's shadow whole and its fill off the frame edge. Each tab is a borderless button at least `--control-md` tall (`--control-lg` on phones), with `--space-2` `--space-3` padding, `--radius-field` corners, medium weight, and `--color-muted`.
177
- - **States.** Hover fills `--color-row-hover` and turns the text `--color-text`. The selected tab takes the [navigation row](#navigation-list)'s current-page recipe: `--color-nav-current` fill and `--shadow-nav-current`, with no underline. Its text is `--color-nav-current-text`: the first of `--color-accent`, `--color-text`, black, and white that reaches 4.5:1 over the tinted fill, both on the page and on a surface (composite a translucent fill over each first). Focus-visible is the focus ring, inset because the list scrolls.
178
- - **Motion.** Fill, colour, and shadow change as on a [navigation row](#navigation-list).
179
- - **Keyboard and screen reader.** Roving `tabindex`: arrow keys move between tabs, Home and End go to the ends, and focus selects the tab. Each tab has `aria-controls` and `aria-selected`; each panel has `role="tabpanel"`. Without JavaScript, show every panel under its own heading. Apply the tab roles and hide the headings and unselected panels only when the script enhances the markup.
180
- - **Forced colors.** The fill and shadow drop, so the selected tab takes a 2px `Highlight` border, and its padding shrinks by 2px to keep its size.
181
-
182
190
  ## Badge
183
191
 
184
192
  Layer: Core. ui: `UiBadge`.
@@ -223,22 +231,96 @@ Layer: Core. ui: `UiDialog`.
223
231
  Layer: Core. ui: `UiDrawer`.
224
232
 
225
233
  - **Anatomy.** A dialog fixed to the left edge, full height, `min(--sidebar + 48px, 100vw - 48px)` wide, with a header (title and close button) and a body that scrolls on its own. It is a floating layer with square corners: `--color-surface-raised`, a transparent 1px border, and `--shadow-dialog`. The close button is a [quiet action](#quiet-action).
234
+ - **Navigation drawer.** A drawer that holds navigation opens on the current row, scrolled to the centre of the body. A keyboard open moves focus to that row; a tap moves focus to the body, so no ring shows and no on-screen keyboard opens. An open from a Find button moves focus to the [find field](#find-field), which stays pinned at the top of the body while the list scrolls under it.
226
235
  - **Keyboard and screen reader.** As for the dialog. Following an in-page link inside the drawer closes it and moves focus to the link's destination (given `tabindex="-1"` if it is not focusable), not back to the trigger. Modified clicks (a new tab or window) leave it open.
236
+ - **Page behind.** While the drawer is open, until it has slid out, the page behind it does not scroll: the root takes `overflow: hidden`, which keeps the reader's position. The page reserves the scrollbar gutter all the time (`scrollbar-gutter: stable` on the root), so hiding a classic scrollbar does not reflow it.
227
237
  - **Motion.** It slides in over `--duration` and out over `--duration-fast`, with `--ease-out`, while the overlay fades. Reduced motion shows and hides it at once.
228
238
 
229
239
  ## Navigation list
230
240
 
231
241
  Layer: Core. The mono font on rail rows is identity. ui: the rows in `UiSiteNav` and the project menu.
232
242
 
233
- - **Anatomy.** A `<nav>` with a name, holding links in rows: at least `--row` tall (`--control-lg` at tablet width), `0 --space-3` padding, `--radius-field` corners, `--text-sm`, and `--color-muted`. Groups have a `--text-xs` semibold muted label and 2px gaps between rows.
234
- - **States.** Hover: `--color-row-hover` fill and `--color-text`. Current page (`aria-current="page"`): `--color-nav-current` fill, `--shadow-nav-current`, `--color-nav-current-text`, and medium weight; hover keeps that fill. `--color-nav-current` is an accent tint: `--color-accent` at 14% over `--color-surface-raised` in light, and `--color-accent` at 20% over transparent in dark. `--color-nav-current-text` is the first of `--color-accent`, `--color-text`, black, and white that reaches 4.5:1 over the tinted fill, both on the page and on a surface (composite a translucent fill over each first). Selected tabs and selected list rows use the same fill and rule. Current location in the page (`aria-current="location"`): `--color-text` in medium weight, with a 3×14 `--color-accent` pip at the leading edge, inset 4px, and no fill. Focus-visible: the focus ring, inset because the rail and the drawer scroll.
235
- - **Phone.** At tablet width a section rail becomes a drawer. Its trigger is a secondary button at `--control-lg` with a three-line menu glyph (14×10, 1.5px lines) before the label. Without JavaScript the list opens in place, so the trigger is a `<details>` summary with the secondary button classes and a chevron after the label. Only the chevron is local.
236
- - **Horizontal strip.** A section strip laid out in a row uses these rows and states unchanged, the location pip included.
243
+ - **Anatomy.** A `<nav>` with a name, holding links in rows: at least `--row` tall (`--control-lg` at tablet width), `0 --space-3` padding, `--radius-inline` corners, `--text-sm`, and `--color-muted`. A row may hold a leading 16px icon and a trailing muted count. A text-only row centres its label on the cap height: where `text-box` is supported, it is a block with `align-content: center`, `--space-2` block padding, and `text-box: trim-both cap alphabetic`, and the location pip centres itself. The padding keeps a wrapped label's first and last lines clear of the fill's edges and the focus ring. Rows with an icon or a count, and browsers without `text-box`, centre the line box, which leaves a label without descenders about 1px above centre. Groups have a `--text-xs` semibold muted label and 2px gaps between rows.
244
+ - **Groups.** Name groups by purpose, with 2 to 8 rows each. Collapse groups only in a list of more than about 40 rows. A collapsible group's label is a `<button aria-expanded>` in the label type, with `--radius-inline` corners and a chevron that turns −90° when the group is closed. Never collapse the group that holds the current row.
245
+ - **States.** Hover: `--color-row-hover` fill and `--color-text`. Current page (`aria-current="page"`): `--color-nav-current` fill, `--shadow-nav-current`, `--color-nav-current-text`, and medium weight; hover keeps that fill. `--color-nav-current` is an accent tint: `--color-accent` at 14% over `--color-surface-raised` in light, and `--color-accent` at 20% over transparent in dark. `--color-nav-current-text` is the first of `--color-accent`, `--color-text`, black, and white that reaches 4.5:1 over the tinted fill, both on the page and on a surface (composite a translucent fill over each first). Selected tabs and selected list rows use the same fill and rule. Current location in the page (`aria-current="location"`): `--color-text` in medium weight, with a 3×14 `--color-accent` pip at the leading edge, inset 4px, and no fill, in strips and contents lists. In a [section rail](#section-rail) the current section takes the current-page look instead and keeps `aria-current="location"`. A link carries one marker, and page outranks location; the [`aria-current` rules](DESIGN.md#navigation) say which applies, and the [tracking rule](DESIGN.md#navigation) says which section is current. Focus-visible: the focus ring, inset because the rail and the drawer scroll.
246
+ - **Phone triggers.** Two triggers open a navigation drawer, and each has its place. The site shell uses the header's icon-only Menu button: at tablet width its [section rail](#section-rail) moves into that drawer. A page-level contents drawer, such as a docs page's "On this page", keeps a labelled trigger: a secondary button at `--control-lg` with a three-line menu glyph (14×10, 1.5px lines) before the label. A page with the site shell's Menu does not add a second, labelled trigger. Without JavaScript the list opens in place, so the trigger is a `<details>` summary with the secondary button classes and a chevron after the label. Only the chevron is local.
247
+ - **Horizontal strip.** A row of 6 links or fewer; beyond that, use a drawer. It uses these rows and states unchanged: the current page takes the lifted fill, and a location keeps its pip. It scrolls sideways with 2px padding, so the current row's shadow stays whole, and a clipped edge fades over 24px, as [tabs](#tabs) do.
237
248
  - **Keyboard and screen reader.** Plain links in Tab order.
238
249
  - **Motion.** Fill, colour, and shadow change over `--duration-fast` with `--ease-out`.
239
- - **Forced colors.** Fills and shadows drop. Only the current page (`aria-current="page"`) takes a 2px `Highlight` border on its leading edge. The location pip keeps its shape with `forced-color-adjust: none` and a `Highlight` fill, so page and location still differ.
250
+ - **Forced colors.** Fills and shadows drop. The current page (`aria-current="page"`), and a rail's current section, take a 2px `Highlight` border on the leading edge. The location pip keeps its shape with `forced-color-adjust: none` and a `Highlight` fill, so page and location still differ.
240
251
  - **List selection.** A selected row in a list or table (`aria-selected="true"`) takes the current-page recipe: `--color-nav-current` fill, `--shadow-nav-current`, medium weight, and its primary text in `--color-nav-current-text`, with no accent bar. Hover keeps that fill. Rows keep their own radius. Dividers between rows are straight 1px `--color-border-subtle` lines inset by the row's inline padding, drawn on the row, not as a shadow, and hidden next to a filled (hovered or selected) row. Forced colors: the fill and shadow drop, and the selected row takes a 2px `Highlight` border on its leading edge, as the current page does.
241
252
 
253
+ ## Section rail
254
+
255
+ Layer: Core. ui: `UiSiteNav`.
256
+
257
+ - **Use.** A long page or a small site whose readers jump between sections. Its rows follow the page order. Choose it by the [navigation levels](DESIGN.md#navigation).
258
+ - **Anatomy.** A named `<aside>`, so the find field and the footer sit in a landmark, with `position: sticky; top: 0`, `height: 100dvh`, and a column flex layout with `--space-3` gaps. An optional [find field](#find-field) sits at the top. Below it, a named `<nav>` holds grouped [navigation list](#navigation-list) rows and scrolls on its own (`overflow-y: auto`, `overscroll-behavior: contain`). An optional footer for rail settings, such as the single-key shortcut switch, sits last, above a `--color-border-subtle` rule. The element that draws a divider never scrolls.
259
+ - **States.** Rows take the navigation list states. The current section keeps `aria-current="location"` but takes the current-page look: `--color-nav-current` fill, `--shadow-nav-current`, and `--color-nav-current-text` in medium weight, with no pip. When the location changes, the rail scrolls its own list, never the page, to centre the current row if it is out of view. It leaves the list alone while the pointer is over the rail or focus is inside it.
260
+ - **Tablet and phone.** At `max-width: 800px`, with JavaScript, the page header becomes one sticky row on `--color-bg`: the site name or a back link, then two icon-only secondary buttons at `--control-lg`, Find (a search icon) and Menu (a menu icon). Menu opens a [drawer](#drawer) titled "Menu" that holds, in order, the find field, the site's pages, the appearance control, and the rail's groups. Find opens the same drawer with the field focused. Both buttons set a negative `scroll-margin-top` equal to the page's scroll offset, so focusing one does not scroll the page. Without JavaScript nothing moves: the header keeps its links, and the rail stays in place above `main` with every row shown and the find field hidden.
261
+ - **Keyboard and screen reader.** Both buttons have `aria-haspopup="dialog"` and an `aria-label` ("Find a component", "Menu"). Location changes are not announced. The current section follows the [location tracking rule](DESIGN.md#navigation).
262
+ - **Motion.** The rail scrolls its list at once. Rows change as in the navigation list.
263
+ - **Forced colors.** The current section's fill and shadow drop, and it takes a 2px `Highlight` border on its leading edge, as the current page does.
264
+
265
+ ## Find field
266
+
267
+ Layer: Core. ui: none yet.
268
+
269
+ - **Use.** Filter a long navigation list, such as a section rail, by name or purpose. It filters the list only, never the page, so deep links and the page order stay stable.
270
+ - **Anatomy.** An `<input type="search">` in the [field](#text-input-and-textarea) recipe, with a leading 16px search icon in `--color-muted` (32px start padding) and a trailing [keyboard key](#keyboard-key) hint showing `/` (36px end padding). A visually hidden `role="status"` element, named in the field's `aria-describedby`, holds the match count.
271
+ - **States.** Rest, focus-visible (field focus), and a query. The key hint hides while the field has focus or a value, when shortcuts are off, and under `(hover: none)`. With no matches, the list shows "No component matches <q>…</q>." in `--text-sm` `--color-muted`, and a text-button Clear.
272
+ - **Matching.** Every word of the query must appear in a row's terms: its name, group, purpose, and aliases, held in `data-terms`. Rows that do not match hide, and so do groups with no visible rows. The count is announced after a 500ms pause ("3 matches", "No matches"). A page whose Find also filters its own content, such as a token table, decides which rows stay and announces its own count and noun ("3 tokens", "No tokens").
273
+ - **Keyboard and screen reader.** `/` focuses the field and selects its text, under the [single-key shortcut](DESIGN.md#navigation) rules; the field carries `aria-keyshortcuts="/"` while shortcuts are on. Escape clears a value; the next Escape leaves the field, or closes the drawer. Enter goes to the first match and focuses the destination. ArrowDown moves focus to the first match.
274
+ - **No JavaScript.** The field is `hidden` until the script runs.
275
+
276
+ ## Breadcrumbs
277
+
278
+ Layer: Core. ui: none yet.
279
+
280
+ - **Use.** Only at depth 3 or more, or for a page outside its site's shell. Do not repeat the page `h1` as the only crumb.
281
+ - **Anatomy.** `<nav aria-label="Breadcrumb">` holding an `<ol>` in `--text-sm`. Separators are a `--color-muted` `/` drawn with `content: "/" / ""`, so they are not read. The crumbs, separators included, centre on the cap height like navigation rows, so they line up with the header strip. Ancestors are `--color-muted` links with no underline, at least `--control-sm` tall (`--control-lg` at tablet width), with `--radius-inline` corners. The current page is plain text with `aria-current="page"`, in `--color-text` and medium weight. On folio sites the trail is mono (identity).
282
+ - **States.** Hover: `--color-text` and an underline. Focus-visible: the focus ring.
283
+ - **Phone.** At `max-width: 640px` only the parent shows, as a back link: "‹ Parent".
284
+ - **Forced colors.** No change: links and text take the system colours.
285
+
286
+ ## Pager
287
+
288
+ Layer: Core. ui: none yet.
289
+
290
+ - **Use.** Previous and next pages in a sequence, such as the design-language pages or skill pages within a group. It sits at the end of `main`. A page with a section rail has one pager, not one per section.
291
+ - **Anatomy.** `<nav aria-label="…">` with two equal columns and a `--space-4` gap, below a `--color-border-subtle` rule with `--space-6` padding. Each link is a block row with `--space-3` `--space-4` padding, `--radius-field` corners, and a transparent 1px border: a `--text-xs` `--color-muted` direction with an arrow ("Previous", "Next"), then a medium `--color-text` title. Links take `rel="prev"` and `rel="next"`. Next sits in the end column, end-aligned, even when it is alone.
292
+ - **States.** Hover: `--color-row-hover` fill. Focus-visible: the focus ring. There is no current state.
293
+ - **Phone.** At `max-width: 640px`, one column in source order.
294
+ - **Keyboard and screen reader.** The direction and the title are both inside the link, so it reads as one name, such as "Next Application example".
295
+ - **Motion.** The fill changes over `--duration-fast` with `--ease-out`.
296
+
297
+ ## Tabs
298
+
299
+ Layer: Core. ui: `UiTabs`.
300
+
301
+ - **Use.** Panels about one object, when no URL changes. Never mix tabs that change the URL with tabs that switch panels in one set, and never give links `role="tab"`: a set of pages takes a [navigation strip](#navigation-list) instead.
302
+ - **Anatomy.** A `role="tablist"` with no rule below it and a 12px gap below it. It scrolls sideways when needed, and a 24px mask fades each clipped edge. Scrolling clips on every side, so the list has 4px (`--space-1`) padding all round: it keeps the selected tab's shadow whole and its fill off the frame edge. Each tab is a borderless button at least `--control-md` tall (`--control-lg` on phones), with `--space-2` `--space-3` padding, `--radius-inline` corners, medium weight, and `--color-muted`. The selected tab's fill is a `::before` layer behind the label, inset 0, with the tab's corners; the list sets `isolation: isolate`, so the layer stays inside it.
303
+ - **States.** Hover fills `--color-row-hover` and turns the text `--color-text`. The selected tab takes the [navigation row](#navigation-list)'s current-page recipe: `--color-nav-current` fill and `--shadow-nav-current`, with no underline. Its text is `--color-nav-current-text`: the first of `--color-accent`, `--color-text`, black, and white that reaches 4.5:1 over the tinted fill, both on the page and on a surface (composite a translucent fill over each first). Focus-visible is the focus ring, inset because the list scrolls.
304
+ - **Motion.** Hover fades over `--duration-fast` with `--ease-out`. When the reader changes the tab, the fill glides from the old tab to the new one as the [segmented control](#segmented-control)'s thumb does: start the new fill's left and right edges where the old fill was, then animate each edge home with the `glide-left` and `glide-right` keyframes and CSS `ease`, the leading edge over 260ms and the trailing edge over 300ms. Labels cross-fade their colour over 260ms. An interrupted glide starts from the fill's current position. There is no glide on first render or under reduced motion, where the fill moves at once.
305
+ - **Keyboard and screen reader.** Roving `tabindex`: arrow keys move between tabs, Home and End go to the ends, and focus selects the tab. Each tab has `aria-controls` and `aria-selected`; each panel has `role="tabpanel"`. Without JavaScript, show every panel under its own heading. Apply the tab roles and hide the headings and unselected panels only when the script enhances the markup.
306
+ - **Forced colors.** The fill layer is removed (`content: none`), so the selected tab takes a 2px `Highlight` border, and its padding shrinks by 2px to keep its size.
307
+
308
+ ## Skip link
309
+
310
+ Layer: Core. ui: the `fg-site-skip` class.
311
+
312
+ - **Anatomy.** The first focusable element on the page, linking to `main` (`id="main"`) and named "Skip to content". It sits above the page until it takes focus, then shows at the top left as a floating layer: `--color-surface-raised`, a transparent 1px border, `--radius-field`, `--shadow-dialog`, `--space-2` `--space-3` padding, and the focus ring.
313
+ - **Second link.** When a [section rail](#section-rail) comes before `main` and holds more than about 20 rows, a second link, "Skip to contents", follows the first and moves focus to the rail's list. It is hidden at tablet width, where the rail sits in the drawer.
314
+ - **Keyboard and screen reader.** Activating a skip link moves focus to its target, which takes `tabindex="-1"` at that moment.
315
+
316
+ ## Keyboard key
317
+
318
+ Layer: Core. ui: none yet.
319
+
320
+ - **Use.** A key or shortcut in running text or shortcut docs, and the [find field](#find-field)'s hint. The hint is `aria-hidden`, because the field carries `aria-keyshortcuts`.
321
+ - **Anatomy.** A `<kbd>`: `--font-mono` `--text-xs` medium in `--color-muted`, on a `--color-surface` fill with a 1px `--color-border` edge and `--radius-inline` corners, 20px tall, at least 20px wide, with 5px inline padding and no shadow.
322
+ - **Forced colors.** The edge is `CanvasText`.
323
+
242
324
  ## Code block
243
325
 
244
326
  Layer: Core. ui: `UiCodeBlock`.
@@ -283,8 +365,8 @@ Layer: Identity. ui: `UiCapture`.
283
365
 
284
366
  Layer: Identity. ui: `UiSiteHeader`, `UiSiteAppearancePicker`.
285
367
 
286
- - **Anatomy.** A static header at least 64px tall on `--color-bg` with a solid 1px `--color-text` rule below it. At the start is the project switcher: a `<details>` whose summary, a [quiet action](#quiet-action), shows the mono, semibold project name after a `~/` mark in `--color-project` (drawn by CSS, so it is not read), then a chevron. Its menu is a floating layer, with the dialog's tokens, listing the shared project registry in the order it defines, as navigation rows, with the current project marked `aria-current="page"`. At the end are the site links (`--color-muted`, at least 44px tall, `--color-text` on hover) and the appearance picker: an icon-only segmented control at `lg`.
287
- - **Phone.** With three or more links, the links take a second row.
368
+ - **Anatomy.** A static header at least 64px tall on `--color-bg` with a solid 1px `--color-text` rule below it. At the start is the project switcher: a `<details>` whose summary, a [quiet action](#quiet-action), shows the mono, semibold project name after a `~/` mark in `--color-project` (drawn by CSS, so it is not read), then a chevron. Its menu is a floating layer, with the dialog's tokens, listing the shared project registry in the order it defines, as navigation rows, with the current project marked `aria-current="page"`. At the end are the site links and the appearance picker: an icon-only segmented control at `lg`. The site links are a [navigation strip](#navigation-list) of rows 44px tall (`--control-lg`). A link to a page inside the site takes `aria-current="page"` on that page, with the current-page recipe.
369
+ - **Phone.** The first row holds the identity and the picker. With three or more links, the links take a second row. A long identity becomes a [breadcrumb](#breadcrumbs) back link.
288
370
  - **Keyboard and screen reader.** The summary is named "Project: <name>". Escape closes the menu and returns focus to the summary; moving focus out of it closes it. The chevron turns 180° while the menu is open, over `--duration-fast` with `--ease-out`.
289
371
 
290
372
  ## Page type and helpers
@@ -294,7 +376,6 @@ Layer: Identity. ui: `site.css` helpers.
294
376
  - **Headings.** Documentation, CLI tool, article, and product page titles (`--text-3xl`) use `--font-mono`; application titles use `--font-ui` at `--text-2xl` or smaller. On documentation, CLI tool, article, and product pages, a page-level section heading (h2) uses `--font-mono` at `--text-xl` (a product page may set it larger, up to `--text-3xl`), starts with a `## ` mark in `--color-accent`, drawn with `content: "## " / ""`, and has a `--color-border-subtle` rule above the section. Application and inline-visualization section headings use `--font-ui`, semibold, at `--text-xl` or smaller, with no mark and no rule; h3 and lower never take the mark. A product page or tool home may use a mono `--text-display` title (`--text-display-sm` on phones).
295
377
  - **Steps.** An ordered list in which each step hangs from a mono number in `--color-accent` on a ruled leading column, with an h3 title per step.
296
378
  - **Definitions.** A definition list of terms and short meanings: medium-weight terms and muted meanings in two columns, one column on phones. Flags such as `--all` do not break.
297
- - **Skip link.** The first focusable element, hidden above the page until it takes focus, then shown as a floating layer with the base focus ring.
298
379
  - **Facts.** A mono definition list of short labels and values, such as a repository path. Values wrap anywhere.
299
380
  - **Command list.** A table of commands (mono) and descriptions (muted), with a Copy [quiet action](#quiet-action) for each row. On phones each row becomes a two-column grid.
300
381
  - **Footer.** Mono, with an attribution link at the start and project links at the end.
@@ -14,16 +14,30 @@ Each entry records a choice this language made, the options it rejected, and why
14
14
  | One source per control | Core | Each control comes from the owning library's component or class, including a link styled as a button. | Local copies built from the same tokens drifted: a docs button had no raise and only faded when pressed. |
15
15
  | Section mark | Identity | The `##` mark goes only on the page-level section headings (h2) of documentation, CLI tool, article, and product pages, which are mono with a `--color-border-subtle` rule above. Application and inline-visualization section headings are plain `--font-ui` semibold at `--text-xl` or smaller, with no mark and no rule. h3 and lower never take it. | The mark on every section heading: on a dense screen, such as a metrics dashboard with six sections, it repeated down the page and competed with the data. The mark on h2 and h3: deeper levels repeat more often. A per-page opt-out class: every application page would need to remember it. Dropping the mark: reading pages lose the folio identity that ties them to the `~/name` header. Mono application section headings without the mark: the mono face alone still reads as a document heading among compact sans rows. |
16
16
  | Command plate | Identity | A dark plate tinted with the project hue (`--color-command-bg`). Terminal captures keep the neutral plate. | The near-black plate looked too severe. |
17
- | Navigation current row | Core | A quiet lifted fill (`--color-nav-current`, `--shadow-nav-current`) with 10px corners and accent text. In-page location is a 3×14 accent pip with no fill. In forced colors only the current page takes a `Highlight` edge, and the pip redraws in `Highlight`. | A raised pill looked odd. The old 2px inset bar curved away on rounded rows and disappeared in the dark drawer. |
17
+ | Navigation current row | Core | A quiet lifted fill (`--color-nav-current`, `--shadow-nav-current`) with 6px corners (`--radius-inline`) and accent text. In-page location is a 3×14 accent pip with no fill in strips and contents lists; a section rail's current section takes the current-page fill instead (see Rail current section). In forced colors the current page and a rail's current section take a `Highlight` edge, and the pip redraws in `Highlight`. | A raised pill looked odd. The old 2px inset bar curved away on rounded rows and disappeared in the dark drawer. |
18
18
  | Fields | Core | 10px rounded rectangles (`--radius-field`) with a 1px `--color-border-subtle` edge (`--color-field-edge`) in both themes. Light fields take a `--color-surface-raised` fill and no shadow (`--color-field-bg`, `--shadow-field`). Dark fields stay in the sunk `--color-well` well with `--shadow-sink`; the well is about 1.01:1 against the canvas, so the edge carries the shape. A disabled field takes the `--color-well` well and no shadow. `--color-well` itself still fills tracks, pressed buttons, and selected radio cards. | Pill fields, the earlier shape. A grey sunk well with a transparent edge in light: the user said it looked disabled. Without the edge, dark fields disappeared. |
19
19
  | Switch | Core | Borderless track, 44×22 with an 18px knob. The off state shows through the track fill. | A visible track border, which was not needed. |
20
20
  | Segmented control | Core | One thumb glides between options: the leading edge takes 260ms and the trailing edge 300ms, with CSS `ease`, so the thumb stretches a little on the way. This was matched frame by frame to a reference. There is no motion on load, on a restored value, or on a theme change. Reduced motion makes the change instant. | The earlier 180ms ease-out looked like a jump. |
21
21
  | Segmented label | Core | The selected label reads at 4.5:1 on its thumb, and an icon at 3:1 (`--color-segmented-current-text`): `--color-accent`, or the first of `--color-text`, black, and white that reads. | Accent at 3:1 for labels too, which let some hues' text fall below 4.5:1. |
22
- | Phone drawer trigger | Core | A soft secondary button with a three-line menu glyph. The no-JavaScript fallback keeps a chevron, because it opens in place. | A down chevron promised a dropdown, but the trigger opens a side drawer. |
22
+ | Phone drawer trigger | Core | A page-level contents drawer opens from a soft secondary button with a three-line menu glyph and a label. The no-JavaScript fallback keeps a chevron, because it opens in place. The site shell opens its drawer from the header's icon-only Menu button instead (see Phone header). | A down chevron promised a dropdown, but the trigger opens a side drawer. |
23
+ | Navigation row corners | Core | Navigation rows, header and strip rows, list-selection rows, collapsible group labels, and tabs take 6px corners (`--radius-inline`). The owner chose the more rectangular rows from the Gate M mockup (2026-11-09). | 10px (`--radius-field`), the previous corners, shared with fields. |
24
+ | Optical label centring | Core | A text-only navigation row and the breadcrumb centre their label on the cap height with `text-box: trim-both cap alphabetic`, inside `@supports`; a row becomes a block with `align-content: center` for it, and `--space-2` block padding keeps a wrapped label clear of its fill's edges. Browsers without `text-box` keep the flex centring of the line box. Buttons, tabs, and segmented options already centre their ink within 0.5px, so they are unchanged; Chromium does not trim a button's label in any case. | Centring the line box alone: it keeps descender room, so a label without descenders, such as "Overview", sat 1.25px above centre in the 44px header row (15.75px above the ink, 18.25px below). `text-box` on the flex row itself: Chromium trims only block containers, and the label's anonymous flex item does not inherit the trim. A fixed nudge in em: it depends on the font's metrics, which an identity can change. |
25
+ | Rail current section | Core | In a section rail the current section takes the current-page look: `--color-nav-current` fill, `--shadow-nav-current`, and `--color-nav-current-text`, with no pip. It keeps `aria-current="location"`. Strips and contents lists keep the pip. In forced colors it takes the current page's 2px `Highlight` leading border. The owner chose it at Gate M, so the rail's place reads like the live site's current page. | The pip in the rail too, as in strips and contents lists: the owner preferred the rail to match the site's current-page look. |
26
+ | Tab glide | Core | The selected tab's fill is a `::before` layer that glides between tabs like the segmented thumb: `glide-left` and `glide-right`, 260ms leading and 300ms trailing, with CSS `ease`. No glide on first render or under reduced motion, and no layer in forced colors. The owner chose it at Gate M. | The fill jumping from tab to tab, unlike the segmented control beside it. |
27
+ | Segmented touch size | Core | At tablet width an unsized segmented control sets `--item` to `--control-lg`. | Growing only the buttons' `min-height`: `--item` stayed at `--control-md`, so icon-only options were 36×44 ovals (found at Gate M). |
28
+ | Phone header | Core | Option A: at tablet width, with JavaScript, the header is one sticky row with the site name or a back link, then Find and Menu icon buttons. The Menu drawer holds Find, the pages, the appearance control, and the page's sections. The buttons cancel the scroll offset with a negative `scroll-margin-top`, so focusing one does not scroll the page. Without JavaScript nothing moves. The owner chose it at Gate M. | The proposal's first design, a second sticky bar under the header with a "<Label>: <current row>" trigger and a Find button: the owner chose the single row instead. |
29
+ | Drawer instead of a long strip | Core | A horizontal strip holds 6 links or fewer; a longer list moves into the drawer at tablet width. | The catalogue's 26-link strip on phones: most links sat off screen, and the page broke its own drawer spec. |
30
+ | Purpose groups | Core | The catalogue and `components.md` group components by purpose (Actions, Selection, Inputs, Feedback and status, Containers and overlays, Navigation, Code and examples, then Identity). Each section keeps its Core or Identity badge, and the heading ids stay unchanged, so old deep links still work. | Core, then Identity, in build order: a reader had to know a component's layer to find it. Splitting the catalogue into pages: agents copy from and grep one file, and the hosts serve a fixed list of files. |
31
+ | Find and its shortcut | Core | A find field filters the rail; `/` focuses it. A saved switch in the rail footer turns single-key shortcuts off (WCAG 2.1.4), and the shortcut is ignored in editable elements and while a modal dialog is open. | No shortcut: Find is a long Tab away. A shortcut with no off switch: it fails WCAG 2.1.4 for speech and switch users. |
32
+ | No command palette | Core | Find, which filters the rail, and no command palette. Revisit when a site has more than one searchable index. | A command palette: Find already covers a single-page catalogue and a site of about 25 skills. |
33
+ | One pager per page | Core | One pager at the end of `main`, for the sequence of pages. | A pager per component: on one page with a sticky rail it adds 26 repeated blocks. |
34
+ | Header current page | Core | Header links are navigation rows 44px tall, and a link to the current page takes `aria-current="page"` with the current-page recipe. | Muted text links with no current state: the header did not show which page the reader was on. |
35
+ | One scroll offset | Core | `html { scroll-padding-top }` is the only offset: any sticky bar plus `--space-4`. The location tracker reads the same value. | `scroll-margin-top` on each section: every page set its own value, and the tracker needs one inset to compare against. |
36
+ | Specimen captions | Core | Every catalogue specimen has a caption that names its state, such as "Disabled" or "Rest, live". The owner chose it at Gate M. | Captions only on some specimens: a disabled or static specimen with no caption could read as broken. |
23
37
  | Focus ring | Core | One accent ring for every role but fields: `outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset)` (2px, 3px), with no glow, over the control's own shadow. Variants recolour it with `outline-color` only. `--color-focus` is `--color-accent`: 6.26:1 on the page, 5.72:1 on a surface, and 6.61:1 on a raised surface in light; 8.31:1, 7.85:1, and 7.39:1 in dark. Dark plates use `--color-project-dark`: 6.98:1 on the command plate on a light page, 7.48:1 on a dark page, and 8.53:1 on the terminal capture. Inspired by Astryx `focusDefaults` (`utils/focusOutline.stylex.ts`), which writes the width, accent colour, and offset once from tokens. The user chose it from rendered demos and accepted an accent ring around primary, danger, and selected controls. | The neutral ink ring (`--color-focus: var(--color-text)`, offset 2px), the previous choice; the user preferred the accent ring with a 3px gap in rendered demos. Before that, an accent ring on controls and a `--color-link` ring on links, tabs, and navigation rows: two ring hues, cyan around the purple selected tab and current row. A ring in each control's own tone, such as `--color-error` around the danger button: every role needs its own ring rule, and the ring changes colour from control to control. A 2px ring with a 6px accent halo felt jarring, and a 1.5px ring was hard to see; Chromium drew it 1px at 1x. |
24
38
  | Page colours outside the base layer | Core | `tokens.css` sets the body background and text colour unlayered; the rest of the base stays in `@layer base`, so component rules still outrank it. | Everything in the layer: a host that wraps the page in its own unlayered reset, such as an artifact viewer, kept its light body while the tokens switched to dark, so token-coloured text sat near-white on white. A note telling each page to restate the body: every delivered page would need to remember it, and the failure only shows in dark mode. |
25
39
  | Field focus | Core | No ring. The 1px edge turns `--color-accent` with a 2px inset line of the accent at 18% (`--shadow-field-focus`; `--shadow-field-focus-invalid` for an invalid field), and the fill does not change in either theme. An invalid field keeps `--color-error` for the edge and the line. Forced colors drop the line, so a focused field there draws a `Highlight` outline 1px inside its edge. Inspired by Astryx `Field/inputStyles.stylex.ts`: a full accent border with an inset muted-accent line, and `Highlight` in forced colors. The user approved it from rendered demos. | The control ring plus a lift out of the well onto the control surface (`--field-focus`, `--color-control-thumb`, `--shadow-raise`), the previous choice, replaced by the edge the user chose from rendered demos. Before that, the lift with a 35% accent edge and no ring, which measured below 3:1 in light, and an accent edge with a halo and an underline, which felt too heavy. |
26
- | Selected tab | Core | The navigation row's lifted fill (`--color-nav-current`, `--shadow-nav-current`, accent text, 10px corners), with no underline. Navigation and tabs share one selected state. | A 2px accent underline curved at rounded corners and did not match navigation. |
40
+ | Selected tab | Core | The navigation row's lifted fill (`--color-nav-current`, `--shadow-nav-current`, accent text, 6px corners), with no underline. Navigation and tabs share one selected state. | A 2px accent underline curved at rounded corners and did not match navigation. |
27
41
  | Selected text | Core | The first of accent, body text, black, and white that reaches 4.5:1 over the rendered current-row fill, on the page and on a surface (`--color-nav-current-text`). | Accent text everywhere: the accent is validated only at 3:1, so some hues miss 4.5:1 as text on the fill. |
28
42
  | Selected tint | Core | The current row, selected tabs, and selected list rows take an accent tint: `--color-accent` at 14% over `--color-surface-raised` in light, at 20% over transparent in dark, and the capture's terminal accent at 20%. With the default hue, accent text measures 5.34:1 in light, and in dark 5.87:1 on `--color-bg`, 5.42:1 on `--color-surface`, and 5.05:1 on `--color-surface-raised`. The filip-stack site hue measures 4.94:1 in light and at least 5.06:1 in dark. A hue that misses 4.5:1 takes another `--color-nav-current-text`. | The plain white fill vanished on near-white panels, such as the light phone drawer. An 8% light tint (14% in dark): the light fill measured 1.07:1 against the page and read as nearly invisible. |
29
43
  | Toggle card | Core | A 10px card (`--radius-field`). It is the named exception to borderless raised controls: a visible `--color-border-subtle` edge and no rest raise. Pressed, it takes an 8% accent tint over `--color-surface-raised` and a 35% accent hairline, and the switch carries the on state. Pressed text measures 15.99:1 in light and 12.15:1 in dark; muted text 6.28:1 and 5.79:1. | A pill with a solid accent border looked heavy, and wrapped labels sat badly in pill corners. |
@@ -113,6 +127,10 @@ Prose patterns moved with the names: `--*-soft` is now `--color-*-surface`, and
113
127
  | `--field-shadow-focus-invalid` | `--shadow-field-focus-invalid` |
114
128
  <!-- rename-table:end -->
115
129
 
130
+ ## Open questions
131
+
132
+ - Rows inside a floating menu, such as the project menu: concentric with the 12px menu (the panel radius minus `--space-1`, 8px) or 6px like other navigation rows. They are 6px for now, the Gate M choice for navigation rows; a later change settles it.
133
+
116
134
  ## Known gaps
117
135
 
118
136
  - Field focus is a 1px `--color-accent` edge with a faint 2px inset line. The edge reaches 3:1 for a focus indicator (WCAG 1.4.11): 6.61:1 against the light field fill and 6.26:1 against `--color-bg`, and 8.43:1 and 8.31:1 in dark. It is thinner than the 2px perimeter that the WCAG 2.2 AAA focus appearance criterion (2.4.13) asks for; the inset line, at 18% of the accent, does not reach 3:1 on its own.
@@ -14,14 +14,18 @@
14
14
  .layout { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); gap: var(--space-8); }
15
15
  .sidebar { position: sticky; top: var(--space-6); align-self: start; display: grid; gap: var(--space-1); padding-block: var(--space-6); }
16
16
  /* Navigation rows: components.html#navigation-list, unchanged. Only the rail's placement and spacing are local. */
17
- .navlist a { position: relative; display: flex; align-items: center; min-height: var(--row); padding-inline: var(--space-3); border-radius: var(--radius-field); color: var(--color-muted); font-size: var(--text-sm); text-decoration: none; transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out); }
17
+ .navlist a { position: relative; display: flex; align-items: center; min-height: var(--row); padding-inline: var(--space-3); border-radius: var(--radius-inline); color: var(--color-muted); font-size: var(--text-sm); text-decoration: none; transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out); }
18
18
  .navlist a:is(:hover, .is-hover) { background: var(--color-row-hover); color: var(--color-text); text-decoration: none; }
19
19
  .navlist a[aria-current="page"] { background: var(--color-nav-current); box-shadow: var(--shadow-nav-current); color: var(--color-nav-current-text); font-weight: var(--weight-medium); }
20
20
  .navlist a[aria-current="location"] { color: var(--color-text); font-weight: var(--weight-medium); }
21
21
  .navlist a[aria-current="location"]::before { content: ""; position: absolute; inset-inline-start: var(--space-1); width: 3px; height: 14px; border-radius: var(--radius-pill); background: var(--color-accent); }
22
- /* Fills and shadows drop. The current page takes a system border; the in-page location keeps
23
- its pip, redrawn in the system highlight, so the two still differ. */
24
- @media (forced-colors: active) { .navlist a[aria-current="page"] { border-inline-start: 2px solid Highlight; } .navlist a[aria-current="location"]::before { forced-color-adjust: none; background: Highlight; } }
22
+ @supports (text-box: trim-both cap alphabetic) { .navlist a:not(:has(> *)) { display: block; align-content: center; padding-block: var(--space-2); text-box: trim-both cap alphabetic; } .navlist a:not(:has(> *))[aria-current="location"]::before { inset-block: 0; margin-block: auto; } }
23
+ /* The sidebar is a section rail: components.html#section-rail, unchanged. Its current section takes the current-page look, with no pip. */
24
+ :is(.rail, .rail-specimen) a[aria-current="location"] { background: var(--color-nav-current); box-shadow: var(--shadow-nav-current); color: var(--color-nav-current-text); }
25
+ :is(.rail, .rail-specimen) a[aria-current="location"]::before { content: none; }
26
+ /* Fills and shadows drop. The current page and the rail's current section take a system border; a
27
+ location outside a rail keeps its pip, redrawn in the system highlight. */
28
+ @media (forced-colors: active) { .navlist a[aria-current="page"] { border-inline-start: 2px solid Highlight; } .navlist a[aria-current="location"]::before { forced-color-adjust: none; background: Highlight; } :is(.rail, .rail-specimen) a[aria-current="location"] { border-inline-start: 2px solid Highlight; } }
25
29
  main { min-width: 0; display: grid; gap: var(--space-12); padding-block: var(--space-8) var(--space-16); }
26
30
  section { display: grid; gap: var(--space-4); min-width: 0; }
27
31
  h1, h2 { font-family: var(--font-mono); }
@@ -56,7 +60,7 @@ footer { padding-block: var(--space-6); border-top: 1px solid var(--color-border
56
60
  <div class="frame">
57
61
  <header class="header"><a class="brand" href="docs.html">Documentation example</a><nav aria-label="Reference formats"><a href="reference.html">Application</a><a href="product.html">Product page</a></nav></header>
58
62
  <div class="layout">
59
- <nav class="sidebar navlist" aria-label="Documentation"><a href="#start">Getting started</a><a href="#structure">Structure</a><a href="#interaction">Interaction</a></nav>
63
+ <nav class="sidebar navlist rail" aria-label="Documentation"><a href="#start">Getting started</a><a href="#structure">Structure</a><a href="#interaction">Interaction</a></nav>
60
64
  <main>
61
65
  <section id="start"><h1>A smaller set of design decisions.</h1><p>Keep navigation, examples, and reference text in a balanced frame. The content stays left aligned and the first useful step is easy to find.</p><p class="meta">Illustrative setup command</p><div class="command"><pre><code id="command">npm install @example/ui</code></pre><button class="quiet-action" type="button" id="copy" aria-label="Copy installation command">Copy</button></div><p id="copy-status" role="status"></p></section>
62
66
  <section id="structure"><h2>Let the structure do the work</h2><p>Use readable prose and clear section boundaries. Examples can use the full article width without stretching every paragraph.</p><dl class="definitions"><dt>Frame</dt><dd>The navigation and article are centered together.</dd><dt>Measure</dt><dd>Running text has a comfortable reading width.</dd><dt>Evidence</dt><dd>Commands, examples, and caveats stay near the task.</dd></dl></section>
@@ -66,7 +70,7 @@ footer { padding-block: var(--space-6); border-top: 1px solid var(--color-border
66
70
  <footer>Design language reference. Content and package name are illustrative.</footer>
67
71
  </div>
68
72
  <script>
69
- // Marks the section the reader is in: the last section whose top has reached the top of the
73
+ // Location tracking (DESIGN.md#navigation). Marks the section the reader is in: the last section whose top has reached the top of the
70
74
  // viewport, or the last section once the page is scrolled to the end. After a jump (a link or a
71
75
  // deep link) the target stays current until the reader scrolls, because a short page cannot
72
76
  // scroll the target to the top. Without JavaScript the links still work; only the marker is missing.
@@ -0,0 +1,85 @@
1
+ {
2
+ "vue": {
3
+ "button": {
4
+ "component": "UiButton",
5
+ "url": "https://filipgutica.github.io/ui/#/components/button"
6
+ },
7
+ "checkbox-and-radio": {
8
+ "component": "UiCheckbox",
9
+ "url": "https://filipgutica.github.io/ui/#/components/checkbox"
10
+ },
11
+ "radio-card-group": {
12
+ "component": "UiRadioCardGroup",
13
+ "url": "https://filipgutica.github.io/ui/#/components/radio-card-group"
14
+ },
15
+ "switch": {
16
+ "component": "UiSwitch",
17
+ "url": "https://filipgutica.github.io/ui/#/components/switch"
18
+ },
19
+ "toggle-button": {
20
+ "component": "UiToggleButton",
21
+ "url": "https://filipgutica.github.io/ui/#/components/toggle-button"
22
+ },
23
+ "segmented-control": {
24
+ "component": "UiSegmentedControl",
25
+ "url": "https://filipgutica.github.io/ui/#/components/segmented-control"
26
+ },
27
+ "text-input-and-textarea": {
28
+ "component": "UiInput",
29
+ "url": "https://filipgutica.github.io/ui/#/components/input"
30
+ },
31
+ "select": {
32
+ "component": "UiSelect",
33
+ "url": "https://filipgutica.github.io/ui/#/components/select"
34
+ },
35
+ "field-wrapper": {
36
+ "component": "UiField",
37
+ "url": "https://filipgutica.github.io/ui/#/components/field"
38
+ },
39
+ "slider": {
40
+ "component": "UiSlider",
41
+ "url": "https://filipgutica.github.io/ui/#/components/slider"
42
+ },
43
+ "progress": {
44
+ "component": "UiProgress",
45
+ "url": "https://filipgutica.github.io/ui/#/components/progress"
46
+ },
47
+ "score": {
48
+ "component": "UiScore",
49
+ "url": "https://filipgutica.github.io/ui/#/components/score"
50
+ },
51
+ "tabs": {
52
+ "component": "UiTabs",
53
+ "url": "https://filipgutica.github.io/ui/#/components/tabs"
54
+ },
55
+ "badge": {
56
+ "component": "UiBadge",
57
+ "url": "https://filipgutica.github.io/ui/#/components/badge"
58
+ },
59
+ "alert": {
60
+ "component": "UiAlert",
61
+ "url": "https://filipgutica.github.io/ui/#/components/alert"
62
+ },
63
+ "surface-and-card": {
64
+ "component": "UiCard",
65
+ "url": "https://filipgutica.github.io/ui/#/components/card"
66
+ },
67
+ "figure": {
68
+ "component": "UiFigure",
69
+ "url": "https://filipgutica.github.io/ui/#/components/figure"
70
+ },
71
+ "dialog": {
72
+ "component": "UiDialog",
73
+ "url": "https://filipgutica.github.io/ui/#/components/dialog"
74
+ },
75
+ "drawer": {
76
+ "component": "UiDrawer",
77
+ "url": "https://filipgutica.github.io/ui/#/components/drawer"
78
+ },
79
+ "code-block": {
80
+ "component": "UiCodeBlock",
81
+ "url": "https://filipgutica.github.io/ui/#/components/code-block"
82
+ }
83
+ },
84
+ "react": {}
85
+ }