@filipgutica/design-system 1.0.0 → 1.0.2

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 (38) hide show
  1. package/README.md +30 -14
  2. package/dist/class/base.css +188 -0
  3. package/dist/class/themes/graphite-indigo.css +133 -0
  4. package/dist/themes/graphite-indigo.css +9 -0
  5. package/dist/tokens.d.ts +117 -0
  6. package/dist/tokens.js +222 -0
  7. package/dist/tokens.json +218 -0
  8. package/fonts/OFL-IBM-Plex-Mono.txt +93 -0
  9. package/fonts/OFL-IBM-Plex-Sans.txt +93 -0
  10. package/fonts/fonts.css +55 -0
  11. package/fonts/ibm-plex-mono-latin-400-normal.woff2 +0 -0
  12. package/fonts/ibm-plex-mono-latin-500-normal.woff2 +0 -0
  13. package/fonts/ibm-plex-mono-latin-600-normal.woff2 +0 -0
  14. package/fonts/ibm-plex-sans-latin-400-normal.woff2 +0 -0
  15. package/fonts/ibm-plex-sans-latin-500-normal.woff2 +0 -0
  16. package/fonts/ibm-plex-sans-latin-600-normal.woff2 +0 -0
  17. package/language/DESIGN.md +88 -33
  18. package/language/components.html +1059 -409
  19. package/language/components.md +291 -103
  20. package/language/decisions.md +133 -34
  21. package/language/docs.html +29 -25
  22. package/language/implementations.json +85 -0
  23. package/language/product.html +22 -22
  24. package/language/reference.html +238 -227
  25. package/language/tokens.css +142 -143
  26. package/language/visualizations/build-count-report.mjs +4 -2
  27. package/language/visualizations/report.css +2 -2
  28. package/package.json +37 -6
  29. package/scripts/build-tokens.mjs +0 -236
  30. package/tokens/graphite-indigo.json +0 -298
  31. /package/language/{themes → editor-themes}/graphite-indigo/LICENSE +0 -0
  32. /package/language/{themes → editor-themes}/graphite-indigo/README.md +0 -0
  33. /package/language/{themes → editor-themes}/graphite-indigo/SOURCE.json +0 -0
  34. /package/language/{themes → editor-themes}/graphite-indigo/THIRD_PARTY_NOTICES.md +0 -0
  35. /package/language/{themes → editor-themes}/graphite-indigo/graphite-indigo.t3-theme.json +0 -0
  36. /package/language/{themes → editor-themes}/graphite-indigo/package.json +0 -0
  37. /package/language/{themes → editor-themes}/graphite-indigo/themes/graphite-indigo-dark-color-theme.json +0 -0
  38. /package/language/{themes → editor-themes}/graphite-indigo/themes/graphite-indigo-light-color-theme.json +0 -0
@@ -0,0 +1,55 @@
1
+ /* IBM Plex, latin subset, from @fontsource/ibm-plex-{sans,mono} 5.3.0. OFL licences beside this file. */
2
+
3
+ @font-face {
4
+ font-family: 'IBM Plex Sans';
5
+ font-style: normal;
6
+ font-weight: 400;
7
+ font-display: swap;
8
+ src: url('./ibm-plex-sans-latin-400-normal.woff2') format('woff2');
9
+ unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
10
+ }
11
+
12
+ @font-face {
13
+ font-family: 'IBM Plex Sans';
14
+ font-style: normal;
15
+ font-weight: 500;
16
+ font-display: swap;
17
+ src: url('./ibm-plex-sans-latin-500-normal.woff2') format('woff2');
18
+ unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
19
+ }
20
+
21
+ @font-face {
22
+ font-family: 'IBM Plex Sans';
23
+ font-style: normal;
24
+ font-weight: 600;
25
+ font-display: swap;
26
+ src: url('./ibm-plex-sans-latin-600-normal.woff2') format('woff2');
27
+ unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
28
+ }
29
+
30
+ @font-face {
31
+ font-family: 'IBM Plex Mono';
32
+ font-style: normal;
33
+ font-weight: 400;
34
+ font-display: swap;
35
+ src: url('./ibm-plex-mono-latin-400-normal.woff2') format('woff2');
36
+ unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
37
+ }
38
+
39
+ @font-face {
40
+ font-family: 'IBM Plex Mono';
41
+ font-style: normal;
42
+ font-weight: 500;
43
+ font-display: swap;
44
+ src: url('./ibm-plex-mono-latin-500-normal.woff2') format('woff2');
45
+ unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
46
+ }
47
+
48
+ @font-face {
49
+ font-family: 'IBM Plex Mono';
50
+ font-style: normal;
51
+ font-weight: 600;
52
+ font-display: swap;
53
+ src: url('./ibm-plex-mono-latin-600-normal.woff2') format('woff2');
54
+ unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
55
+ }
@@ -19,7 +19,7 @@ The language has a reusable core and a replaceable identity layer.
19
19
  | Core | Tokens, depth, controls and their states, focus, motion, accessibility, and forced colors | Adopts it as is |
