@filipgutica/design-system 1.0.2 → 1.0.4
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/language/DESIGN.md +3 -3
- package/language/components.html +50 -26
- package/language/components.md +5 -4
- package/language/decisions.md +3 -6
- package/language/docs.html +4 -2
- package/language/product.html +2 -1
- package/language/reference.html +29 -16
- package/package.json +1 -1
package/language/DESIGN.md
CHANGED
|
@@ -128,14 +128,14 @@ Controls use quiet depth and familiar shapes: borderless surfaces with one tight
|
|
|
128
128
|
|
|
129
129
|
| Role | Shape | Token | Members |
|
|
130
130
|
| --- | --- | --- | --- |
|
|
131
|
-
| Acts, or sets a value on one line | Pill | `--radius-control` | Buttons, quiet actions, and segmented controls with their thumbs |
|
|
131
|
+
| Acts, or sets a value in place with every option shown, on one line | Pill | `--radius-control` | Buttons other than the labelled contents trigger and its no-JavaScript summary, quiet actions other than the project-menu trigger, and segmented controls with their thumbs |
|
|
132
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
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,
|
|
134
|
+
| Something you type in, a control whose label wraps, or a one-line control that is not an action | 10px | `--radius-field` | Inputs, textareas, search fields, toggle cards, pager links, and one-line controls that are not actions: the select, the project-menu trigger, the labelled contents trigger and its no-JavaScript summary, and the skip link |
|
|
135
135
|
| Holds other things | 16px | `--radius-panel` | Wells, plates, panels, cards, radio cards, alerts, code blocks, example frames, and floating layers |
|
|
136
136
|
|
|
137
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.
|
|
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.
|
|
139
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.
|
|
140
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.
|
|
141
141
|
- [Depth](#depth) gives each role its shadow. Stable hover states keep normal content quiet.
|
package/language/components.html
CHANGED
|
@@ -14,7 +14,10 @@
|
|
|
14
14
|
* stand in for :hover, :active, and :focus-visible, and ARIA or native attributes
|
|
15
15
|
* (aria-pressed, aria-checked, checked, disabled, aria-invalid, aria-busy) set the rest.
|
|
16
16
|
* Pinned specimens sit inside an inert wrapper, so they take no focus and no input.
|
|
17
|
-
* Drop the .is-* classes when you copy a component.
|
|
17
|
+
* Drop the .is-* classes, and the rules that name them, when you copy a component.
|
|
18
|
+
*
|
|
19
|
+
* Hover: a real :hover rule sits in @media (hover: hover), so a tap on a touch screen leaves
|
|
20
|
+
* no fill behind. The .is-hover rule beside it pins the same look for the specimen.
|
|
18
21
|
*/
|
|
19
22
|
|
|
20
23
|
/* ---------- Shared recipes ---------- */
|
|
@@ -28,16 +31,21 @@
|
|
|
28
31
|
.btn { --depth: var(--shadow-raise); display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--control-md); padding: 0 var(--space-3); border: 1px solid transparent; border-radius: var(--radius-control); background: var(--color-accent); color: var(--color-accent-text); box-shadow: var(--depth); font: var(--weight-medium) var(--text-md) / 1.25 var(--font-ui); letter-spacing: -0.01em; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out); }
|
|
29
32
|
.btn[data-size="sm"] { min-height: var(--control-sm); padding: 0 0.625rem; font-size: var(--text-sm); }
|
|
30
33
|
.btn[data-size="lg"] { min-height: var(--control-lg); padding: 0 var(--space-4); font-size: var(--text-lg); }
|
|
31
|
-
.btn
|
|
34
|
+
.btn.is-hover:not(:disabled) { background: var(--color-button-hover); }
|
|
35
|
+
@media (hover: hover) { .btn:hover:not(:disabled) { background: var(--color-button-hover); } }
|
|
32
36
|
.btn.secondary { background: var(--color-control-thumb); color: var(--color-text); }
|
|
33
|
-
.btn.secondary
|
|
37
|
+
.btn.secondary.is-hover:not(:disabled) { background: color-mix(in srgb, var(--color-text) 8%, var(--color-control-thumb)); }
|
|
38
|
+
@media (hover: hover) { .btn.secondary:hover:not(:disabled) { background: color-mix(in srgb, var(--color-text) 8%, var(--color-control-thumb)); } }
|
|
34
39
|
.btn.ghost { --depth: none; background: transparent; color: var(--color-muted); }
|
|
35
|
-
.btn.ghost
|
|
40
|
+
.btn.ghost.is-hover:not(:disabled) { background: var(--color-row-hover); color: var(--color-text); }
|
|
41
|
+
@media (hover: hover) { .btn.ghost:hover:not(:disabled) { background: var(--color-row-hover); color: var(--color-text); } }
|
|
36
42
|
/* Danger rises like the other filled variants; its text mixes the hue toward --color-text, as status badges do. */
|
|
37
43
|
.btn.danger { background: var(--color-error-surface); color: light-dark(color-mix(in srgb, var(--color-error) 75%, var(--color-text)), color-mix(in srgb, var(--color-error) 85%, var(--color-text))); }
|
|
38
|
-
.btn.danger
|
|
44
|
+
.btn.danger.is-hover:not(:disabled) { background: color-mix(in srgb, var(--color-error) 10%, var(--color-error-surface)); }
|
|
45
|
+
@media (hover: hover) { .btn.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--color-error) 10%, var(--color-error-surface)); } }
|
|
39
46
|
.btn.text { --depth: none; min-height: auto; padding: var(--space-1); background: transparent; color: var(--color-link); text-decoration: underline; text-underline-offset: 0.2em; }
|
|
40
|
-
.btn.text
|
|
47
|
+
.btn.text.is-hover:not(:disabled) { background: transparent; }
|
|
48
|
+
@media (hover: hover) { .btn.text:hover:not(:disabled) { background: transparent; } }
|
|
41
49
|
/* A press sinks the button 1px and changes its fill, so the click reads at a glance. */
|
|
42
50
|
.btn:not(.secondary, .ghost, .danger, .text):is(:active, [aria-pressed="true"], .is-active):not(:disabled) { background: var(--color-button-hover); }
|
|
43
51
|
.btn:is(.secondary, .ghost):is(:active, [aria-pressed="true"], .is-active):not(:disabled) { background: var(--color-well); }
|
|
@@ -59,7 +67,8 @@
|
|
|
59
67
|
never a text glyph such as ×: a font draws a glyph's ink off its box centre.
|
|
60
68
|
:where keeps the base below each component's own size and layout. */
|
|
61
69
|
:where(.quiet-action) { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: var(--radius-control); background: transparent; font: inherit; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out); }
|
|
62
|
-
.quiet-action
|
|
70
|
+
.quiet-action.is-hover:where(:not(:disabled)) { color: var(--color-text); background: color-mix(in srgb, currentColor 12%, transparent); }
|
|
71
|
+
@media (hover: hover) { .quiet-action:hover:where(:not(:disabled)) { color: var(--color-text); background: color-mix(in srgb, currentColor 12%, transparent); } }
|
|
63
72
|
.quiet-action:is(:active, .is-active):where(:not(:disabled)) { background: color-mix(in srgb, currentColor 18%, transparent); }
|
|
64
73
|
.quiet-action:disabled { opacity: 0.58; cursor: not-allowed; }
|
|
65
74
|
|
|
@@ -89,7 +98,7 @@
|
|
|
89
98
|
.select::picker(select) { min-width: anchor-size(width); max-height: min(20rem, 50dvh); overflow: auto; margin-block: var(--space-1); padding: var(--space-1); border: 1px solid transparent; border-radius: var(--radius-panel); background: var(--color-surface-raised); color: var(--color-text); box-shadow: var(--shadow-dialog); font: var(--text-md) / var(--leading) var(--font-ui); }
|
|
90
99
|
.select option { min-height: var(--control-sm); padding: var(--space-2) var(--space-3); border-radius: calc(var(--radius-panel) - var(--space-1)); cursor: pointer; }
|
|
91
100
|
.select option:checked { background: var(--color-row-selected); }
|
|
92
|
-
.select option:hover:where(:not(:disabled)) { background: var(--color-row-hover); }
|
|
101
|
+
@media (hover: hover) { .select option:hover:where(:not(:disabled)) { background: var(--color-row-hover); } }
|
|
93
102
|
/* Inset: the picker scrolls. */
|
|
94
103
|
.select option:focus-visible { background: var(--color-row-hover); outline: var(--focus-width) solid var(--color-focus); outline-offset: calc(var(--focus-width) * -1); }
|
|
95
104
|
.select option::checkmark { order: 1; margin-left: auto; color: var(--color-accent); }
|
|
@@ -103,7 +112,7 @@
|
|
|
103
112
|
.search input::placeholder { color: var(--color-muted); }
|
|
104
113
|
/* The native search clear button, quieted to a thin muted cross drawn with a mask. */
|
|
105
114
|
.search input::-webkit-search-cancel-button { width: 0.75rem; height: 0.75rem; margin-inline-start: var(--space-2); background: var(--color-muted); cursor: pointer; -webkit-appearance: none; appearance: none; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 2.5l7 7m0-7l-7 7' stroke='black' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }
|
|
106
|
-
.search input:where(:not(:disabled))::-webkit-search-cancel-button:hover { background: var(--color-text); }
|
|
115
|
+
@media (hover: hover) { .search input:where(:not(:disabled))::-webkit-search-cancel-button:hover { background: var(--color-text); } }
|
|
107
116
|
/* A disabled field drops into the grey well (the same fill as rest in dark) and loses its shadow. background-color keeps the select chevron. */
|
|
108
117
|
:is(.input, .select, .textarea):disabled { background-color: var(--color-well); box-shadow: none; opacity: 0.58; cursor: not-allowed; }
|
|
109
118
|
/* A static drawing of the open picker; a native select cannot be pinned open. */
|
|
@@ -130,7 +139,8 @@
|
|
|
130
139
|
/* Radio card: the native radio owns selection; the label owns the card surface. */
|
|
131
140
|
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-3); width: min(100%, 420px); border: 0; margin: 0; padding: 0; }
|
|
132
141
|
.radio-card { --depth: var(--shadow-raise); position: relative; display: grid; gap: var(--space-1); min-width: 0; padding: var(--space-3); padding-right: var(--space-8); border: 1px solid transparent; border-radius: var(--radius-panel); background: var(--color-surface-raised); box-shadow: var(--depth); cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out); }
|
|
133
|
-
.radio-card
|
|
142
|
+
.radio-card.is-hover:not(:has(input:checked, input:disabled)) { background: color-mix(in srgb, var(--color-surface-muted) 45%, var(--color-surface-raised)); }
|
|
143
|
+
@media (hover: hover) { .radio-card:hover:not(:has(input:checked, input:disabled)) { background: color-mix(in srgb, var(--color-surface-muted) 45%, var(--color-surface-raised)); } }
|
|
134
144
|
/* Depth and a check badge show the choice, without an accent ring. */
|
|
135
145
|
.radio-card:has(input:checked) { --depth: var(--shadow-sink); background: var(--color-well); }
|
|
136
146
|
.radio-card:has(input:disabled) { opacity: 0.58; cursor: not-allowed; }
|
|
@@ -158,7 +168,8 @@
|
|
|
158
168
|
.toggle { --w: 2.75rem; --h: 1.375rem; --inset: 0.125rem; --depth: none; display: flex; align-items: center; gap: var(--space-3); min-height: var(--control-md); padding: var(--space-2) var(--space-3); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-field); background: var(--color-surface-raised); color: var(--color-text); font: var(--text-md) / var(--leading-tight) var(--font-ui); text-align: left; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out); }
|
|
159
169
|
.toggle[data-size="sm"] { --w: 2.2rem; --h: 1.1rem; --inset: 0.1rem; min-height: var(--control-sm); font-size: var(--text-sm); }
|
|
160
170
|
.toggle[data-size="lg"] { --w: 3.3rem; --h: 1.65rem; --inset: 0.15rem; min-height: var(--control-lg); font-size: var(--text-lg); }
|
|
161
|
-
.toggle
|
|
171
|
+
.toggle.is-hover:not(:disabled, [aria-pressed="true"]) { border-color: var(--color-border); }
|
|
172
|
+
@media (hover: hover) { .toggle:hover:not(:disabled, [aria-pressed="true"]) { border-color: var(--color-border); } }
|
|
162
173
|
/* The switch carries the on state; the card takes a faint 8% accent tint and an accent hairline. */
|
|
163
174
|
.toggle[aria-pressed="true"] { border-color: color-mix(in srgb, var(--color-accent) 35%, transparent); background: color-mix(in srgb, var(--color-accent) 8%, var(--color-surface-raised)); }
|
|
164
175
|
.toggle:disabled { opacity: 0.58; cursor: not-allowed; }
|
|
@@ -174,8 +185,10 @@
|
|
|
174
185
|
.segmented[data-icon-only] button { width: var(--item); padding: 0; }
|
|
175
186
|
/* The thumb is inset inside each full-size button, so it floats on the track and the hit area keeps its size. */
|
|
176
187
|
.segmented button::before { content: ""; position: absolute; inset: 2px; z-index: -2; border-radius: var(--radius-control); pointer-events: none; }
|
|
177
|
-
.segmented button
|
|
178
|
-
|
|
188
|
+
.segmented button.is-hover:not(:disabled, [aria-pressed="true"]) { color: var(--color-text); }
|
|
189
|
+
@media (hover: hover) { .segmented button:hover:not(:disabled, [aria-pressed="true"]) { color: var(--color-text); } }
|
|
190
|
+
.segmented button.is-hover:not(:disabled, [aria-pressed="true"])::before { background: color-mix(in srgb, var(--color-control-thumb) 45%, transparent); }
|
|
191
|
+
@media (hover: hover) { .segmented button:hover:not(:disabled, [aria-pressed="true"])::before { background: color-mix(in srgb, var(--color-control-thumb) 45%, transparent); } }
|
|
179
192
|
/* The pressed label reads at 4.5:1 on its thumb, and an icon at 3:1 (--color-segmented-current-text). */
|
|
180
193
|
.segmented button[aria-pressed="true"] { color: var(--color-segmented-current-text); }
|
|
181
194
|
.segmented button[aria-pressed="true"]::before { z-index: -1; background: var(--color-control-thumb); box-shadow: var(--shadow-raise); }
|
|
@@ -235,7 +248,8 @@
|
|
|
235
248
|
.tablist[data-clip="end"] { mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); }
|
|
236
249
|
.tablist[data-clip="start end"] { mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
|
|
237
250
|
.tab { position: relative; flex: none; min-height: var(--control-md); padding: var(--space-2) var(--space-3); border: 0; border-radius: var(--radius-inline); background: transparent; color: var(--color-muted); font: var(--weight-medium) var(--text-md) / var(--leading) var(--font-ui); white-space: nowrap; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out); }
|
|
238
|
-
.tab
|
|
251
|
+
.tab.is-hover:where(:not(:disabled)) { background: var(--color-row-hover); color: var(--color-text); }
|
|
252
|
+
@media (hover: hover) { .tab:hover:where(:not(:disabled)) { background: var(--color-row-hover); color: var(--color-text); } }
|
|
239
253
|
/* The selected tab takes the navigation row's lifted fill: one selected state for both. The fill is a
|
|
240
254
|
::before layer behind the label, so it can glide between tabs as the segmented thumb does. */
|
|
241
255
|
.tab[aria-selected="true"] { background: transparent; color: var(--color-nav-current-text); }
|
|
@@ -324,7 +338,8 @@
|
|
|
324
338
|
.navlist { display: grid; gap: 0.125rem; width: min(100%, 240px); }
|
|
325
339
|
.navlist .group-label { padding: 0 var(--space-3) var(--space-1); color: var(--color-muted); font-size: var(--text-xs); font-weight: var(--weight-semibold); }
|
|
326
340
|
.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); }
|
|
327
|
-
.navlist a
|
|
341
|
+
.navlist a.is-hover { background: var(--color-row-hover); color: var(--color-text); text-decoration: none; }
|
|
342
|
+
@media (hover: hover) { .navlist a:hover { background: var(--color-row-hover); color: var(--color-text); text-decoration: none; } }
|
|
328
343
|
.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); }
|
|
329
344
|
.navlist a[aria-current="location"] { color: var(--color-text); font-weight: var(--weight-medium); }
|
|
330
345
|
.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); }
|
|
@@ -339,16 +354,19 @@
|
|
|
339
354
|
}
|
|
340
355
|
/* Inset: the rail and the drawer scroll. */
|
|
341
356
|
.navlist a:is(:focus-visible, .is-focus) { outline: var(--focus-width) solid var(--color-focus); outline-offset: calc(var(--focus-width) * -1); }
|
|
342
|
-
/* Phone trigger: a secondary button with a three-line menu glyph, because it opens a side drawer.
|
|
357
|
+
/* Phone trigger: a secondary button with a three-line menu glyph, because it opens a side drawer. It shows the page’s
|
|
358
|
+
contents and does not act, so it takes the field corner, as its no-JavaScript summary does. */
|
|
359
|
+
.menu-glyph { border-radius: var(--radius-field); }
|
|
343
360
|
.menu-glyph::before { content: ""; flex: none; width: 14px; height: 10px; border-block: 1.5px solid currentColor; background: linear-gradient(currentColor, currentColor) center / 100% 1.5px no-repeat; }
|
|
344
361
|
/* No-JavaScript fallback: the list opens in place. The summary is a secondary button with a chevron; only the chevron is local. */
|
|
345
|
-
.rail-summary { list-style: none; width: max-content; max-width: 100%; }
|
|
362
|
+
.rail-summary { list-style: none; width: max-content; max-width: 100%; border-radius: var(--radius-field); }
|
|
346
363
|
.rail-summary::-webkit-details-marker { display: none; }
|
|
347
364
|
.rail-summary::after { content: ""; width: 6px; height: 6px; margin-left: var(--space-1); border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); }
|
|
348
365
|
details.rail-details[open] > .navlist { margin-top: var(--space-2); }
|
|
349
366
|
/* A collapsible group's label is a disclosure button in the group-label type. Only rails over about 40 rows use it. */
|
|
350
367
|
.group-toggle { display: flex; align-items: center; justify-content: space-between; min-height: var(--control-sm); padding: 0 var(--space-3); border: 1px solid transparent; border-radius: var(--radius-inline); background: transparent; color: var(--color-muted); font: var(--weight-semibold) var(--text-xs) var(--font-ui); cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out); }
|
|
351
|
-
.group-toggle
|
|
368
|
+
.group-toggle.is-hover:where(:not(:disabled)) { background: var(--color-row-hover); color: var(--color-text); }
|
|
369
|
+
@media (hover: hover) { .group-toggle:hover:where(:not(:disabled)) { background: var(--color-row-hover); color: var(--color-text); } }
|
|
352
370
|
.group-toggle .icon { transition: transform var(--duration-fast) var(--ease-out); }
|
|
353
371
|
.group-toggle[aria-expanded="false"] .icon { transform: rotate(-90deg); }
|
|
354
372
|
/* Inset: the rail list scrolls. */
|
|
@@ -393,7 +411,8 @@
|
|
|
393
411
|
.crumbs li { display: inline-flex; align-items: center; gap: var(--space-2); min-width: 0; }
|
|
394
412
|
.crumbs li + li::before { content: "/" / ""; color: var(--color-muted); }
|
|
395
413
|
.crumbs a { display: inline-flex; align-items: center; min-height: var(--control-sm); border-radius: var(--radius-inline); color: var(--color-muted); text-decoration: none; }
|
|
396
|
-
.crumbs a
|
|
414
|
+
.crumbs a.is-hover { color: var(--color-text); text-decoration: underline; text-underline-offset: 0.2em; }
|
|
415
|
+
@media (hover: hover) { .crumbs a:hover { color: var(--color-text); text-decoration: underline; text-underline-offset: 0.2em; } }
|
|
397
416
|
.crumbs [aria-current="page"] { color: var(--color-text); font-weight: var(--weight-medium); overflow-wrap: anywhere; }
|
|
398
417
|
/* Crumbs share the header row with the strip, so they centre on the cap height too. */
|
|
399
418
|
@supports (text-box: trim-both cap alphabetic) {
|
|
@@ -408,7 +427,8 @@
|
|
|
408
427
|
/* Pager: previous at the start, next always at the end. */
|
|
409
428
|
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); width: 100%; padding-top: var(--space-6); border-top: 1px solid var(--color-border-subtle); }
|
|
410
429
|
.pager a { display: grid; align-content: start; gap: 0.125rem; padding: var(--space-3) var(--space-4); border: 1px solid transparent; border-radius: var(--radius-field); color: var(--color-text); text-decoration: none; transition: background-color var(--duration-fast) var(--ease-out); }
|
|
411
|
-
.pager a
|
|
430
|
+
.pager a.is-hover { background: var(--color-row-hover); }
|
|
431
|
+
@media (hover: hover) { .pager a:hover { background: var(--color-row-hover); } }
|
|
412
432
|
.pager a[rel="next"] { grid-column: 2; justify-items: end; text-align: end; }
|
|
413
433
|
.pager-dir { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--color-muted); font-size: var(--text-xs); }
|
|
414
434
|
.pager-title { font-weight: var(--weight-medium); }
|
|
@@ -426,9 +446,11 @@
|
|
|
426
446
|
/* Dividers are straight lines inset by the row padding, so they never follow a rounded corner.
|
|
427
447
|
A filled row (hovered or selected) hides the divider above it and the one below it. */
|
|
428
448
|
.rows [role="option"] + [role="option"]::before { content: ""; position: absolute; inset: 0 var(--space-3) auto; border-top: 1px solid var(--color-border-subtle); }
|
|
429
|
-
.rows [role="option"]:is(
|
|
430
|
-
.rows [role="option"]:is(
|
|
431
|
-
.rows [role="option"]:
|
|
449
|
+
.rows [role="option"]:is(.is-hover, [aria-selected="true"])::before,
|
|
450
|
+
.rows [role="option"]:is(.is-hover, [aria-selected="true"]) + [role="option"]::before { display: none; }
|
|
451
|
+
@media (hover: hover) { .rows [role="option"]:hover::before, .rows [role="option"]:hover + [role="option"]::before { display: none; } }
|
|
452
|
+
.rows [role="option"].is-hover { background: var(--color-row-hover); }
|
|
453
|
+
@media (hover: hover) { .rows [role="option"]:hover { background: var(--color-row-hover); } }
|
|
432
454
|
/* The selected row takes the navigation row's current recipe; it comes after hover, so hover keeps the fill. */
|
|
433
455
|
.rows [role="option"][aria-selected="true"] { background: var(--color-nav-current); box-shadow: var(--shadow-nav-current); color: var(--color-nav-current-text); font-weight: var(--weight-medium); }
|
|
434
456
|
@media (forced-colors: active) { .rows [role="option"][aria-selected="true"] { border-inline-start: 2px solid Highlight; } }
|
|
@@ -441,7 +463,8 @@
|
|
|
441
463
|
/* Copy is a quiet action; this sets its size and place. */
|
|
442
464
|
.copy { display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem; min-width: var(--control-lg); min-height: var(--control-lg); margin-left: auto; padding: var(--space-1) 0.375rem; color: inherit; }
|
|
443
465
|
/* The code block has its own palette, so its Copy keeps the plate's text colour on hover. */
|
|
444
|
-
.code .copy
|
|
466
|
+
.code .copy.is-hover:where(:not(:disabled)) { color: inherit; }
|
|
467
|
+
@media (hover: hover) { .code .copy:hover:where(:not(:disabled)) { color: inherit; } }
|
|
445
468
|
/* Inset: the code block clips its content. */
|
|
446
469
|
.code pre:is(:focus-visible, .is-focus) { outline: var(--focus-width) solid var(--color-focus); outline-offset: calc(var(--focus-width) * -1); }
|
|
447
470
|
.code .copy.quiet-action:is(:focus-visible, .is-focus) { outline-offset: calc(var(--focus-width) * -1); }
|
|
@@ -516,7 +539,7 @@
|
|
|
516
539
|
.site-header { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); min-height: var(--space-16); padding: var(--space-2) var(--space-4); border-bottom: 1px solid var(--color-text); background: var(--color-bg); width: 100%; }
|
|
517
540
|
.projects { position: relative; }
|
|
518
541
|
/* The trigger is a quiet action; this sets its size and type. */
|
|
519
|
-
.projects > summary { display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--control-lg); padding-inline: var(--space-3); font-family: var(--font-mono); font-weight: var(--weight-semibold); list-style: none; user-select: none; }
|
|
542
|
+
.projects > summary { display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--control-lg); padding-inline: var(--space-3); border-radius: var(--radius-field); font-family: var(--font-mono); font-weight: var(--weight-semibold); list-style: none; user-select: none; }
|
|
520
543
|
.projects > summary::-webkit-details-marker { display: none; }
|
|
521
544
|
/* The ~/ mark is decorative: the empty alternative text keeps it out of the name. */
|
|
522
545
|
.projects > summary::before { content: "~/" / ""; color: var(--color-project); }
|
|
@@ -590,7 +613,8 @@
|
|
|
590
613
|
.tab[aria-selected="true"]::before { content: none; }
|
|
591
614
|
.check input:checked { forced-color-adjust: none; border-color: Highlight; background: Highlight; }
|
|
592
615
|
/* The masked search cross would lose its fill, so it opts out and takes the system text colour. */
|
|
593
|
-
.search input::-webkit-search-cancel-button
|
|
616
|
+
.search input::-webkit-search-cancel-button { forced-color-adjust: none; background: CanvasText; }
|
|
617
|
+
@media (hover: hover) { .search input:where(:not(:disabled))::-webkit-search-cancel-button:hover { forced-color-adjust: none; background: CanvasText; } }
|
|
594
618
|
.check input[type="checkbox"]:checked::before { border-color: HighlightText; }
|
|
595
619
|
.check input[type="radio"]:checked { background: HighlightText; }
|
|
596
620
|
.radio-card input:checked { forced-color-adjust: none; border-color: Highlight; background: Highlight; color: HighlightText; }
|
package/language/components.md
CHANGED
|
@@ -35,6 +35,7 @@ A control's **States** line names each interactive state it has. In `components.
|
|
|
35
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`.
|
|
36
36
|
- **Borders.** Every control keeps a 1px border, transparent unless its section says otherwise, so forced colors can draw an edge.
|
|
37
37
|
- **Depth.** Each control takes its shadow from the [depth tiers](DESIGN.md#depth).
|
|
38
|
+
- **Hover.** Hover fills apply only where the pointer can hover. Put every `:hover` rule that sets a background, shadow, border colour, or text colour in `@media (hover: hover)`, because a touch screen keeps `:hover` on the last element tapped. The pressed tint stays outside the query: it shows only while a finger is down.
|
|
38
39
|
- **Press.** Only a button has a pressed state; see [Button](#button). A [quiet action](#quiet-action) tints on press without sinking. Other controls have no `:active` treatment: they show their latched state as their section says.
|
|
39
40
|
- **Focus.** One ring for every role but fields: `outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset)` (2px, 3px), with no halo or glow. `--color-focus` is the accent (`--color-accent`), which reaches 3:1 on `--color-bg`, `--color-surface`, and `--color-surface-raised` in both themes. It sits around primary, danger, and selected controls too. Do not give a role its own ring colour; where a variant must recolour the ring, set only `outline-color`. The ring is drawn over the control's own raise or sink shadow, which does not change. It goes on the visible part of a composite control: the switch track, the radio card, and the slider thumb. A dark plate (command plate, terminal capture) sets `--color-focus: var(--color-project-dark)`, the dark-theme accent, which reaches 3:1 on the plate in both page themes. In forced colors, a control that opts out of adjustment (a checked box, the switch track, a pressed segmented option) sets `outline-color: CanvasText`. Inside a scrolling or clipping parent, the ring is inset (`outline-offset: calc(var(--focus-width) * -1)`), and a comment names the reason. Only `:focus-visible` shows a ring; pointer hover never does.
|
|
40
41
|
- **Field focus.** Fields (input, select, textarea, and the search wrapper) draw no ring. On `:focus-visible` (the search wrapper uses `:has(input:focus-visible)`) the 1px edge turns `--color-accent`, and `--shadow-field-focus` (`inset 0 0 0 2px`, the accent at 18% over transparent) draws a muted accent line inside it, with `outline: none`. The fill does not change in either theme. An invalid field keeps its `--color-error` edge while focused, and its inset line is `--shadow-field-focus-invalid` (`--color-error` at 18%). Forced colors drop the inset line, so a focused field there draws `outline: var(--focus-width) solid Highlight; outline-offset: -1px`.
|
|
@@ -69,7 +70,7 @@ Layer: Core. ui: `UiButton`.
|
|
|
69
70
|
|
|
70
71
|
Layer: Core. ui: the `fg-quiet-action` class.
|
|
71
72
|
|
|
72
|
-
- **Anatomy.** A native `<button>`, or the `<summary>` of a menu. Transparent fill, a transparent 1px border, `--radius-control`, and `--color-muted`. The content is centred in the box. An icon-only action holds an SVG icon, never a text glyph such as ×, because a font draws a glyph's ink off the centre of its box. Give the shared recipe zero specificity (`:where()`), so each component sets the action's size, place, and resting colour.
|
|
73
|
+
- **Anatomy.** A native `<button>`, or the `<summary>` of a menu. Transparent fill, a transparent 1px border, `--radius-control`, and `--color-muted`. The project trigger overrides the corner with `--radius-field`, because it opens a menu and does not act (see [Site header](#site-header)). The content is centred in the box. An icon-only action holds an SVG icon, never a text glyph such as ×, because a font draws a glyph's ink off the centre of its box. Give the shared recipe zero specificity (`:where()`), so each component sets the action's size, place, and resting colour.
|
|
73
74
|
- **States.** Hover turns the text `--color-text` and fills `currentColor` at 12% over transparent. Pressed fills `currentColor` at 18%, with no sink. Focus-visible is the focus ring, inset where the parent clips. An open menu keeps its trigger at the 12% tint, below the press. The code block's Copy keeps the block's text colour on hover. A disabled quiet action follows the shared [disabled](#rules-for-every-control) rule.
|
|
74
75
|
- **Do.** Use it for an action inside a component: Copy in a code block or command list, close in a dialog or drawer, Full size on a capture, and the project trigger.
|
|
75
76
|
- **Don't.** An action that stands on its own in the page, such as Save or Next. That is a button.
|
|
@@ -304,7 +305,7 @@ Layer: Core. The mono font on rail rows is identity. ui: the rows in `UiSiteNav`
|
|
|
304
305
|
- **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.
|
|
305
306
|
- **Do.** Label a page link with the destination page's title, and an in-page link with its destination section's heading.
|
|
306
307
|
- **Don't.** Actions such as Delete or Sign out in a navigation list. Every row is a link to a place; an action is a button.
|
|
307
|
-
- **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.
|
|
308
|
+
- **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. It shows the page's contents and does not act, so it takes the 10px field corner (`--radius-field`), at rest and pressed. The icon-only Menu button stays round. 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. It takes the same 10px field corner. Only the chevron is local.
|
|
308
309
|
- **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.
|
|
309
310
|
- **Keyboard and screen reader.** Plain links in Tab order.
|
|
310
311
|
- **Motion.** Fill, colour, and shadow change over `--duration-fast` with `--ease-out`.
|
|
@@ -380,7 +381,7 @@ Layer: Core. ui: `UiTabs`.
|
|
|
380
381
|
|
|
381
382
|
Layer: Core. ui: the `fg-site-skip` class.
|
|
382
383
|
|
|
383
|
-
- **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.
|
|
384
|
+
- **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. It takes the field corner, not the 16px corner of other floating layers, because it is a one-line control that is not an action.
|
|
384
385
|
- **States.** Hidden above the page at rest, and shown at the top left while it has focus.
|
|
385
386
|
- **Do.** A "Skip to content" link on every page with a header or rail before `main`; the first Tab shows it.
|
|
386
387
|
- **Don't.** Hiding it with `display: none`, which also takes it out of the Tab order.
|
|
@@ -460,7 +461,7 @@ Layer: Identity. ui: `UiCapture`.
|
|
|
460
461
|
|
|
461
462
|
Layer: Identity. ui: `UiSiteHeader`, `UiSiteAppearancePicker`.
|
|
462
463
|
|
|
463
|
-
- **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 concentric 12px corners (`calc(var(--radius-panel) - var(--space-1))`), 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.
|
|
464
|
+
- **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. It keeps the quiet-action tint, but it opens a menu and does not act, so it takes the 10px field corner (`--radius-field`), as a select does. 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 concentric 12px corners (`calc(var(--radius-panel) - var(--space-1))`), 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.
|
|
464
465
|
- **States.** The project menu is closed or open; while open, its summary keeps the quiet action's hover tint. Site links take the navigation row states.
|
|
465
466
|
- **Do.** Keep the same header and site links, six at most and in one order, on every page of a personal product site.
|
|
466
467
|
- **Don't.** The site header on an application screen. An application keeps its own navigation.
|
package/language/decisions.md
CHANGED
|
@@ -10,7 +10,7 @@ Each entry records a choice this language made, the options it rejected, and why
|
|
|
10
10
|
| Danger button | Core | A raised `--color-error-surface` button with danger-tinted text, mixed toward `--color-text` as status badges are. Hover and press deepen the tint, and press sinks it. The label must read at 4.5:1 on all three fills; where the mix misses, it falls back to `--color-text`, black, or white. | A flat button with `--color-text` and a hover border read as a pink secondary button, and pressing it showed nothing. | label contrast on all three fills: `tests/catalogue/catalogue.spec.ts` "contrast: every enabled danger button label reaches 4.5:1"; fills, raise, and sink: no test yet |
|
|
11
11
|
| Pressed button | Core | Every variant but text sinks 1px, takes `--shadow-sink`, and changes its fill. Press is a button state: other controls show their latched state, and quiet actions tint without sinking. | The sink shadow alone was too faint to show a click, especially on secondary and ghost. | rule present: `tests/design-foundations.test.mjs` "every state rule the guard requires exists in the catalogue"; 1px move, sink, and fill: no test yet |
|
|
12
12
|
| Busy button | Core | Busy also disables the button, so it takes no hover or press. | A busy button that still hovered and pressed looked ready for a second click. | No test yet |
|
|
13
|
-
| Quiet actions | Core | One recipe for Copy, Full size, dialog and drawer close, and the project trigger: transparent, `currentColor` at 12% on hover and 18% pressed, no sink, and the control ring. | Each had its own hover (`--color-row-hover`, a colour change only, or a 12% tint), so the same kind of action behaved differently. | rule present: `tests/design-foundations.test.mjs` "every state rule the guard requires exists in the catalogue"; tint recipe: no test yet |
|
|
13
|
+
| Quiet actions | Core | One recipe for Copy, Full size, dialog and drawer close, and the project trigger: transparent, `currentColor` at 12% on hover and 18% pressed, no sink, and the control ring. The project trigger keeps the tint but takes the field corner (see One-line non-action controls). | Each had its own hover (`--color-row-hover`, a colour change only, or a 12% tint), so the same kind of action behaved differently. | rule present: `tests/design-foundations.test.mjs` "every state rule the guard requires exists in the catalogue"; tint recipe: no test yet |
|
|
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. | copied rules unchanged: `tests/design-foundations.test.mjs` "example pages copy the catalogue rules for the shared controls and components they use unchanged" |
|
|
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. | No test yet |
|
|
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. | text and prompt contrast: `tests/catalogue/catalogue.spec.ts` "contrast: the command plate text reaches 4.5:1", "contrast: the command plate prompt reaches 3:1"; plate tint: no test yet |
|
|
@@ -20,9 +20,10 @@ Each entry records a choice this language made, the options it rejected, and why
|
|
|
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. | No test yet |
|
|
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. | label contrast: `tests/catalogue/catalogue.spec.ts` "contrast: every selected segmented label on its thumb reaches 4.5:1"; icon at 3:1: no test yet |
|
|
22
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. | No test yet |
|
|
23
|
-
| Shape follows role | Core | A pill acts, or sets a value on one line (`--radius-control`). Small state marks are pills (`--radius-pill`). Places and picked rows are 6px (`--radius-inline`). Typed fields,
|
|
23
|
+
| Shape follows role | Core | A pill acts, or sets a value in place with every option shown, on one line (`--radius-control`); a select, which opens a list, is a one-line non-action control. Small state marks are pills (`--radius-pill`). Places and picked rows are 6px (`--radius-inline`). Typed fields, controls whose label wraps, and one-line controls that are not actions are 10px (`--radius-field`). Containers are 16px (`--radius-panel`). A pill never holds text that can wrap, and nested rectangles are concentric. The token names predate the rule: they say inline, control, and field, where the uses are rows, pills, and typed fields. The names stay, because a rename breaks every page that uses them. | One shape for every control. All pills put wrapping labels in pills, which the toggle card, fields, and the raised pill row already rejected; all rectangles lose the shape that marks an action. A list of components for each token with no reason: a new component had no rule to pick from, and a reader took a 6px row beside a pill for an error. | rendered corners by role: `tests/catalogue/catalogue.spec.ts` "each component renders the corner radius of its role, and no other part has one", "the DESIGN.md shape table names each role token with its value"; slider track and thumb, and select picker: `tests/design-foundations.test.mjs` "the slider track, slider thumb, and select picker take their role’s corners"; no literal radius: `tests/design-foundations.test.mjs` "no page or the report stylesheet writes a literal corner radius" |
|
|
24
24
|
| Navigation row corners | Core | Navigation rows, header and strip rows, list-selection rows, collapsible group labels, and tabs take 6px corners (`--radius-inline`), except rows inside a floating menu (see Floating-menu rows). The owner chose the more rectangular rows from the Gate M mockup (2026-11-09). | 10px (`--radius-field`), the previous corners, shared with fields. | 6px corners: `tests/catalogue/catalogue.spec.ts` "each component renders the corner radius of its role, and no other part has one"; Foundations swatch: `tests/design-foundations.test.mjs` "the Foundations current-row swatch and radius list follow the navigation row radius" |
|
|
25
25
|
| Floating-menu rows | Core | Rows inside a floating menu, such as the project menu, are concentric with the 16px menu: `calc(var(--radius-panel) - var(--space-1))`, 12px, as select picker rows are. The owner approved it from the DS-3b comparison. | 6px like rail rows: a 6px row inside a 16px panel looks pinched. | 12px corners: `tests/catalogue/catalogue.spec.ts` "each component renders the corner radius of its role, and no other part has one" |
|
|
26
|
+
| One-line non-action controls | Core | A one-line control that is not an action takes the 10px field corner (`--radius-field`), as a select does: the select, the project-menu trigger, the labelled contents trigger and its no-JavaScript summary ("On this page"), and the skip link. The project trigger keeps the quiet-action tint. The icon-only Menu button stays round. The owner chose it on 2026-11-10. | The pill (`--radius-control`): a pill means an action, and these controls open a menu or list, pick a value, or move focus. 16px (`--radius-panel`), like the menu and other floating layers: on a one-line control 40 to 44px tall it reads almost as a pill. | 10px corners: `tests/catalogue/catalogue.spec.ts` "each component renders the corner radius of its role, and no other part has one" |
|
|
26
27
|
| 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. | label inside the fill, and level with the strip: `tests/site/site.spec.ts` "a wrapped navigation row or crumb keeps its label inside the fill and focus ring in ${colorScheme}", "the breadcrumb's labels sit level with the header strip in ${colorScheme}" |
|
|
27
28
|
| 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. | rule present on pages: `tests/design-foundations.test.mjs` "example pages copy the state rules of every component variant their markup uses"; recipe: no test yet |
|
|
28
29
|
| 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. | glide and reduced motion: `tests/catalogue/catalogue.spec.ts` "the tab fill glides to the new tab", "the tab fill moves at once" |
|
|
@@ -130,10 +131,6 @@ Prose patterns moved with the names: `--*-soft` is now `--color-*-surface`, and
|
|
|
130
131
|
| `--field-shadow-focus-invalid` | `--shadow-field-focus-invalid` |
|
|
131
132
|
<!-- rename-table:end -->
|
|
132
133
|
|
|
133
|
-
## Open questions
|
|
134
|
-
|
|
135
|
-
- The skip link: a floating layer, so the shape rule gives it `--radius-panel` (16px). It keeps `--radius-field` (10px) until the owner picks.
|
|
136
|
-
|
|
137
134
|
## Known gaps
|
|
138
135
|
|
|
139
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.
|
package/language/docs.html
CHANGED
|
@@ -15,7 +15,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
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
|
-
.navlist a
|
|
18
|
+
.navlist a.is-hover { background: var(--color-row-hover); color: var(--color-text); text-decoration: none; }
|
|
19
|
+
@media (hover: hover) { .navlist a:hover { background: var(--color-row-hover); color: var(--color-text); text-decoration: none; } }
|
|
19
20
|
.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
21
|
.navlist a[aria-current="location"] { color: var(--color-text); font-weight: var(--weight-medium); }
|
|
21
22
|
.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); }
|
|
@@ -43,7 +44,8 @@ p { max-width: var(--measure); color: var(--color-muted); font-size: var(--text-
|
|
|
43
44
|
.command pre { min-width: 0; flex: 1; margin: 0; overflow-x: auto; font-size: var(--text-sm); }
|
|
44
45
|
/* Copy is a quiet action: components.html#quiet-action, unchanged. The page adds its size and colour only. */
|
|
45
46
|
:where(.quiet-action) { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: var(--radius-control); background: transparent; font: inherit; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out); }
|
|
46
|
-
.quiet-action
|
|
47
|
+
.quiet-action.is-hover:where(:not(:disabled)) { color: var(--color-text); background: color-mix(in srgb, currentColor 12%, transparent); }
|
|
48
|
+
@media (hover: hover) { .quiet-action:hover:where(:not(:disabled)) { color: var(--color-text); background: color-mix(in srgb, currentColor 12%, transparent); } }
|
|
47
49
|
.quiet-action:is(:active, .is-active):where(:not(:disabled)) { background: color-mix(in srgb, currentColor 18%, transparent); }
|
|
48
50
|
.quiet-action:disabled { opacity: 0.58; cursor: not-allowed; }
|
|
49
51
|
.command button { flex: none; min-width: var(--control-lg); min-height: var(--control-lg); color: var(--color-terminal-caption-text); }
|
package/language/product.html
CHANGED
|
@@ -20,7 +20,8 @@ h1 { max-width: 18ch; font-size: var(--text-display); letter-spacing: var(--trac
|
|
|
20
20
|
/* The one primary action: components.html#button, unchanged. The page adds layout only. */
|
|
21
21
|
.btn { --depth: var(--shadow-raise); display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--control-md); padding: 0 var(--space-3); border: 1px solid transparent; border-radius: var(--radius-control); background: var(--color-accent); color: var(--color-accent-text); box-shadow: var(--depth); font: var(--weight-medium) var(--text-md) / 1.25 var(--font-ui); letter-spacing: -0.01em; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out); }
|
|
22
22
|
.btn[data-size="lg"] { min-height: var(--control-lg); padding: 0 var(--space-4); font-size: var(--text-lg); }
|
|
23
|
-
.btn
|
|
23
|
+
.btn.is-hover:not(:disabled) { background: var(--color-button-hover); }
|
|
24
|
+
@media (hover: hover) { .btn:hover:not(:disabled) { background: var(--color-button-hover); } }
|
|
24
25
|
.btn:not(.secondary, .ghost, .danger, .text):is(:active, [aria-pressed="true"], .is-active):not(:disabled) { background: var(--color-button-hover); }
|
|
25
26
|
.btn:not(.text):is(:active, [aria-pressed="true"], .is-active):not(:disabled) { --depth: var(--shadow-sink); transform: translateY(1px); }
|
|
26
27
|
a.btn { text-decoration: none; }
|
package/language/reference.html
CHANGED
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
.navlist { display: grid; gap: 0.125rem; width: min(100%, 240px); }
|
|
21
21
|
.navlist .group-label { padding: 0 var(--space-3) var(--space-1); color: var(--color-muted); font-size: var(--text-xs); font-weight: var(--weight-semibold); }
|
|
22
22
|
.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); }
|
|
23
|
-
.navlist a
|
|
23
|
+
.navlist a.is-hover { background: var(--color-row-hover); color: var(--color-text); text-decoration: none; }
|
|
24
|
+
@media (hover: hover) { .navlist a:hover { background: var(--color-row-hover); color: var(--color-text); text-decoration: none; } }
|
|
24
25
|
/* The Foundations specimens share the current-page and location rules, forced colors included. */
|
|
25
26
|
.navlist a[aria-current="page"], .nav-current-sample { background: var(--color-nav-current); box-shadow: var(--shadow-nav-current); color: var(--color-nav-current-text); font-weight: var(--weight-medium); }
|
|
26
27
|
.navlist a[aria-current="location"], .pip-sample { color: var(--color-text); font-weight: var(--weight-medium); }
|
|
@@ -66,17 +67,21 @@
|
|
|
66
67
|
/* Buttons and quiet actions: components.html#button and #quiet-action, unchanged. The page adds layout only. */
|
|
67
68
|
.btn { --depth: var(--shadow-raise); display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--control-md); padding: 0 var(--space-3); border: 1px solid transparent; border-radius: var(--radius-control); background: var(--color-accent); color: var(--color-accent-text); box-shadow: var(--depth); font: var(--weight-medium) var(--text-md) / 1.25 var(--font-ui); letter-spacing: -0.01em; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out); }
|
|
68
69
|
.btn[data-size="sm"] { min-height: var(--control-sm); padding: 0 0.625rem; font-size: var(--text-sm); }
|
|
69
|
-
.btn
|
|
70
|
+
.btn.is-hover:not(:disabled) { background: var(--color-button-hover); }
|
|
71
|
+
@media (hover: hover) { .btn:hover:not(:disabled) { background: var(--color-button-hover); } }
|
|
70
72
|
.btn.secondary { background: var(--color-control-thumb); color: var(--color-text); }
|
|
71
|
-
.btn.secondary
|
|
73
|
+
.btn.secondary.is-hover:not(:disabled) { background: color-mix(in srgb, var(--color-text) 8%, var(--color-control-thumb)); }
|
|
74
|
+
@media (hover: hover) { .btn.secondary:hover:not(:disabled) { background: color-mix(in srgb, var(--color-text) 8%, var(--color-control-thumb)); } }
|
|
72
75
|
.btn.ghost { --depth: none; background: transparent; color: var(--color-muted); }
|
|
73
|
-
.btn.ghost
|
|
76
|
+
.btn.ghost.is-hover:not(:disabled) { background: var(--color-row-hover); color: var(--color-text); }
|
|
77
|
+
@media (hover: hover) { .btn.ghost:hover:not(:disabled) { background: var(--color-row-hover); color: var(--color-text); } }
|
|
74
78
|
.btn:not(.secondary, .ghost, .danger, .text):is(:active, [aria-pressed="true"], .is-active):not(:disabled) { background: var(--color-button-hover); }
|
|
75
79
|
.btn:is(.secondary, .ghost):is(:active, [aria-pressed="true"], .is-active):not(:disabled) { background: var(--color-well); }
|
|
76
80
|
.btn:not(.text):is(:active, [aria-pressed="true"], .is-active):not(:disabled) { --depth: var(--shadow-sink); transform: translateY(1px); }
|
|
77
81
|
.btn:disabled { --depth: none; opacity: 0.58; cursor: not-allowed; }
|
|
78
82
|
:where(.quiet-action) { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: var(--radius-control); background: transparent; font: inherit; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out); }
|
|
79
|
-
.quiet-action
|
|
83
|
+
.quiet-action.is-hover:where(:not(:disabled)) { color: var(--color-text); background: color-mix(in srgb, currentColor 12%, transparent); }
|
|
84
|
+
@media (hover: hover) { .quiet-action:hover:where(:not(:disabled)) { color: var(--color-text); background: color-mix(in srgb, currentColor 12%, transparent); } }
|
|
80
85
|
.quiet-action:is(:active, .is-active):where(:not(:disabled)) { background: color-mix(in srgb, currentColor 18%, transparent); }
|
|
81
86
|
.quiet-action:disabled { opacity: 0.58; cursor: not-allowed; }
|
|
82
87
|
/* .is-focus pins the focus state in the Focus and motion specimens. */
|
|
@@ -94,17 +99,18 @@
|
|
|
94
99
|
.search input::placeholder { color: var(--color-muted); }
|
|
95
100
|
/* The native clear button, quieted to a thin muted cross drawn with a mask. */
|
|
96
101
|
.search input::-webkit-search-cancel-button { width: 0.75rem; height: 0.75rem; margin-inline-start: var(--space-2); background: var(--color-muted); cursor: pointer; -webkit-appearance: none; appearance: none; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 2.5l7 7m0-7l-7 7' stroke='black' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }
|
|
97
|
-
.search input:where(:not(:disabled))::-webkit-search-cancel-button:hover { background: var(--color-text); }
|
|
102
|
+
@media (hover: hover) { .search input:where(:not(:disabled))::-webkit-search-cancel-button:hover { background: var(--color-text); } }
|
|
98
103
|
/* Forced colors would drop the masked fill, so the cross opts out and takes the system text colour. */
|
|
99
104
|
/* Forced colors drop the inset line, so the focused field draws the system ring just inside its edge. */
|
|
100
105
|
@media (forced-colors: active) { .search:is(:has(input:focus-visible), .is-focus) { outline: var(--focus-width) solid Highlight; outline-offset: -1px; } }
|
|
101
|
-
@media (forced-colors: active) { .search input::-webkit-search-cancel-button
|
|
106
|
+
@media (forced-colors: active) { .search input::-webkit-search-cancel-button { forced-color-adjust: none; background: CanvasText; } @media (hover: hover) { .search input:where(:not(:disabled))::-webkit-search-cancel-button:hover { forced-color-adjust: none; background: CanvasText; } } }
|
|
102
107
|
kbd { font-size: var(--text-xs); color: var(--color-muted); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-inline); padding: 0 var(--space-1); line-height: 1.125rem; background: var(--color-surface-raised); }
|
|
103
108
|
|
|
104
109
|
/* Tabs, for the Foundations specimens: components.html#tabs, unchanged. */
|
|
105
110
|
.tablist { --glide-lead: 260ms; --glide-trail: 300ms; display: flex; width: max-content; max-width: 100%; overflow-x: auto; padding: var(--space-1); isolation: isolate; }
|
|
106
111
|
.tab { position: relative; flex: none; min-height: var(--control-md); padding: var(--space-2) var(--space-3); border: 0; border-radius: var(--radius-inline); background: transparent; color: var(--color-muted); font: var(--weight-medium) var(--text-md) / var(--leading) var(--font-ui); white-space: nowrap; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out); }
|
|
107
|
-
.tab
|
|
112
|
+
.tab.is-hover:where(:not(:disabled)) { background: var(--color-row-hover); color: var(--color-text); }
|
|
113
|
+
@media (hover: hover) { .tab:hover:where(:not(:disabled)) { background: var(--color-row-hover); color: var(--color-text); } }
|
|
108
114
|
/* The selected tab takes the navigation row's lifted fill: one selected state for both. The fill is a
|
|
109
115
|
::before layer behind the label; in the catalogue it glides between tabs. */
|
|
110
116
|
.tab[aria-selected="true"] { background: transparent; color: var(--color-nav-current-text); }
|
|
@@ -123,8 +129,10 @@
|
|
|
123
129
|
.segmented[data-icon-only] button { width: var(--item); padding: 0; }
|
|
124
130
|
/* The thumb is inset inside each full-size button, so it floats on the track and the hit area keeps its size. */
|
|
125
131
|
.segmented button::before { content: ""; position: absolute; inset: 2px; z-index: -2; border-radius: var(--radius-control); pointer-events: none; }
|
|
126
|
-
.segmented button
|
|
127
|
-
|
|
132
|
+
.segmented button.is-hover:not(:disabled, [aria-pressed="true"]) { color: var(--color-text); }
|
|
133
|
+
@media (hover: hover) { .segmented button:hover:not(:disabled, [aria-pressed="true"]) { color: var(--color-text); } }
|
|
134
|
+
.segmented button.is-hover:not(:disabled, [aria-pressed="true"])::before { background: color-mix(in srgb, var(--color-control-thumb) 45%, transparent); }
|
|
135
|
+
@media (hover: hover) { .segmented button:hover:not(:disabled, [aria-pressed="true"])::before { background: color-mix(in srgb, var(--color-control-thumb) 45%, transparent); } }
|
|
128
136
|
/* The pressed label reads at 4.5:1 on its thumb, and an icon at 3:1 (--color-segmented-current-text). */
|
|
129
137
|
.segmented button[aria-pressed="true"] { color: var(--color-segmented-current-text); }
|
|
130
138
|
.segmented button[aria-pressed="true"]::before { z-index: -1; background: var(--color-control-thumb); box-shadow: var(--shadow-raise); }
|
|
@@ -171,9 +179,13 @@
|
|
|
171
179
|
/* List selection: components.html#navigation-list. Dividers are straight lines inset by the row
|
|
172
180
|
padding; a filled row (hovered or selected) hides the divider above it and the one below it. */
|
|
173
181
|
.row + .row::before { content: ""; position: absolute; inset: 0 var(--space-3) auto; border-top: 1px solid var(--color-border-subtle); }
|
|
174
|
-
.row
|
|
175
|
-
.row
|
|
176
|
-
|
|
182
|
+
.row[aria-selected="true"]::before,
|
|
183
|
+
.row[aria-selected="true"] + .row::before { display: none; }
|
|
184
|
+
@media (hover: hover) {
|
|
185
|
+
.row:hover:where(:not(:disabled))::before,
|
|
186
|
+
.row:hover:where(:not(:disabled)) + .row::before { display: none; }
|
|
187
|
+
.row:hover:where(:not(:disabled)) { background: var(--color-row-hover); }
|
|
188
|
+
}
|
|
177
189
|
/* The selected row takes the navigation row's current recipe; it comes after hover, so hover keeps the fill. */
|
|
178
190
|
.row[aria-selected="true"] { background: var(--color-nav-current); box-shadow: var(--shadow-nav-current); font-weight: var(--weight-medium); }
|
|
179
191
|
.row[aria-selected="true"] .title { color: var(--color-nav-current-text); }
|
|
@@ -262,7 +274,8 @@
|
|
|
262
274
|
/* Copy is a quiet action; this sets its size and place. */
|
|
263
275
|
.copy { display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem; min-width: var(--control-lg); min-height: var(--control-lg); margin-left: auto; padding: var(--space-1) 0.375rem; color: inherit; }
|
|
264
276
|
/* The code block has its own palette, so its Copy keeps the plate's text colour on hover. */
|
|
265
|
-
.code .copy
|
|
277
|
+
.code .copy.is-hover:where(:not(:disabled)) { color: inherit; }
|
|
278
|
+
@media (hover: hover) { .code .copy:hover:where(:not(:disabled)) { color: inherit; } }
|
|
266
279
|
/* Inset: the code block clips its content. */
|
|
267
280
|
.code pre:is(:focus-visible, .is-focus) { outline: var(--focus-width) solid var(--color-focus); outline-offset: calc(var(--focus-width) * -1); }
|
|
268
281
|
.code .copy.quiet-action:is(:focus-visible, .is-focus) { outline-offset: calc(var(--focus-width) * -1); }
|
|
@@ -669,8 +682,8 @@
|
|
|
669
682
|
<p class="note">Pill buttons, rounded fields and toggle cards, large-radius panels, and inline corners. Cards never take a pill.</p>
|
|
670
683
|
<ul class="specs">
|
|
671
684
|
<li class="spec" data-token="--radius-inline"><div class="spec-meta"><code>--radius-inline</code><span class="value"></span><span class="use">Places and picked rows: navigation rows, tabs, list rows, breadcrumb links, checkboxes, and keyboard keys</span></div><i class="shape-box" style="border-radius:var(--radius-inline)"></i></li>
|
|
672
|
-
<li class="spec" data-token="--radius-field"><div class="spec-meta"><code>--radius-field</code><span class="value"></span><span class="use">Typed fields
|
|
673
|
-
<li class="spec" data-token="--radius-control"><div class="spec-meta"><code>--radius-control</code><span class="value"></span><span class="use">Pills that act or set a value: buttons, quiet actions, segmented controls, and their thumbs</span></div><i class="shape-box" style="border-radius:var(--radius-control)"></i></li>
|
|
685
|
+
<li class="spec" data-token="--radius-field"><div class="spec-meta"><code>--radius-field</code><span class="value"></span><span class="use">Typed fields, controls whose label wraps, and one-line controls that are not actions: inputs, selects, textareas, toggle cards, pager links, the project-menu trigger, the labelled contents trigger and its no-JavaScript summary, and the skip link</span></div><i class="shape-box" style="border-radius:var(--radius-field)"></i></li>
|
|
686
|
+
<li class="spec" data-token="--radius-control"><div class="spec-meta"><code>--radius-control</code><span class="value"></span><span class="use">Pills that act, or set a value in place with every option shown: buttons other than the labelled contents trigger, quiet actions other than the project-menu trigger, segmented controls, and their thumbs</span></div><i class="shape-box" style="border-radius:var(--radius-control)"></i></li>
|
|
674
687
|
<li class="spec" data-token="--radius-panel"><div class="spec-meta"><code>--radius-panel</code><span class="value"></span><span class="use">Containers: wells, plates, panels, radio cards, alerts, and floating layers</span></div><i class="shape-box" style="border-radius:var(--radius-panel)"></i></li>
|
|
675
688
|
<li class="spec" data-token="--radius-pill"><div class="spec-meta"><code>--radius-pill</code><span class="value"></span><span class="use">Small state marks: status badges, switch tracks, slider and progress tracks, and score pips</span></div><i class="shape-box" style="border-radius:var(--radius-pill)"></i></li>
|
|
676
689
|
</ul>
|