@filipgutica/design-system 1.1.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/tokens.json CHANGED
@@ -2,59 +2,59 @@
2
2
  "themes": {
3
3
  "graphite-indigo": {
4
4
  "light": {
5
- "project": "#4b45d1",
6
- "project-dark": "#a5a1ff",
7
- "font-sans": "\"IBM Plex Sans\", -apple-system, BlinkMacSystemFont, \"SF Pro Text\", \"Segoe UI\", system-ui, sans-serif",
5
+ "color-project": "#4b45d1",
6
+ "color-project-dark": "#a5a1ff",
7
+ "font-ui": "\"IBM Plex Sans\", -apple-system, BlinkMacSystemFont, \"SF Pro Text\", \"Segoe UI\", system-ui, sans-serif",
8
8
  "font-mono": "\"IBM Plex Mono\", ui-monospace, \"SF Mono\", SFMono-Regular, Menlo, Consolas, monospace",
9
- "bg": "#f4f5f6",
10
- "surface": "#e9ebed",
11
- "surface-raised": "#fbfbfc",
12
- "surface-hover": "#e2e5e8",
13
- "field": "#e2e5e8",
14
- "field-bg": "#fbfbfc",
15
- "field-edge": "#d3d8dd",
16
- "field-shadow": "none",
17
- "control-thumb": "#fbfbfc",
18
- "nav-current": "color-mix(in srgb, #4b45d1 14%, #fbfbfc)",
19
- "nav-current-text": "#4b45d1",
20
- "segmented-current-text": "#4b45d1",
21
- "row-hover": "#e2e5e8",
22
- "row-selected": "#fbfbfc",
23
- "border-subtle": "#d3d8dd",
24
- "border": "#6d747b",
25
- "text": "#101315",
26
- "text-muted": "#50575e",
27
- "overlay": "rgb(0 0 0 / 42%)",
28
- "accent": "#4b45d1",
29
- "accent-text": "#f4f5f6",
30
- "accent-hover": "#101315",
31
- "button-hover": "color-mix(in srgb, #4b45d1 85%, #101315)",
32
- "link": "#0b5f7c",
33
- "focus": "#4b45d1",
9
+ "color-bg": "#f4f5f6",
10
+ "color-surface": "#e9ebed",
11
+ "color-surface-raised": "#fbfbfc",
12
+ "color-surface-muted": "#e2e5e8",
13
+ "color-well": "#e2e5e8",
14
+ "color-field-bg": "#fbfbfc",
15
+ "color-field-edge": "#d3d8dd",
16
+ "shadow-field": "none",
17
+ "color-control-thumb": "#fbfbfc",
18
+ "color-nav-current": "color-mix(in srgb, #4b45d1 14%, #fbfbfc)",
19
+ "color-nav-current-text": "#4b45d1",
20
+ "color-segmented-current-text": "#4b45d1",
21
+ "color-row-hover": "#e2e5e8",
22
+ "color-row-selected": "#fbfbfc",
23
+ "color-border-subtle": "#d3d8dd",
24
+ "color-border": "#6d747b",
25
+ "color-text": "#101315",
26
+ "color-muted": "#50575e",
27
+ "color-overlay": "rgb(0 0 0 / 42%)",
28
+ "color-accent": "#4b45d1",
29
+ "color-accent-text": "#f4f5f6",
30
+ "color-accent-hover": "#101315",
31
+ "color-button-hover": "color-mix(in srgb, #4b45d1 85%, #101315)",
32
+ "color-link": "#0b5f7c",
33
+ "color-focus": "#4b45d1",
34
34
  "focus-width": "2px",
35
35
  "focus-offset": "3px",
36
- "success": "#157249",
37
- "warning": "#86532e",
38
- "danger": "#bd342b",
39
- "info": "#175cd3",
40
- "success-soft": "#d9e5e1",
41
- "warning-soft": "#e7e2de",
42
- "danger-soft": "#efe4e4",
43
- "info-soft": "#d9e3f2",
44
- "command-bg": "color-mix(in srgb, #4b45d1 25%, #101010)",
45
- "command-border": "transparent",
46
- "terminal": "#0a0c0e",
47
- "terminal-text": "#e6e9eb",
48
- "terminal-border": "#2a3036",
49
- "terminal-caption": "#13171a",
50
- "terminal-caption-text": "#c9d0d6",
51
- "terminal-shadow-nav-current": "0 1px 2px rgb(0 0 0 / 25%)",
52
- "code-bg": "#e9ebed",
53
- "code-text": "#101315",
54
- "code-key": "#715b42",
55
- "code-string": "#346347",
56
- "code-number": "#86532e",
57
- "code-comment": "#626772",
36
+ "color-success": "#157249",
37
+ "color-warning": "#86532e",
38
+ "color-error": "#bd342b",
39
+ "color-info": "#175cd3",
40
+ "color-success-surface": "#d9e5e1",
41
+ "color-warning-surface": "#e7e2de",
42
+ "color-error-surface": "#efe4e4",
43
+ "color-info-surface": "#d9e3f2",
44
+ "color-command-bg": "color-mix(in srgb, #4b45d1 25%, #101010)",
45
+ "color-command-border": "transparent",
46
+ "color-terminal": "#0a0c0e",
47
+ "color-terminal-text": "#e6e9eb",
48
+ "color-terminal-border": "#2a3036",
49
+ "color-terminal-caption": "#13171a",
50
+ "color-terminal-caption-text": "#c9d0d6",
51
+ "shadow-nav-current-dark": "0 1px 2px rgb(0 0 0 / 25%)",
52
+ "color-code": "#e9ebed",
53
+ "color-code-text": "#101315",
54
+ "color-syntax-keyword": "#715b42",
55
+ "color-syntax-string": "#346347",
56
+ "color-syntax-number": "#86532e",
57
+ "color-syntax-comment": "#626772",
58
58
  "text-xs": "0.75rem",
59
59
  "text-sm": "0.8125rem",
60
60
  "text-md": "0.875rem",
@@ -91,76 +91,76 @@
91
91
  "page-max": "960px",
92
92
  "page-wide": "1120px",
93
93
  "sidebar": "224px",
94
- "radius-sm": "6px",
95
- "radius-md": "999px",
96
- "radius-lg": "16px",
94
+ "radius-inline": "6px",
95
+ "radius-control": "999px",
96
+ "radius-panel": "16px",
97
97
  "radius-field": "10px",
98
98
  "radius-pill": "999px",
99
99
  "shadow-raise": "0 1px 2px rgb(16 24 40 / 12%), 0 0 0 1px rgb(16 24 40 / 6%)",
100
100
  "shadow-surface": "0 1px 2px rgb(16 24 40 / 6%), 0 0 0 1px rgb(16 24 40 / 6%)",
101
101
  "shadow-sink": "inset 1.2px 1.2px 3.6px rgb(130 142 158 / 35%), inset -1.2px -1.2px 3.6px rgb(255 255 255 / 80%)",
102
- "shadow-popover": "0 8px 24px rgb(16 16 24 / 12%), 0 0 0 1px #d3d8dd",
102
+ "shadow-dialog": "0 8px 24px rgb(16 16 24 / 12%), 0 0 0 1px #d3d8dd",
103
103
  "shadow-nav-current": "0 1px 3px rgb(130 142 158 / 40%)",
104
- "field-shadow-focus": "inset 0 0 0 2px color-mix(in srgb, #4b45d1 18%, transparent)",
105
- "field-shadow-focus-invalid": "inset 0 0 0 2px color-mix(in srgb, #bd342b 18%, transparent)",
104
+ "shadow-field-focus": "inset 0 0 0 2px color-mix(in srgb, #4b45d1 18%, transparent)",
105
+ "shadow-field-focus-invalid": "inset 0 0 0 2px color-mix(in srgb, #bd342b 18%, transparent)",
106
106
  "duration-fast": "120ms",
107
107
  "duration": "180ms",
108
108
  "ease-out": "cubic-bezier(0.2, 0.8, 0.2, 1)"
109
109
  },
110
110
  "dark": {
111
- "project": "#a5a1ff",
112
- "project-dark": "#a5a1ff",
113
- "font-sans": "\"IBM Plex Sans\", -apple-system, BlinkMacSystemFont, \"SF Pro Text\", \"Segoe UI\", system-ui, sans-serif",
111
+ "color-project": "#a5a1ff",
112
+ "color-project-dark": "#a5a1ff",
113
+ "font-ui": "\"IBM Plex Sans\", -apple-system, BlinkMacSystemFont, \"SF Pro Text\", \"Segoe UI\", system-ui, sans-serif",
114
114
  "font-mono": "\"IBM Plex Mono\", ui-monospace, \"SF Mono\", SFMono-Regular, Menlo, Consolas, monospace",
115
- "bg": "#0d1012",
116
- "surface": "#13171a",
117
- "surface-raised": "#181d21",
118
- "surface-hover": "#20262b",
119
- "field": "color-mix(in srgb, #0d1012 87.5%, black)",
120
- "field-bg": "color-mix(in srgb, #0d1012 87.5%, black)",
121
- "field-edge": "#262d33",
122
- "field-shadow": "inset 1.2px 1.2px 3.6px rgb(0 0 0 / 55%), inset -1.2px -1.2px 3.6px rgb(255 255 255 / 5%)",
123
- "control-thumb": "color-mix(in srgb, #181d21 88%, white)",
124
- "nav-current": "color-mix(in srgb, #a5a1ff 20%, transparent)",
125
- "nav-current-text": "#a5a1ff",
126
- "segmented-current-text": "#a5a1ff",
127
- "row-hover": "#20262b",
128
- "row-selected": "#181d21",
129
- "border-subtle": "#262d33",
130
- "border": "#78818a",
131
- "text": "#e6e9eb",
132
- "text-muted": "#9aa3ab",
133
- "overlay": "rgb(0 0 0 / 62%)",
134
- "accent": "#a5a1ff",
135
- "accent-text": "#0d1012",
136
- "accent-hover": "#e6e9eb",
137
- "button-hover": "color-mix(in srgb, #a5a1ff 85%, #e6e9eb)",
138
- "link": "#67c1df",
139
- "focus": "#a5a1ff",
115
+ "color-bg": "#0d1012",
116
+ "color-surface": "#13171a",
117
+ "color-surface-raised": "#181d21",
118
+ "color-surface-muted": "#20262b",
119
+ "color-well": "color-mix(in srgb, #0d1012 87.5%, black)",
120
+ "color-field-bg": "color-mix(in srgb, #0d1012 87.5%, black)",
121
+ "color-field-edge": "#262d33",
122
+ "shadow-field": "inset 1.2px 1.2px 3.6px rgb(0 0 0 / 55%), inset -1.2px -1.2px 3.6px rgb(255 255 255 / 5%)",
123
+ "color-control-thumb": "color-mix(in srgb, #181d21 88%, white)",
124
+ "color-nav-current": "color-mix(in srgb, #a5a1ff 20%, transparent)",
125
+ "color-nav-current-text": "#a5a1ff",
126
+ "color-segmented-current-text": "#a5a1ff",
127
+ "color-row-hover": "#20262b",
128
+ "color-row-selected": "#181d21",
129
+ "color-border-subtle": "#262d33",
130
+ "color-border": "#78818a",
131
+ "color-text": "#e6e9eb",
132
+ "color-muted": "#9aa3ab",
133
+ "color-overlay": "rgb(0 0 0 / 62%)",
134
+ "color-accent": "#a5a1ff",
135
+ "color-accent-text": "#0d1012",
136
+ "color-accent-hover": "#e6e9eb",
137
+ "color-button-hover": "color-mix(in srgb, #a5a1ff 85%, #e6e9eb)",
138
+ "color-link": "#67c1df",
139
+ "color-focus": "#a5a1ff",
140
140
  "focus-width": "2px",
141
141
  "focus-offset": "3px",
142
- "success": "#4cc38a",
143
- "warning": "#e2a54b",
144
- "danger": "#f0776c",
145
- "info": "#84adff",
146
- "success-soft": "#172d25",
147
- "warning-soft": "#2f281b",
148
- "danger-soft": "#312020",
149
- "info-soft": "#202938",
150
- "command-bg": "color-mix(in srgb, #a5a1ff 16%, black)",
151
- "command-border": "color-mix(in srgb, #a5a1ff 28%, black)",
152
- "terminal": "#0a0c0e",
153
- "terminal-text": "#e6e9eb",
154
- "terminal-border": "#2a3036",
155
- "terminal-caption": "#13171a",
156
- "terminal-caption-text": "#c9d0d6",
157
- "terminal-shadow-nav-current": "0 1px 2px rgb(0 0 0 / 25%)",
158
- "code-bg": "#13171a",
159
- "code-text": "#e6e9eb",
160
- "code-key": "#d8c2a5",
161
- "code-string": "#a8bd9c",
162
- "code-number": "#d5b98c",
163
- "code-comment": "#a0a6b1",
142
+ "color-success": "#4cc38a",
143
+ "color-warning": "#e2a54b",
144
+ "color-error": "#f0776c",
145
+ "color-info": "#84adff",
146
+ "color-success-surface": "#172d25",
147
+ "color-warning-surface": "#2f281b",
148
+ "color-error-surface": "#312020",
149
+ "color-info-surface": "#202938",
150
+ "color-command-bg": "color-mix(in srgb, #a5a1ff 16%, black)",
151
+ "color-command-border": "color-mix(in srgb, #a5a1ff 28%, black)",
152
+ "color-terminal": "#0a0c0e",
153
+ "color-terminal-text": "#e6e9eb",
154
+ "color-terminal-border": "#2a3036",
155
+ "color-terminal-caption": "#13171a",
156
+ "color-terminal-caption-text": "#c9d0d6",
157
+ "shadow-nav-current-dark": "0 1px 2px rgb(0 0 0 / 25%)",
158
+ "color-code": "#13171a",
159
+ "color-code-text": "#e6e9eb",
160
+ "color-syntax-keyword": "#d8c2a5",
161
+ "color-syntax-string": "#a8bd9c",
162
+ "color-syntax-number": "#d5b98c",
163
+ "color-syntax-comment": "#a0a6b1",
164
164
  "text-xs": "0.75rem",
165
165
  "text-sm": "0.8125rem",
166
166
  "text-md": "0.875rem",
@@ -197,18 +197,18 @@
197
197
  "page-max": "960px",
198
198
  "page-wide": "1120px",
199
199
  "sidebar": "224px",
200
- "radius-sm": "6px",
201
- "radius-md": "999px",
202
- "radius-lg": "16px",
200
+ "radius-inline": "6px",
201
+ "radius-control": "999px",
202
+ "radius-panel": "16px",
203
203
  "radius-field": "10px",
204
204
  "radius-pill": "999px",
205
205
  "shadow-raise": "inset 0 1px 0 rgb(255 255 255 / 7%), 0 1px 2px rgb(0 0 0 / 45%)",
206
206
  "shadow-surface": "0 0 0 1px rgb(255 255 255 / 6%)",
207
207
  "shadow-sink": "inset 1.2px 1.2px 3.6px rgb(0 0 0 / 55%), inset -1.2px -1.2px 3.6px rgb(255 255 255 / 5%)",
208
- "shadow-popover": "0 8px 24px rgb(0 0 0 / 45%), 0 0 0 1px #262d33",
208
+ "shadow-dialog": "0 8px 24px rgb(0 0 0 / 45%), 0 0 0 1px #262d33",
209
209
  "shadow-nav-current": "0 1px 2px rgb(0 0 0 / 25%)",
210
- "field-shadow-focus": "inset 0 0 0 2px color-mix(in srgb, #a5a1ff 18%, transparent)",
211
- "field-shadow-focus-invalid": "inset 0 0 0 2px color-mix(in srgb, #f0776c 18%, transparent)",
210
+ "shadow-field-focus": "inset 0 0 0 2px color-mix(in srgb, #a5a1ff 18%, transparent)",
211
+ "shadow-field-focus-invalid": "inset 0 0 0 2px color-mix(in srgb, #f0776c 18%, transparent)",
212
212
  "duration-fast": "120ms",
213
213
  "duration": "180ms",
214
214
  "ease-out": "cubic-bezier(0.2, 0.8, 0.2, 1)"
@@ -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,7 +39,7 @@ 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.
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 lists the library variables that carry that value, the line's own name first. Update it when the package values change.
43
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.
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.
@@ -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,39 @@ 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
+ - [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
109
  - Keep main headings, actions, and product evidence visible on load. Scrolling should reveal more content without being required to make existing content appear.
110
110
 
111
111
  ### Surfaces
112
112
 
113
- - Start with headings, content, and whitespace. Use a `--border-subtle` divider where it clarifies a boundary.
113
+ - Start with headings, content, and whitespace. Use a `--color-border-subtle` divider where it clarifies a boundary.
114
114
  - Each surface role has one recipe:
115
115
 
116
116
  | Role | Use for | Fill | Border | Radius | Shadow |
117
117
  | --- | --- | --- | --- | --- | --- |
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`.
118
+ | Page | The canvas and example stages | `--color-bg` | None | None | None |
119
+ | 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 |
120
+ | Panel | Cards, forms, charts, and detail views | `--color-surface-raised` | Transparent 1px | `--radius-panel` | `--shadow-surface` |
121
+ | Field | Inputs, selects, textareas, and search fields | `--color-field-bg`; disabled: `--color-well` | `--color-field-edge` | `--radius-field` | `--shadow-field`; disabled: none |
122
+ | Track | Segmented and switch tracks, and selected radio cards | `--color-well` | Transparent 1px | Tracks: `--radius-control`; radio cards: `--radius-panel` | `--shadow-sink` |
123
+ | Floating layer | Menus, popovers, pickers, and dialogs | `--color-surface-raised` | Transparent 1px; the shadow's ring draws the edge | `--radius-panel` | `--shadow-dialog` |
124
+
125
+ - 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`.
126
+ - Radii: `--radius-inline` for inline elements, checkboxes, navigation rows, list-selection rows, and tabs; `--radius-field` for fields, toggle cards, and pager links; `--radius-control` (a pill) for buttons and segmented controls; `--radius-panel` for wells, example frames, plates, panels, radio cards, alerts, and floating layers; `--radius-pill` for badges and switch tracks. Navigation rows inside a floating menu, such as the project menu, keep `--radius-inline`; option rows in a select picker take the panel radius minus `--space-1`.
127
127
  - 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
128
  - [Depth](#depth) gives each role its shadow. Stable hover states keep normal content quiet.
129
129
 
130
130
  ### Depth
131
131
 
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`).
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 (`--shadow-field-focus`, `--shadow-field-focus-invalid`).
133
133
 
134
134
  | Tier | Token | Use for |
135
135
  | --- | --- | --- |
136
136
  | Control | `--shadow-raise` | Idle buttons, unselected radio cards, switch knobs, and segmented thumbs |
137
137
  | 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) |
138
+ | Pressed or well | `--shadow-sink` | Tracks, pressed buttons, selected radio cards, and fields in dark (through `--shadow-field`; light fields take none) |
139
139
  | 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 |
140
+ | Floating | `--shadow-dialog` | Menus, popovers, pickers, and dialogs |
141
141
 
142
142
  - 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
143
  - A pressed button sinks and moves 1px down; see [Button](components.md#button).
@@ -156,11 +156,53 @@ Each depth tier has one token. [`tokens.css`](tokens.css) holds every shadow val
156
156
  - 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
157
  - A screenshot opens at full size when clicked; use a native accessible trigger and restore its focus on close.
158
158
 
159
+ ### Navigation
160
+
161
+ [`components.md`](components.md) specifies each navigation component. These rules decide which one a page uses and how they agree.
162
+
163
+ - **Levels.** Each level has one component and one marker.
164
+
165
+ | Level | Answers | Component | Marker |
166
+ | --- | --- | --- | --- |
167
+ | Global | Which site? | Site header and project switcher | `aria-current="page"` on the registry row |
168
+ | Local | Which page of this site? | Section rail, or a navigation strip of 6 links or fewer | `aria-current="page"`: the lifted fill |
169
+ | 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 |
170
+ | Sequential | What comes next? | Pager | `rel="prev"` and `rel="next"` |
171
+ | 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"` |
172
+ | Find | Where is X? | Find field that filters the rail | A live match count |
173
+
174
+ - **`aria-current`.**
175
+ - `page` goes on the link whose path matches the URL, ignoring the hash, and on one link in each landmark at most.
176
+ - `location` goes on the in-page link for the section in view.
177
+ - A link carries one marker, and page outranks location. Never put `page` on a link to `#id`.
178
+ - Use `step` for wizards and `true` for other sets.
179
+ - **Choosing a component.**
180
+ - A link (a navigation row or a strip) when the destination has its own URL.
181
+ - Tabs for panels about one object when no URL changes.
182
+ - A segmented control when the choice changes how the same content shows.
183
+ - Never mix URL-changing items and panel items in one set, and never give links `role="tab"`.
184
+ - **Landmarks.**
185
+ - Give every `<nav>` a unique name, and leave "navigation" out of it, because screen readers add that word.
186
+ - 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`.
187
+ - **Scroll offset.**
188
+ - One offset: `html { scroll-padding-top }`, equal to any sticky bar plus `--space-4`. Sections do not set `scroll-margin-top`.
189
+ - Use `scroll-behavior: smooth` only under `prefers-reduced-motion: no-preference`.
190
+ - **Location tracking.**
191
+ - 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.
192
+ - 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.
193
+ - A group heading counts as its group's first row.
194
+ - **Single-key shortcuts.**
195
+ - Allowed only with an off switch, saved in storage and wrapped in `try`/`catch` (WCAG 2.1.4).
196
+ - Ignored while focus is in an editable element or a modal dialog is open.
197
+ - Shown with a visible [keyboard key](components.md#keyboard-key) hint and `aria-keyshortcuts`.
198
+ - The only shortcut is `/`, which focuses Find.
199
+ - **No command palette.** Find covers a single-page catalogue and a small site; see [decisions](decisions.md).
200
+
159
201
  ### Interaction and motion
160
202
 
161
203
  - 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.
204
+ - 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.
205
+ - 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
206
  - 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
207
  - Keep content visible without reveal effects, entrance sequences, or continuous decorative animation. Honor reduced motion, including anchor scrolling.
166
208
  - 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 +221,12 @@ Each depth tier has one token. [`tokens.css`](tokens.css) holds every shadow val
179
221
  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
222
 
181
223
  - **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.
224
+ - **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
225
  - **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.
226
+ - **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
227
  - **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.
228
+ - **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.
229
+ - **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
230
 
189
231
  ## Avoid recurring clutter
190
232