20
20
  | Identity | The terminal folio look of the personal sites: the `~/name` header, the project registry, mono display headings, `##` section marks, and terminal plates | Replaces it with its own |
21
21
 
22
- A new project keeps `tokens.css` unchanged and sets the identity inputs (`--project`, `--project-dark`, `--font-sans`, `--font-mono`, and `--accent-text` when the hue needs it) on `:root` in its own stylesheet. [Component specs](components.md) mark each component Core or Identity, and [decisions](decisions.md) record why each choice was made and which options were rejected. Read both before you build or change a component.
22
+ A new project keeps `tokens.css` unchanged and sets the identity inputs (`--color-project`, `--color-project-dark`, `--font-ui`, `--font-mono`, and `--color-accent-text` when the hue needs it) on `:root` in its own stylesheet. [Component specs](components.md) mark each component Core or Identity, and [decisions](decisions.md) record why each choice was made and which options were rejected. Read both before you build or change a component.
23
23
 
24
24
  ## Apply the right format
25
25
 
@@ -39,8 +39,8 @@ Center the **container**, not every sentence. Align header, content, images, and
39
39
 
40
40
  ## Files and examples
41
41
 
42
- - `tokens.css`: a standalone snapshot of the values (the Graphite Indigo theme) owned by `@filipgutica/ui`. The identity inputs sit in one block at the top. Each line's `ui:` comment names the library variable for that token. Update it when the package values change.
43
- - `components.md`: one spec for each component, with anatomy, tokens, states, keyboard and screen-reader behavior, motion, and forced colors. Read it for any component work.
42
+ - `tokens.css`: the values of the Graphite Indigo theme, generated from the token source (`tokens/graphite-indigo.json`) in `@filipgutica/design-system`. To change a value, edit the JSON there and run `pnpm tokens:build`; do not edit `tokens.css` by hand. The identity inputs sit in one block at the top. Each line's `ui:` comment lists the library variables that carry that value, the line's own name first.
43
+ - `components.md`: one spec for each component, with anatomy, states, Do and Don't lines, keyboard and screen-reader behavior, motion, and forced colors. Read it for any component work.
44
44
  - `components.html`: every component in each of its states, in plain HTML and CSS on `tokens.css`. Copy component markup and styles from there.
45
45
  - `decisions.md`: the choices behind the components, and the options they replaced.
46
46
  - `reference.html`: an application example, and a Foundations catalogue (`#foundations`) of every token: type, color with contrast, spacing, shape, borders, elevation, focus, and motion.
@@ -50,12 +50,12 @@ Center the **container**, not every sentence. Align header, content, images, and
50
50
 
51
51
  Personal sites import `@filipgutica/ui/themes/graphite-indigo.css` and the shared site helpers. The UI package owns the values and generation procedure.
52
52
 
53
- Token names depend on where the page runs. This file uses the `tokens.css` names.
53
+ Token names depend on where the page runs. This file uses the `tokens.css` names, which `@filipgutica/ui` shares.
54
54
 
55
55
  | Context | Variable names to write |
56
56
  | --- | --- |
57
57
  | Standalone HTML | The `tokens.css` names. Import or inline `tokens.css`, and copy component styles from `components.html`. |
58
- | Site on `@filipgutica/ui` | The library variable in the `ui:` comment beside each `tokens.css` line, such as `--color-muted` for `--text-muted`. Some names are unchanged, such as `--text-sm`. When a comment names several, use the first. A `tokens.css` name that its comment does not list is undefined on a library site, and `var()` falls back without an error. The library draws the base focus ring only inside `.fg-site-docs`; elsewhere, write it yourself, exactly `outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset)`. |
58
+ | Site on `@filipgutica/ui` | The `tokens.css` names, which the library declares. The exceptions are `--color-nav-current-text` and `--color-segmented-current-text`: the library does not declare them, so write them with the fallback their `ui:` comment shows. Without it, `var()` falls back without an error. The library draws the base focus ring only inside `.fg-site-docs`; elsewhere, write it yourself, exactly `outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset)`. |
59
59
  | Other repository | That repository's own tokens and components, matched to these roles by meaning. |
60
60
  | Inline visual | The host's supplied CSS variables and font, with no separate page shell. |
61
61
 
@@ -73,22 +73,22 @@ Controls use quiet depth and familiar shapes: borderless surfaces with one tight
73
73
 
74
74
  ### Typography
75
75
 
76
- - Use `--font-sans` for prose, h3 and below, labels, and controls, and `--font-mono` for code, identifiers, and keys. The identity layer decides where else mono appears.
76
+ - Use `--font-ui` for prose, h3 and below, labels, and controls, and `--font-mono` for code, identifiers, and keys. The identity layer decides where else mono appears.
77
77
  - Controls and dense application content use `--text-md`; secondary text uses `--text-sm`. Paragraphs and substantial article text use `--text-reading` with `--leading`. Bound reading text with `--measure` and introductory copy to a slightly shorter line.
78
- - Documentation titles use `--text-3xl`; section headings use `--text-xl` and sit above their content. Application titles use `--text-2xl` or smaller, and application section headings use `--font-sans` at `--text-xl` or smaller.
78
+ - Documentation titles use `--text-3xl`; section headings use `--text-xl` and sit above their content. Application titles use `--text-2xl` or smaller, and application section headings use `--font-ui` at `--text-xl` or smaller.
79
79
  - Use `--weight-regular`, `--weight-medium`, and `--weight-semibold`. Keep the source text's case; never transform it. Sentence case and restrained tracking make hierarchy easier to scan.
80
- - Use `--text-muted` for secondary information and metadata, and `--text` for essential labels and instructions.
80
+ - Use `--color-muted` for secondary information and metadata, and `--color-text` for essential labels and instructions.
81
81
 
82
82
  ### Theme and color
83
83
 
84
84
  - Inline visuals inherit the host theme. They do **not** need an independent theme switch.
85
85
  - Standalone pages follow the OS by default. A visible theme control is optional: include it when the user requests one, the product already has one, or choosing/comparing themes serves the task. Token inspection and UI-library documentation are valid uses; a simple chart or explainer usually is not.
86
86
  - Existing products retain their theme preferences and persistence contracts. Where a standalone choice is needed, System removes the override and explicit Light/Dark choices set it. Wrap storage access in try/catch.
87
- - Use neutral `--bg`, `--surface`, and `--surface-raised` (paper in light, graphite in dark) to separate regions. Use `--text` and `--text-muted` for the main hierarchy.
88
- - Each project sets one hue, and `--accent` follows it. The hue fills the one primary action in each decision group, and marks identity and selection: current items, the selected tab's text, and checked or selected controls. It is never a fill for secondary buttons, cards, or wells. Check it at 3:1 for marks and bars, and at 4.5:1 wherever it colours text, on every surface it sits on. `--accent-text` on an `--accent` fill must reach 4.5:1 for each hue; a hue that misses does not colour text or carry a label there.
89
- - `--link` identifies links; underline prose links. `--focus` is the accent (`--accent`) and outlines keyboard focus on every role but fields, which turn their edge the accent instead (see [focus](components.md#rules-for-every-control)). Where color marks a checked or selected state, use `--accent` as a fill, tint, or mark; `--link` never marks one, and a focus ring marks only focus, never selection.
90
- - Navigation and selection: the current page, the selected tab, and a selected list row take the same quiet lifted fill, tinted with the accent, with accent text where it reaches 4.5:1 on that fill (another readable colour otherwise), and no underline or bar; an in-page location takes a short accent pip without a fill. Keep raised-control hover and keyboard focus separate from these states. [Component specs](components.md#navigation-list) give the values.
91
- - Status colors mean state and have a text or icon label. Status surfaces are soft tints of their status color (the `--*-soft` tokens). Outside badges, the danger button label, and field error text, status foreground colors go on icons; numbers and labels beside them stay in `--text` or `--text-muted`. Keep restrained syntax colors separate from the action palette.
87
+ - Use neutral `--color-bg`, `--color-surface`, and `--color-surface-raised` (paper in light, graphite in dark) to separate regions. Use `--color-text` and `--color-muted` for the main hierarchy.
88
+ - Each project sets one hue, and `--color-accent` follows it. The hue fills the one primary action in each decision group, and marks identity and selection: current items, the selected tab's text, and checked or selected controls. It is never a fill for secondary buttons, cards, or wells. Check it at 3:1 for marks and bars, and at 4.5:1 wherever it colours text, on every surface it sits on. `--color-accent-text` on an `--color-accent` fill must reach 4.5:1 for each hue; a hue that misses does not colour text or carry a label there.
89
+ - `--color-link` identifies links; underline prose links. `--color-focus` is the accent (`--color-accent`) and outlines keyboard focus on every role but fields, which turn their edge the accent instead (see [focus](components.md#rules-for-every-control)). Where color marks a checked or selected state, use `--color-accent` as a fill, tint, or mark; `--color-link` never marks one, and a focus ring marks only focus, never selection.
90
+ - Navigation and selection: the current page, the selected tab, and a selected list row take the same quiet lifted fill, tinted with the accent, with accent text where it reaches 4.5:1 on that fill (another readable colour otherwise), and no underline or bar. An in-page location takes a short accent pip without a fill in strips and contents lists; in a section rail it takes the current page's fill instead. Keep raised-control hover and keyboard focus separate from these states. [Component specs](components.md#navigation-list) give the values.
91
+ - Status colors mean state and have a text or icon label. Status surfaces are soft tints of their status color (the `--color-*-surface` tokens). Outside badges, the danger button label, and field error text, status foreground colors go on icons; numbers and labels beside them stay in `--color-text` or `--color-muted`. Keep restrained syntax colors separate from the action palette.
92
92
  - Verify light and dark appearance where supported, regardless of whether a switch is visible. Check text contrast rather than assuming a muted token is accessible at every size.
93
93
 
94
94
  ### Layout and spacing
@@ -105,39 +105,52 @@ Controls use quiet depth and familiar shapes: borderless surfaces with one tight
105
105
  | Phone | `@media (max-width: 640px)` | Side gutters drop from `--space-6` to `--space-4`, and section gaps take their phone step. |
106
106
 
107
107
  Use `@media (min-width: 801px)` only for a rule that applies to desktop alone. One documented exception: the tool-home hero (`.fg-site-hero` in `@filipgutica/ui`) splits at `@media (min-width: 1024px)`, with the title across the top, the lede on the left, and the install block and facts on the right. Below 1024px it stacks in source order. `@filipgutica/ui` also ships 680px rules for its own site header, prose title and definitions (`max-width: 680px`, with `min-width: 681px` for frame padding); they belong to the library, so pages add no viewport breakpoint beyond the table and the hero split. A pane that must collapse at its own width uses a container query, as the detail column in `reference.html` does.
108
- - Navigation can become a drawer or a native scrolling section strip. A sticky side rail taller than the window scrolls its link list, not the element that draws its divider, so an overlay scrollbar sits clear of the line; `UiSiteNav` does this. Keep wide code, tables, and charts scrolling inside their containers.
108
+ - Density: an application screen has one size for each place, not a range. Toolbar controls (buttons, segmented filters, and search fields) are `sm`, `--control-sm` tall. Rows in a table or list, such as the console's monitor list, and rail and navigation rows, are `--row` tall. Other controls keep the default `md` (`--control-md`). At tablet width every touch target grows to `--control-lg`. The console in `reference.html` uses these sizes.
109
+ - [Navigation](#navigation) is a strip of 6 links or fewer, or a section rail that moves into a drawer at tablet width. A sticky side rail taller than the window scrolls its link list, not the element that draws its divider, so an overlay scrollbar sits clear of the line; `UiSiteNav` does this. Keep wide code, tables, and charts scrolling inside their containers.
109
110
  - Keep main headings, actions, and product evidence visible on load. Scrolling should reveal more content without being required to make existing content appear.
110
111
 
111
112
  ### Surfaces
112
113
 
113
- - Start with headings, content, and whitespace. Use a `--border-subtle` divider where it clarifies a boundary.
114
+ - Start with headings, content, and whitespace. Use a `--color-border-subtle` divider where it clarifies a boundary.
114
115
  - Each surface role has one recipe:
115
116
 
116
117
  | Role | Use for | Fill | Border | Radius | Shadow |
117
118
  | --- | --- | --- | --- | --- | --- |
118
- | Page | The canvas and example stages | `--bg` | None | None | None |
119
- | Well | Source code, screenshots, figures, and inset previews other than example stages | `--surface` | Source code: transparent 1px; figures: `--border-subtle` | `--radius-lg` | Source code: `--shadow-surface`; figures: none |
120
- | Panel | Cards, forms, charts, and detail views | `--surface-raised` | Transparent 1px | `--radius-lg` | `--shadow-surface` |
121
- | Field | Inputs, selects, textareas, and search fields | `--field-bg`; disabled: `--field` | `--field-edge` | `--radius-field` | `--field-shadow`; disabled: none |
122
- | Track | Segmented and switch tracks, and selected radio cards | `--field` | Transparent 1px | Tracks: `--radius-md`; radio cards: `--radius-lg` | `--shadow-sink` |
123
- | Floating layer | Menus, popovers, pickers, and dialogs | `--surface-raised` | Transparent 1px; the shadow's ring draws the edge | `--radius-lg` | `--shadow-popover` |
124
-
125
- - Borders stay 1px and transparent on buttons, quiet actions, tracks, panels, and radio cards, so forced colors can draw them. Fields keep `--field-edge`. `--border` keeps unchecked checkbox and radio edges visible. The toggle card is a named exception: a visible `--border-subtle` edge and no rest raise. Invalid fields show a `--danger` edge, except in forced colors, where the system edge wins. Figures, example frames, and dividers use `--border-subtle`.
126
- - Radii: `--radius-sm` for inline elements and checkboxes; `--radius-field` for fields, navigation rows, tabs, and toggle cards; `--radius-md` (a pill) for buttons and segmented controls; `--radius-lg` for wells, example frames, plates, panels, radio cards, alerts, and floating layers; `--radius-pill` for badges and switch tracks. Inner menu rows take the panel radius minus `--space-1`.
119
+ | Page | The canvas and example stages | `--color-bg` | None | None | None |
120
+ | Well | Source code, screenshots, figures, and inset previews other than example stages | `--color-surface` | Source code: transparent 1px; figures: `--color-border-subtle` | `--radius-panel` | Source code: `--shadow-surface`; figures: none |
121
+ | Panel | Cards, forms, charts, and detail views | `--color-surface-raised` | Transparent 1px | `--radius-panel` | `--shadow-surface` |
122
+ | Field | Inputs, selects, textareas, and search fields | `--color-field-bg`; disabled: `--color-well` | `--color-field-edge` | `--radius-field` | `--shadow-field`; disabled: none |
123
+ | Track | Segmented and switch tracks, and selected radio cards | `--color-well` | Transparent 1px | Segmented tracks: `--radius-control`; switch tracks: `--radius-pill`; radio cards: `--radius-panel` | `--shadow-sink` |
124
+ | Floating layer | Menus, popovers, pickers, and dialogs | `--color-surface-raised` | Transparent 1px; the shadow's ring draws the edge | `--radius-panel` | `--shadow-dialog` |
125
+
126
+ - Borders stay 1px and transparent on buttons, quiet actions, tracks, panels, and radio cards, so forced colors can draw them. Fields keep `--color-field-edge`. `--color-border` keeps unchecked checkbox and radio edges visible. The toggle card is a named exception: a visible `--color-border-subtle` edge and no rest raise. Invalid fields show a `--color-error` edge, except in forced colors, where the system edge wins. Figures, example frames, and dividers use `--color-border-subtle`.
127
+ - Shape follows role. A pill acts, or sets a value in place; a rectangle is a place, or holds content. Pick a new component's radius from its role in this table, not from the component it looks like.
128
+
129
+ | Role | Shape | Token | Members |
130
+ | --- | --- | --- | --- |
131
+ | Acts, or sets a value on one line | Pill | `--radius-control` | Buttons, quiet actions, and segmented controls with their thumbs |
132
+ | Small state mark | Pill | `--radius-pill` | Status badges, switch tracks and knobs, slider and progress tracks, score pips, and the in-page location pip |
133
+ | A place, or a row you pick | 6px | `--radius-inline` | Navigation rows outside a floating menu, group labels, breadcrumb links, tabs, list rows, checkboxes, and keyboard keys |
134
+ | Something you type in, or a control whose label wraps | 10px | `--radius-field` | Inputs, selects, textareas, search fields, toggle cards, and pager links |
135
+ | Holds other things | 16px | `--radius-panel` | Wells, plates, panels, cards, radio cards, alerts, code blocks, example frames, and floating layers |
136
+
137
+ - A pill never holds text that can wrap. A control whose label can wrap, such as a toggle card or a radio card, is a rectangle.
138
+ - Nested rectangles are concentric: a rectangle that sits closer to a rounded container's edge than the container's radius takes that radius minus the gap. Option rows in a select picker and the rows of a floating menu, such as the project menu, each `--space-1` inside a 16px panel, take `calc(var(--radius-panel) - var(--space-1))`, 12px. A shape with more room than that, such as a field in a dialog, keeps the radius of its role. One exception waits on the owner (see [open questions](decisions.md#open-questions)): the skip link, a floating layer, keeps `--radius-field`.
139
+ - Round marks (radios, slider thumbs, badge dots, and the busy spinner) take `50%`, a fill inside a shape inherits its corners, and an edge that meets another shape takes `0`. A page writes no other literal radius.
127
140
  - Avoid nesting panels. Cards are for a few parallel self-contained options that a reader compares. Running prose belongs in open sections. Product screenshots need one frame, not a frame around a frame.
128
141
  - [Depth](#depth) gives each role its shadow. Stable hover states keep normal content quiet.
129
142
 
130
143
  ### Depth
131
144
 
132
- Each depth tier has one token. [`tokens.css`](tokens.css) holds every shadow value, including the dark ones. Pages and components use the tokens and write no shadow of their own. Only zero-blur lines in a token colour are exempt: focus rings and dividers. A focused field's inset line is a token too (`--field-shadow-focus`, `--field-shadow-focus-invalid`).
145
+ Each depth tier has one token. [`tokens.css`](tokens.css) holds every shadow value, including the dark ones. Pages and components use the tokens and write no shadow of their own. Only zero-blur lines in a token colour are exempt: focus rings and dividers. A focused field's inset line is a token too (`--shadow-field-focus`, `--shadow-field-focus-invalid`).
133
146
 
134
147
  | Tier | Token | Use for |
135
148
  | --- | --- | --- |
136
149
  | Control | `--shadow-raise` | Idle buttons, unselected radio cards, switch knobs, and segmented thumbs |
137
150
  | Container | `--shadow-surface` | Panels, cards, source code (not inside an example frame), command plates, and terminal captures |
138
- | Pressed or well | `--shadow-sink` | Tracks, pressed buttons, selected radio cards, and fields in dark (through `--field-shadow`; light fields take none) |
151
+ | Pressed or well | `--shadow-sink` | Tracks, pressed buttons, selected radio cards, and fields in dark (through `--shadow-field`; light fields take none) |
139
152
  | Selected row | `--shadow-nav-current` | The current navigation row, the selected tab, and a selected list row |
140
- | Floating | `--shadow-popover` | Menus, popovers, pickers, and dialogs |
153
+ | Floating | `--shadow-dialog` | Menus, popovers, pickers, and dialogs |
141
154
 
142
155
  - Idle controls and containers take no outer light highlight and no blur wider than 2px. In dark mode, controls take a faint inset top edge and containers a faint 1px ring, so no halo shows.
143
156
  - A pressed button sinks and moves 1px down; see [Button](components.md#button).
@@ -156,11 +169,53 @@ Each depth tier has one token. [`tokens.css`](tokens.css) holds every shadow val
156
169
  - Examples: show a live component on a stage above its code, in one frame, with Copy in the code's corner. The stage sits on the page background. See [code block with a live example](components.md#with-a-live-example).
157
170
  - A screenshot opens at full size when clicked; use a native accessible trigger and restore its focus on close.
158
171
 
172
+ ### Navigation
173
+
174
+ [`components.md`](components.md) specifies each navigation component. These rules decide which one a page uses and how they agree.
175
+
176
+ - **Levels.** Each level has one component and one marker.
177
+
178
+ | Level | Answers | Component | Marker |
179
+ | --- | --- | --- | --- |
180
+ | Global | Which site? | Site header and project switcher | `aria-current="page"` on the registry row |
181
+ | Local | Which page of this site? | Section rail, or a navigation strip of 6 links or fewer | `aria-current="page"`: the lifted fill |
182
+ | In-page | Where am I on this page? | Section rail rows that point to `#id` | `aria-current="location"`: the lifted fill in a rail, a pip in strips and contents lists |
183
+ | Sequential | What comes next? | Pager | `rel="prev"` and `rel="next"` |
184
+ | Path | How do I get back up? | Breadcrumbs, only at depth 3 or more, or for a page outside its site's shell | The current page as text with `aria-current="page"` |
185
+ | Find | Where is X? | Find field that filters the rail | A live match count |
186
+
187
+ - **`aria-current`.**
188
+ - `page` goes on the link whose path matches the URL, ignoring the hash, and on one link in each landmark at most.
189
+ - `location` goes on the in-page link for the section in view.
190
+ - A link carries one marker, and page outranks location. Never put `page` on a link to `#id`.
191
+ - Use `step` for wizards and `true` for other sets.
192
+ - **Choosing a component.**
193
+ - A link (a navigation row or a strip) when the destination has its own URL.
194
+ - Tabs for panels about one object when no URL changes.
195
+ - A segmented control when the choice changes how the same content shows.
196
+ - Never mix URL-changing items and panel items in one set, and never give links `role="tab"`.
197
+ - **Landmarks.**
198
+ - Give every `<nav>` a unique name, and leave "navigation" out of it, because screen readers add that word.
199
+ - Order: skip link, banner (the header), local navigation, `main`, contentinfo. Focus follows that order. At tablet width the Find and Menu buttons come before `main`.
200
+ - **Scroll offset.**
201
+ - One offset: `html { scroll-padding-top }`, equal to any sticky bar plus `--space-4`. Sections do not set `scroll-margin-top`.
202
+ - Use `scroll-behavior: smooth` only under `prefers-reduced-motion: no-preference`.
203
+ - **Location tracking.**
204
+ - The current section is the last tracked heading, in page order, whose top has passed the scroll-padding inset. At the bottom of the page, the last tracked heading is current.
205
+ - After a jump (a click, a hash change, or a deep link), the target stays current until the reader scrolls away from where it landed.
206
+ - A group heading counts as its group's first row.
207
+ - **Single-key shortcuts.**
208
+ - Allowed only with an off switch, saved in storage and wrapped in `try`/`catch` (WCAG 2.1.4).
209
+ - Ignored while focus is in an editable element or a modal dialog is open.
210
+ - Shown with a visible [keyboard key](components.md#keyboard-key) hint and `aria-keyshortcuts`.
211
+ - The only shortcut is `/`, which focuses Find.
212
+ - **No command palette.** Find covers a single-page catalogue and a small site; see [decisions](decisions.md).
213
+
159
214
  ### Interaction and motion
160
215
 
161
216
  - Show visible focus and accessible names. A visual simplification must preserve useful controls, caveats, and keyboard paths.
162
- - Every focusable element but a field draws one ring, `outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset)`, with no glow, over its own raise or sink shadow. The `tokens.css` base sets it. `--focus` is the accent, which reaches 3:1 on `--bg`, `--surface`, and `--surface-raised` in both themes; a dark plate sets `--focus: var(--project-dark)`. Do not give a role its own ring colour. Fields (input, select, textarea, search) draw no ring: focus turns the edge `--accent` with a 2px inset line (`--field-shadow-focus`), and the fill stays. [Component specs](components.md#rules-for-every-control) give the values. Use an inset offset (`calc(var(--focus-width) * -1)`) only where a scrolling or clipping parent would cut the ring, or inside a segmented control; add a comment that names the reason. Keep the focus default in `@layer base`, so a component's own focus rule can refine it. Pointer hover never draws the outline.
163
- - Keep product navigation distinct from in-page section links. Current-page and current-section indicators serve different purposes. Open sibling project links in the same tab; indicate a new tab only when the link opens one.
217
+ - Every focusable element but a field draws one ring, `outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset)`, with no glow, over its own raise or sink shadow. The `tokens.css` base sets it. `--color-focus` is the accent, which reaches 3:1 on `--color-bg`, `--color-surface`, and `--color-surface-raised` in both themes; a dark plate sets `--color-focus: var(--color-project-dark)`. Do not give a role its own ring colour. Fields (input, select, textarea, search) draw no ring: focus turns the edge `--color-accent` with a 2px inset line (`--shadow-field-focus`), and the fill stays. [Component specs](components.md#rules-for-every-control) give the values. Use an inset offset (`calc(var(--focus-width) * -1)`) only where a scrolling or clipping parent would cut the ring, or inside a segmented control; add a comment that names the reason. Keep the focus default in `@layer base`, so a component's own focus rule can refine it. Pointer hover never draws the outline.
218
+ - Keep product navigation distinct from in-page section links. Current page and current section are different markers (`aria-current="page"` and `"location"`); see [Navigation](#navigation). Open sibling project links in the same tab; indicate a new tab only when the link opens one.
164
219
  - Use `--duration-fast` for hover/press and `--duration` for menus/panels. Animate opacity or transform only where it explains a state change. A component spec may set its own timing, as the segmented control's glide does.
165
220
  - Keep content visible without reveal effects, entrance sequences, or continuous decorative animation. Honor reduced motion, including anchor scrolling.
166
221
  - An interactive figure first renders as complete static content, so it reads the same without JavaScript; enhancement adds controls, not information. Give each state a text label and announce live results politely. A lesson needs one interactive figure at most; keep the rest static.
@@ -179,12 +234,12 @@ Each depth tier has one token. [`tokens.css`](tokens.css) holds every shadow val
179
234
  The personal sites are terminal tools that read Markdown and paths, so their identity comes from that world. A new project replaces this section with its own identity and keeps the core.
180
235
 
181
236
  - **Mono identity.** `--font-mono` (IBM Plex Mono) sets identity, the page titles and section headings of documentation, CLI tool, article, and product pages, navigation rails, metadata, captions, and the footer. `@filipgutica/ui` self-hosts IBM Plex; elsewhere the tokens fall back to the system stack.
182
- - **Headings.** Documentation, CLI tool, article, and product page titles are mono; application titles are `--font-sans`. Page-level section headings (h2) on documentation, CLI tool, article, and product pages are mono, start with a `##` mark in `--accent` (decorative, so screen readers skip it), and have a `--border-subtle` rule above the section. Application and inline-visualization section headings, and every h3 or lower, are plain `--font-sans` with no mark. Product pages and tool homes may use a mono `--text-display` title, stepping down to `--text-display-sm` on phones; keep a short heading measure, place supporting copy and the primary action nearby, and let the first product image enter the initial desktop viewport.
237
+ - **Headings.** Documentation, CLI tool, article, and product page titles are mono; application titles are `--font-ui`. Page-level section headings (h2) on documentation, CLI tool, article, and product pages are mono, start with a `##` mark in `--color-accent` (decorative, so screen readers skip it), and have a `--color-border-subtle` rule above the section. Application and inline-visualization section headings, and every h3 or lower, are plain `--font-ui` with no mark. Product pages and tool homes may use a mono `--text-display` title, stepping down to `--text-display-sm` on phones; keep a short heading measure, place supporting copy and the primary action nearby, and let the first product image enter the initial desktop viewport.
183
238
  - **Hue marks.** The hue also draws the `~/` header mark, the `##` mark on documentation, CLI tool, article, and product section headings, step numbers, and the `$` prompt.
184
- - **Header.** Personal product sites share a compact static header: a mono `~/name` identity with the `~/` in `--accent`, a project switcher, useful page links, appearance controls, and a solid `--text` rule below. Use the shared project registry for names, order, and destinations. Keep a gallery's existing application navigation structure.
239
+ - **Header.** Personal product sites share a compact static header: a mono `~/name` identity with the `~/` in `--color-accent`, a project switcher, useful page links, appearance controls, and a solid `--color-text` rule below. Use the shared project registry for names, order, and destinations. Keep a gallery's existing application navigation structure.
185
240
  - **Appearance.** Personal pages share the built-in System/Light/Dark choice, through the header's picker. An explicitly selected custom gallery theme overrides that choice until the reader selects a built-in appearance. Preserve installed themes.
186
- - **Terminal plates.** Commands sit on a dark plate tinted with the project hue (`--command-bg`), in both themes. A shell command gets a `$` prompt in `--project-dark`, drawn by CSS so it never enters copied or accessible text. Short commands use a headerless compact row with an accessible Copy control. Terminal captures keep the neutral `--terminal` plate, with a mono status-line caption below the screen; tabs on a capture switch to mono.
187
- - **Steps.** A real sequence is an ordered list with mono numbers in `--accent` on a ruled leading column, an h3 title per step, and an optional result note on the last step.
241
+ - **Terminal plates.** Commands sit on a dark plate tinted with the project hue (`--color-command-bg`), in both themes. A shell command gets a `$` prompt in `--color-project-dark`, drawn by CSS so it never enters copied or accessible text. Short commands use a headerless compact row with an accessible Copy control. Terminal captures keep the neutral `--color-terminal` plate, with a mono status-line caption below the screen; tabs on a capture switch to mono.
242
+ - **Steps.** A real sequence is an ordered list with mono numbers in `--color-accent` on a ruled leading column, an h3 title per step, and an optional result note on the last step.
188
243
 
189
244
  ## Avoid recurring clutter
190
245