@filipgutica/design-system 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -14
- package/dist/class/base.css +188 -0
- package/dist/class/themes/graphite-indigo.css +133 -0
- package/dist/themes/graphite-indigo.css +9 -0
- package/dist/tokens.d.ts +117 -0
- package/dist/tokens.js +222 -0
- package/dist/tokens.json +218 -0
- package/fonts/OFL-IBM-Plex-Mono.txt +93 -0
- package/fonts/OFL-IBM-Plex-Sans.txt +93 -0
- package/fonts/fonts.css +55 -0
- package/fonts/ibm-plex-mono-latin-400-normal.woff2 +0 -0
- package/fonts/ibm-plex-mono-latin-500-normal.woff2 +0 -0
- package/fonts/ibm-plex-mono-latin-600-normal.woff2 +0 -0
- package/fonts/ibm-plex-sans-latin-400-normal.woff2 +0 -0
- package/fonts/ibm-plex-sans-latin-500-normal.woff2 +0 -0
- package/fonts/ibm-plex-sans-latin-600-normal.woff2 +0 -0
- package/language/DESIGN.md +88 -33
- package/language/components.html +1059 -409
- package/language/components.md +291 -103
- package/language/decisions.md +133 -34
- package/language/docs.html +29 -25
- package/language/implementations.json +85 -0
- package/language/product.html +22 -22
- package/language/reference.html +238 -227
- package/language/tokens.css +142 -143
- package/language/visualizations/build-count-report.mjs +4 -2
- package/language/visualizations/report.css +2 -2
- package/package.json +37 -6
- package/scripts/build-tokens.mjs +0 -236
- package/tokens/graphite-indigo.json +0 -298
- /package/language/{themes → editor-themes}/graphite-indigo/LICENSE +0 -0
- /package/language/{themes → editor-themes}/graphite-indigo/README.md +0 -0
- /package/language/{themes → editor-themes}/graphite-indigo/SOURCE.json +0 -0
- /package/language/{themes → editor-themes}/graphite-indigo/THIRD_PARTY_NOTICES.md +0 -0
- /package/language/{themes → editor-themes}/graphite-indigo/graphite-indigo.t3-theme.json +0 -0
- /package/language/{themes → editor-themes}/graphite-indigo/package.json +0 -0
- /package/language/{themes → editor-themes}/graphite-indigo/themes/graphite-indigo-dark-color-theme.json +0 -0
- /package/language/{themes → editor-themes}/graphite-indigo/themes/graphite-indigo-light-color-theme.json +0 -0
package/language/components.html
CHANGED
|
@@ -20,28 +20,28 @@
|
|
|
20
20
|
/* ---------- Shared recipes ---------- */
|
|
21
21
|
.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
|
|
22
22
|
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
23
|
-
.muted { color: var(--
|
|
23
|
+
.muted { color: var(--color-muted); }
|
|
24
24
|
|
|
25
25
|
/* ================= Core ================= */
|
|
26
26
|
|
|
27
27
|
/* Button */
|
|
28
|
-
.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-
|
|
28
|
+
.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
29
|
.btn[data-size="sm"] { min-height: var(--control-sm); padding: 0 0.625rem; font-size: var(--text-sm); }
|
|
30
30
|
.btn[data-size="lg"] { min-height: var(--control-lg); padding: 0 var(--space-4); font-size: var(--text-lg); }
|
|
31
|
-
.btn:is(:hover, .is-hover):not(:disabled) { background: var(--button-hover); }
|
|
32
|
-
.btn.secondary { background: var(--control-thumb); color: var(--text); }
|
|
33
|
-
.btn.secondary:is(:hover, .is-hover):not(:disabled) { background: color-mix(in srgb, var(--text) 8%, var(--control-thumb)); }
|
|
34
|
-
.btn.ghost { --depth: none; background: transparent; color: var(--
|
|
35
|
-
.btn.ghost:is(:hover, .is-hover):not(:disabled) { background: var(--row-hover); color: var(--text); }
|
|
36
|
-
/* Danger rises like the other filled variants; its text mixes the hue toward --text, as status badges do. */
|
|
37
|
-
.btn.danger { background: var(--
|
|
38
|
-
.btn.danger:is(:hover, .is-hover):not(:disabled) { background: color-mix(in srgb, var(--
|
|
39
|
-
.btn.text { --depth: none; min-height: auto; padding: var(--space-1); background: transparent; color: var(--link); text-decoration: underline; text-underline-offset: 0.2em; }
|
|
31
|
+
.btn:is(:hover, .is-hover):not(:disabled) { background: var(--color-button-hover); }
|
|
32
|
+
.btn.secondary { background: var(--color-control-thumb); color: var(--color-text); }
|
|
33
|
+
.btn.secondary:is(:hover, .is-hover):not(:disabled) { background: color-mix(in srgb, var(--color-text) 8%, var(--color-control-thumb)); }
|
|
34
|
+
.btn.ghost { --depth: none; background: transparent; color: var(--color-muted); }
|
|
35
|
+
.btn.ghost:is(:hover, .is-hover):not(:disabled) { background: var(--color-row-hover); color: var(--color-text); }
|
|
36
|
+
/* Danger rises like the other filled variants; its text mixes the hue toward --color-text, as status badges do. */
|
|
37
|
+
.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:is(:hover, .is-hover):not(:disabled) { background: color-mix(in srgb, var(--color-error) 10%, var(--color-error-surface)); }
|
|
39
|
+
.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
40
|
.btn.text:is(:hover, .is-hover):not(:disabled) { background: transparent; }
|
|
41
41
|
/* A press sinks the button 1px and changes its fill, so the click reads at a glance. */
|
|
42
|
-
.btn:not(.secondary, .ghost, .danger, .text):is(:active, [aria-pressed="true"], .is-active):not(:disabled) { background: var(--button-hover); }
|
|
43
|
-
.btn:is(.secondary, .ghost):is(:active, [aria-pressed="true"], .is-active):not(:disabled) { background: var(--
|
|
44
|
-
.btn.danger:is(:active, [aria-pressed="true"], .is-active):not(:disabled) { background: color-mix(in srgb, var(--
|
|
42
|
+
.btn:not(.secondary, .ghost, .danger, .text):is(:active, [aria-pressed="true"], .is-active):not(:disabled) { background: var(--color-button-hover); }
|
|
43
|
+
.btn:is(.secondary, .ghost):is(:active, [aria-pressed="true"], .is-active):not(:disabled) { background: var(--color-well); }
|
|
44
|
+
.btn.danger:is(:active, [aria-pressed="true"], .is-active):not(:disabled) { background: color-mix(in srgb, var(--color-error) 16%, var(--color-error-surface)); }
|
|
45
45
|
.btn:not(.text):is(:active, [aria-pressed="true"], .is-active):not(:disabled) { --depth: var(--shadow-sink); transform: translateY(1px); }
|
|
46
46
|
.btn:disabled { --depth: none; opacity: 0.58; cursor: not-allowed; }
|
|
47
47
|
/* A link styled as a button keeps no underline. It has no disabled state: use <button disabled>. */
|
|
@@ -58,22 +58,22 @@
|
|
|
58
58
|
The recipe centres its content, so an icon-only action's SVG sits on the box centre. Use an SVG icon,
|
|
59
59
|
never a text glyph such as ×: a font draws a glyph's ink off its box centre.
|
|
60
60
|
:where keeps the base below each component's own size and layout. */
|
|
61
|
-
:where(.quiet-action) { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: var(--radius-
|
|
62
|
-
.quiet-action:is(:hover, .is-hover):where(:not(:disabled)) { color: var(--text); background: color-mix(in srgb, currentColor 12%, transparent); }
|
|
61
|
+
: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:is(:hover, .is-hover):where(:not(:disabled)) { color: var(--color-text); background: color-mix(in srgb, currentColor 12%, transparent); }
|
|
63
63
|
.quiet-action:is(:active, .is-active):where(:not(:disabled)) { background: color-mix(in srgb, currentColor 18%, transparent); }
|
|
64
64
|
.quiet-action:disabled { opacity: 0.58; cursor: not-allowed; }
|
|
65
65
|
|
|
66
66
|
/* Fields: input, textarea, select */
|
|
67
67
|
.field { display: grid; gap: 0.375rem; justify-items: start; min-width: 0; }
|
|
68
68
|
.field-label { font-size: var(--text-sm); font-weight: var(--weight-semibold); }
|
|
69
|
-
.field-description { font-size: var(--text-sm); color: var(--
|
|
70
|
-
.field-error { font-size: var(--text-sm); color: var(--
|
|
71
|
-
.input, .select, .textarea { --depth: var(--field
|
|
69
|
+
.field-description { font-size: var(--text-sm); color: var(--color-muted); }
|
|
70
|
+
.field-error { font-size: var(--text-sm); color: var(--color-error); }
|
|
71
|
+
.input, .select, .textarea { --depth: var(--shadow-field); width: 100%; border: 1px solid var(--color-field-edge); border-radius: var(--radius-field); background: var(--color-field-bg); box-shadow: var(--depth); color: var(--color-text); font: var(--text-md) / 1.35 var(--font-ui); }
|
|
72
72
|
.input, .select { height: var(--control-md); padding: 0 0.625rem; }
|
|
73
73
|
.input[data-size="sm"], .select[data-size="sm"] { height: var(--control-sm); padding-inline: 0.5625rem; font-size: var(--text-sm); }
|
|
74
74
|
.input[data-size="lg"], .select[data-size="lg"] { height: var(--control-lg); padding-inline: 0.6875rem; font-size: var(--text-lg); }
|
|
75
75
|
.textarea { display: block; min-height: 5.5rem; padding: 0.625rem; resize: vertical; }
|
|
76
|
-
:is(.input, .textarea)::placeholder { color: var(--
|
|
76
|
+
:is(.input, .textarea)::placeholder { color: var(--color-muted); opacity: 1; }
|
|
77
77
|
/* Every size keeps the trailing room for the chevron. */
|
|
78
78
|
.select, .select[data-size] { padding-right: 1.75rem; }
|
|
79
79
|
/* The chevron is drawn in currentColor, so it follows the text in both themes. */
|
|
@@ -85,57 +85,57 @@
|
|
|
85
85
|
.select { position: relative; display: flex; align-items: center; background-image: none; cursor: pointer; }
|
|
86
86
|
.select:disabled { cursor: not-allowed; }
|
|
87
87
|
.select::picker-icon { display: none; }
|
|
88
|
-
.select::after { content: ""; position: absolute; right: var(--space-3); width: var(--space-2); height: var(--space-2); border-right: 1.5px solid var(--
|
|
89
|
-
.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-
|
|
90
|
-
.select option { min-height: var(--control-sm); padding: var(--space-2) var(--space-3); border-radius: calc(var(--radius-
|
|
91
|
-
.select option:checked { background: var(--row-selected); }
|
|
92
|
-
.select option:hover { background: var(--row-hover); }
|
|
88
|
+
.select::after { content: ""; position: absolute; right: var(--space-3); width: var(--space-2); height: var(--space-2); border-right: 1.5px solid var(--color-muted); border-bottom: 1.5px solid var(--color-muted); transform: translateY(-2px) rotate(45deg); }
|
|
89
|
+
.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
|
+
.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
|
+
.select option:checked { background: var(--color-row-selected); }
|
|
92
|
+
.select option:hover:where(:not(:disabled)) { background: var(--color-row-hover); }
|
|
93
93
|
/* Inset: the picker scrolls. */
|
|
94
|
-
.select option:focus-visible { background: var(--row-hover); outline: var(--focus-width) solid var(--focus); outline-offset: calc(var(--focus-width) * -1); }
|
|
95
|
-
.select option::checkmark { order: 1; margin-left: auto; color: var(--accent); }
|
|
94
|
+
.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
|
+
.select option::checkmark { order: 1; margin-left: auto; color: var(--color-accent); }
|
|
96
96
|
@media (pointer: coarse) { .select option { min-height: var(--control-lg); } }
|
|
97
97
|
}
|
|
98
|
-
:is(.input, .select, .textarea)[aria-invalid="true"] { border-color: var(--
|
|
98
|
+
:is(.input, .select, .textarea)[aria-invalid="true"] { border-color: var(--color-error); }
|
|
99
99
|
/* Search: a field wrapper with a leading magnifier. The wrapper carries the field look and the width;
|
|
100
100
|
the input inside takes the free space, so the clear cross sits at the trailing edge. */
|
|
101
|
-
.search { display: flex; align-items: center; gap: var(--space-2); height: var(--control-sm); padding: 0 var(--space-2); border: 1px solid var(--field-edge); border-radius: var(--radius-field); background: var(--field-bg); box-shadow: var(--field
|
|
102
|
-
.search input { border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: var(--text-sm); flex: 1; min-width: 0; }
|
|
103
|
-
.search input::placeholder { color: var(--
|
|
101
|
+
.search { display: flex; align-items: center; gap: var(--space-2); height: var(--control-sm); padding: 0 var(--space-2); border: 1px solid var(--color-field-edge); border-radius: var(--radius-field); background: var(--color-field-bg); box-shadow: var(--shadow-field); color: var(--color-muted); min-width: 0; }
|
|
102
|
+
.search input { border: 0; outline: 0; background: transparent; color: var(--color-text); font: inherit; font-size: var(--text-sm); flex: 1; min-width: 0; }
|
|
103
|
+
.search input::placeholder { color: var(--color-muted); }
|
|
104
104
|
/* The native search clear button, quieted to a thin muted cross drawn with a mask. */
|
|
105
|
-
.search input::-webkit-search-cancel-button { width: 0.75rem; height: 0.75rem; margin-inline-start: var(--space-2); background: var(--
|
|
106
|
-
.search input::-webkit-search-cancel-button:hover { background: var(--text); }
|
|
105
|
+
.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); }
|
|
107
107
|
/* 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
|
-
:is(.input, .select, .textarea):disabled { background-color: var(--
|
|
108
|
+
:is(.input, .select, .textarea):disabled { background-color: var(--color-well); box-shadow: none; opacity: 0.58; cursor: not-allowed; }
|
|
109
109
|
/* A static drawing of the open picker; a native select cannot be pinned open. */
|
|
110
|
-
.picker { display: grid; width: 220px; max-width: 100%; margin: 0; padding: var(--space-1); list-style: none; border: 1px solid transparent; border-radius: var(--radius-
|
|
111
|
-
.picker li { display: flex; align-items: center; min-height: var(--control-sm); padding: var(--space-2) var(--space-3); border-radius: calc(var(--radius-
|
|
112
|
-
.picker li.is-hover { background: var(--row-hover); }
|
|
113
|
-
.picker li[aria-selected="true"] { background: var(--row-selected); }
|
|
114
|
-
.picker li[aria-selected="true"]::after { content: "✓"; margin-left: auto; color: var(--accent); }
|
|
110
|
+
.picker { display: grid; width: 220px; max-width: 100%; margin: 0; padding: var(--space-1); list-style: none; border: 1px solid transparent; border-radius: var(--radius-panel); background: var(--color-surface-raised); box-shadow: var(--shadow-dialog); }
|
|
111
|
+
.picker li { display: flex; align-items: center; min-height: var(--control-sm); padding: var(--space-2) var(--space-3); border-radius: calc(var(--radius-panel) - var(--space-1)); }
|
|
112
|
+
.picker li.is-hover { background: var(--color-row-hover); }
|
|
113
|
+
.picker li[aria-selected="true"] { background: var(--color-row-selected); }
|
|
114
|
+
.picker li[aria-selected="true"]::after { content: "✓"; margin-left: auto; color: var(--color-accent); }
|
|
115
115
|
|
|
116
116
|
/* Checkbox and radio: native inputs drawn with tokens. */
|
|
117
117
|
.choices { display: flex; flex-wrap: wrap; gap: var(--space-4); }
|
|
118
118
|
.check { display: inline-flex; align-items: center; gap: 0.5625rem; min-height: var(--control-md); cursor: pointer; }
|
|
119
|
-
.check input { --depth: none; appearance: none; display: grid; place-items: center; flex: none; width: 18px; height: 18px; margin: 0; border: 1px solid var(--border); border-radius: var(--radius-
|
|
119
|
+
.check input { --depth: none; appearance: none; display: grid; place-items: center; flex: none; width: 18px; height: 18px; margin: 0; border: 1px solid var(--color-border); border-radius: var(--radius-inline); background: var(--color-surface-raised); cursor: inherit; }
|
|
120
120
|
.check[data-size="sm"] { min-height: var(--control-sm); font-size: var(--text-sm); }
|
|
121
121
|
.check[data-size="lg"] { min-height: var(--control-lg); font-size: var(--text-lg); }
|
|
122
122
|
.check[data-size="sm"] input { width: 16px; height: 16px; }
|
|
123
123
|
.check[data-size="lg"] input { width: 20px; height: 20px; }
|
|
124
124
|
.check input[type="radio"] { border-radius: 50%; }
|
|
125
|
-
.check input:checked { border-color: var(--accent); background: var(--accent); }
|
|
126
|
-
.check input[type="checkbox"]:checked::before { content: ""; width: 5px; height: 9px; margin-top: -2px; border: solid var(--accent-text); border-width: 0 2px 2px 0; transform: rotate(45deg); }
|
|
127
|
-
.check input[type="radio"]:checked { border-width: 5px; background: var(--surface-raised); }
|
|
125
|
+
.check input:checked { border-color: var(--color-accent); background: var(--color-accent); }
|
|
126
|
+
.check input[type="checkbox"]:checked::before { content: ""; width: 5px; height: 9px; margin-top: -2px; border: solid var(--color-accent-text); border-width: 0 2px 2px 0; transform: rotate(45deg); }
|
|
127
|
+
.check input[type="radio"]:checked { border-width: 5px; background: var(--color-surface-raised); }
|
|
128
128
|
.check:has(input:disabled) { opacity: 0.58; cursor: not-allowed; }
|
|
129
129
|
|
|
130
130
|
/* Radio card: the native radio owns selection; the label owns the card surface. */
|
|
131
131
|
.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
|
-
.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-
|
|
133
|
-
.radio-card:is(:hover, .is-hover):not(:has(input:checked, input:disabled)) { background: color-mix(in srgb, var(--surface-
|
|
132
|
+
.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:is(:hover, .is-hover):not(:has(input:checked, input:disabled)) { background: color-mix(in srgb, var(--color-surface-muted) 45%, var(--color-surface-raised)); }
|
|
134
134
|
/* Depth and a check badge show the choice, without an accent ring. */
|
|
135
|
-
.radio-card:has(input:checked) { --depth: var(--shadow-sink); background: var(--
|
|
135
|
+
.radio-card:has(input:checked) { --depth: var(--shadow-sink); background: var(--color-well); }
|
|
136
136
|
.radio-card:has(input:disabled) { opacity: 0.58; cursor: not-allowed; }
|
|
137
|
-
.radio-card input { appearance: none; position: absolute; top: var(--space-3); right: var(--space-3); width: 16px; height: 16px; margin: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--surface-raised); color: var(--accent-text); cursor: inherit; }
|
|
138
|
-
.radio-card input:checked { border-color: var(--accent); background: var(--accent); }
|
|
137
|
+
.radio-card input { appearance: none; position: absolute; top: var(--space-3); right: var(--space-3); width: 16px; height: 16px; margin: 0; border: 1px solid var(--color-border); border-radius: 50%; background: var(--color-surface-raised); color: var(--color-accent-text); cursor: inherit; }
|
|
138
|
+
.radio-card input:checked { border-color: var(--color-accent); background: var(--color-accent); }
|
|
139
139
|
.radio-card input:checked::after { content: ""; position: absolute; inset: 2px 4px 4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
|
|
140
140
|
/* The card draws the ring, so the radio inside it does not. */
|
|
141
141
|
.radio-card input:focus-visible { outline: none; }
|
|
@@ -145,40 +145,40 @@
|
|
|
145
145
|
.switch { --w: 2.75rem; --h: 1.375rem; --inset: 0.125rem; display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: var(--control-sm); min-height: var(--control-md); padding: 0; border: 0; background: transparent; cursor: pointer; }
|
|
146
146
|
.switch[data-size="sm"] { --w: 2.2rem; --h: 1.1rem; --inset: 0.1rem; min-height: var(--control-sm); }
|
|
147
147
|
.switch[data-size="lg"] { --w: 3.3rem; --h: 1.65rem; --inset: 0.15rem; min-height: var(--control-lg); }
|
|
148
|
-
.switch-track, .toggle-track { --depth: var(--shadow-sink); position: relative; flex: none; width: var(--w); height: var(--h); border: 1px solid transparent; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--border) 90%, var(--
|
|
149
|
-
.switch-track::after, .toggle-track::after { content: ""; position: absolute; top: calc(var(--inset) - 1px); left: calc(var(--inset) - 1px); width: calc(var(--h) - 2 * var(--inset)); height: calc(var(--h) - 2 * var(--inset)); border-radius: var(--radius-pill); background: var(--surface-raised); box-shadow: var(--shadow-raise); transition: transform var(--duration) var(--ease-out), background-color var(--duration) var(--ease-out); }
|
|
150
|
-
:is(.switch[aria-checked="true"] .switch-track, .toggle[aria-pressed="true"] .toggle-track) { border-color: var(--accent); background: var(--accent); }
|
|
151
|
-
:is(.switch[aria-checked="true"] .switch-track, .toggle[aria-pressed="true"] .toggle-track)::after { background: var(--accent-text); transform: translateX(calc(var(--w) - var(--h))); }
|
|
148
|
+
.switch-track, .toggle-track { --depth: var(--shadow-sink); position: relative; flex: none; width: var(--w); height: var(--h); border: 1px solid transparent; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--color-border) 90%, var(--color-well)); box-shadow: var(--depth); transition: background-color var(--duration) var(--ease-out), border-color var(--duration) var(--ease-out); }
|
|
149
|
+
.switch-track::after, .toggle-track::after { content: ""; position: absolute; top: calc(var(--inset) - 1px); left: calc(var(--inset) - 1px); width: calc(var(--h) - 2 * var(--inset)); height: calc(var(--h) - 2 * var(--inset)); border-radius: var(--radius-pill); background: var(--color-surface-raised); box-shadow: var(--shadow-raise); transition: transform var(--duration) var(--ease-out), background-color var(--duration) var(--ease-out); }
|
|
150
|
+
:is(.switch[aria-checked="true"] .switch-track, .toggle[aria-pressed="true"] .toggle-track) { border-color: var(--color-accent); background: var(--color-accent); }
|
|
151
|
+
:is(.switch[aria-checked="true"] .switch-track, .toggle[aria-pressed="true"] .toggle-track)::after { background: var(--color-accent-text); transform: translateX(calc(var(--w) - var(--h))); }
|
|
152
152
|
.switch:disabled, .switch:disabled + label { opacity: 0.58; cursor: not-allowed; }
|
|
153
153
|
.switch-row label { cursor: pointer; }
|
|
154
154
|
/* The button is a larger hit area, so the ring follows the visible track. */
|
|
155
155
|
.switch:is(:focus-visible, .is-focus) { outline: none; }
|
|
156
156
|
|
|
157
157
|
/* Toggle button */
|
|
158
|
-
.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(--border-subtle); border-radius: var(--radius-field); background: var(--surface-raised); color: var(--text); font: var(--text-md) / var(--leading-tight) var(--font-
|
|
158
|
+
.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
159
|
.toggle[data-size="sm"] { --w: 2.2rem; --h: 1.1rem; --inset: 0.1rem; min-height: var(--control-sm); font-size: var(--text-sm); }
|
|
160
160
|
.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:is(:hover, .is-hover):not(:disabled, [aria-pressed="true"]) { border-color: var(--border); }
|
|
161
|
+
.toggle:is(:hover, .is-hover):not(:disabled, [aria-pressed="true"]) { border-color: var(--color-border); }
|
|
162
162
|
/* The switch carries the on state; the card takes a faint 8% accent tint and an accent hairline. */
|
|
163
|
-
.toggle[aria-pressed="true"] { border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: color-mix(in srgb, var(--accent) 8%, var(--surface-raised)); }
|
|
163
|
+
.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
164
|
.toggle:disabled { opacity: 0.58; cursor: not-allowed; }
|
|
165
165
|
.toggle-text { display: grid; }
|
|
166
|
-
.toggle-text small { color: var(--
|
|
166
|
+
.toggle-text small { color: var(--color-muted); font-size: var(--text-xs); }
|
|
167
167
|
|
|
168
168
|
/* Segmented control: a raised pill thumb on a sunk, undivided track. */
|
|
169
|
-
.segmented { --item: var(--control-md); --glide-lead: 260ms; --glide-trail: 300ms; display: inline-flex; flex: none; border: 1px solid transparent; border-radius: var(--radius-
|
|
169
|
+
.segmented { --item: var(--control-md); --glide-lead: 260ms; --glide-trail: 300ms; display: inline-flex; flex: none; border: 1px solid transparent; border-radius: var(--radius-control); background: var(--color-well); box-shadow: var(--shadow-sink); isolation: isolate; }
|
|
170
170
|
/* The fill alone marks the track. The transparent border keeps its size, and forced colors draw it. */
|
|
171
171
|
.segmented[data-size="sm"] { --item: var(--control-sm); font-size: var(--text-sm); }
|
|
172
172
|
.segmented[data-size="lg"] { --item: var(--control-lg); font-size: var(--text-lg); }
|
|
173
|
-
.segmented button { --depth: none; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--item); padding: 0 var(--space-3); border: 0; border-radius: var(--radius-
|
|
173
|
+
.segmented button { --depth: none; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--item); padding: 0 var(--space-3); border: 0; border-radius: var(--radius-control); background: transparent; color: var(--color-muted); font: inherit; cursor: pointer; }
|
|
174
174
|
.segmented[data-icon-only] button { width: var(--item); padding: 0; }
|
|
175
175
|
/* The thumb is inset inside each full-size button, so it floats on the track and the hit area keeps its size. */
|
|
176
|
-
.segmented button::before { content: ""; position: absolute; inset: 2px; z-index: -2; border-radius: var(--radius-
|
|
177
|
-
.segmented button:is(:hover, .is-hover):not(:disabled, [aria-pressed="true"]) { color: var(--text); }
|
|
178
|
-
.segmented button:is(:hover, .is-hover):not(:disabled, [aria-pressed="true"])::before { background: color-mix(in srgb, var(--control-thumb) 45%, transparent); }
|
|
179
|
-
/* The pressed label reads at 4.5:1 on its thumb, and an icon at 3:1 (--segmented-current-text). */
|
|
180
|
-
.segmented button[aria-pressed="true"] { color: var(--segmented-current-text); }
|
|
181
|
-
.segmented button[aria-pressed="true"]::before { z-index: -1; background: var(--control-thumb); box-shadow: var(--shadow-raise); }
|
|
176
|
+
.segmented button::before { content: ""; position: absolute; inset: 2px; z-index: -2; border-radius: var(--radius-control); pointer-events: none; }
|
|
177
|
+
.segmented button:is(:hover, .is-hover):not(:disabled, [aria-pressed="true"]) { color: var(--color-text); }
|
|
178
|
+
.segmented button:is(:hover, .is-hover):not(:disabled, [aria-pressed="true"])::before { background: color-mix(in srgb, var(--color-control-thumb) 45%, transparent); }
|
|
179
|
+
/* The pressed label reads at 4.5:1 on its thumb, and an icon at 3:1 (--color-segmented-current-text). */
|
|
180
|
+
.segmented button[aria-pressed="true"] { color: var(--color-segmented-current-text); }
|
|
181
|
+
.segmented button[aria-pressed="true"]::before { z-index: -1; background: var(--color-control-thumb); box-shadow: var(--shadow-raise); }
|
|
182
182
|
.segmented button:disabled { opacity: 0.58; cursor: not-allowed; }
|
|
183
183
|
/* Motion answers only the reader: hover, and a change of choice, which the script marks with data-slide and the old thumb's edges. */
|
|
184
184
|
@media (prefers-reduced-motion: no-preference) {
|
|
@@ -192,11 +192,11 @@
|
|
|
192
192
|
|
|
193
193
|
/* Slider: a native range input. */
|
|
194
194
|
.range { width: 220px; max-width: 100%; height: var(--control-md); margin: 0; background: transparent; appearance: none; cursor: pointer; }
|
|
195
|
-
.range::-webkit-slider-runnable-track { height: 6px; border-radius: var(--radius-
|
|
196
|
-
.range::-moz-range-track { height: 6px; border-radius: var(--radius-
|
|
197
|
-
.range::-moz-range-progress { height: 6px; border-radius: var(--radius-
|
|
198
|
-
.range::-webkit-slider-thumb { appearance: none; width: 18px; height: 18px; margin-top: -6px; border: 2px solid var(--accent); border-radius: 50%; background: var(--surface-raised); }
|
|
199
|
-
.range::-moz-range-thumb { width: 14px; height: 14px; border: 2px solid var(--accent); border-radius: 50%; background: var(--surface-raised); }
|
|
195
|
+
.range::-webkit-slider-runnable-track { height: 6px; border-radius: var(--radius-pill); background: linear-gradient(var(--color-accent), var(--color-accent)) 0 / var(--value, 50%) 100% no-repeat, var(--color-surface-muted); }
|
|
196
|
+
.range::-moz-range-track { height: 6px; border-radius: var(--radius-pill); background: var(--color-surface-muted); }
|
|
197
|
+
.range::-moz-range-progress { height: 6px; border-radius: var(--radius-pill); background: var(--color-accent); }
|
|
198
|
+
.range::-webkit-slider-thumb { appearance: none; width: 18px; height: 18px; margin-top: -6px; border: 2px solid var(--color-accent); border-radius: 50%; background: var(--color-surface-raised); }
|
|
199
|
+
.range::-moz-range-thumb { width: 14px; height: 14px; border: 2px solid var(--color-accent); border-radius: 50%; background: var(--color-surface-raised); }
|
|
200
200
|
.range[data-size="sm"]::-webkit-slider-thumb { width: 16px; height: 16px; margin-top: -5px; }
|
|
201
201
|
.range[data-size="lg"]::-webkit-slider-thumb { width: 20px; height: 20px; margin-top: -7px; }
|
|
202
202
|
/* The Firefox thumb is content-box, so its 2px border adds 4px: these match the WebKit sizes. */
|
|
@@ -206,88 +206,105 @@
|
|
|
206
206
|
.range[data-size="sm"] { height: var(--control-sm); }
|
|
207
207
|
.range[data-size="lg"] { height: var(--control-lg); }
|
|
208
208
|
.range:disabled { opacity: 0.58; cursor: not-allowed; }
|
|
209
|
+
/* The current value follows the track, so the reader sees the number the thumb sets. */
|
|
210
|
+
.slider { display: flex; align-items: center; gap: var(--space-3); width: 220px; max-width: 100%; }
|
|
211
|
+
.slider > .range { flex: 1; width: auto; min-width: 0; }
|
|
212
|
+
.slider-value { min-width: 4ch; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
|
|
213
|
+
.range:disabled + .slider-value { opacity: 0.58; }
|
|
209
214
|
/* The ring goes on the thumb, not the full-width input. */
|
|
210
215
|
.range:is(:focus-visible, .is-focus) { outline: none; }
|
|
211
|
-
.range:is(:focus-visible, .is-focus)::-webkit-slider-thumb { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }
|
|
212
|
-
.range:is(:focus-visible, .is-focus)::-moz-range-thumb { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }
|
|
216
|
+
.range:is(:focus-visible, .is-focus)::-webkit-slider-thumb { outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset); }
|
|
217
|
+
.range:is(:focus-visible, .is-focus)::-moz-range-thumb { outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset); }
|
|
213
218
|
|
|
214
219
|
/* Progress and score */
|
|
215
|
-
.progress { width: 220px; max-width: 100%; height: 9px; overflow: hidden; border: 1px solid var(--border-subtle); border-radius: var(--radius-
|
|
216
|
-
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: transform var(--duration-fast) var(--ease-out); }
|
|
220
|
+
.progress { width: 220px; max-width: 100%; height: 9px; overflow: hidden; border: 1px solid var(--color-border-subtle); border-radius: var(--radius-pill); background: var(--color-surface-muted); }
|
|
221
|
+
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--color-accent); transition: transform var(--duration-fast) var(--ease-out); }
|
|
217
222
|
.score { display: inline-flex; align-items: center; gap: var(--space-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|
218
223
|
.score .pips { display: inline-flex; gap: 0.1875rem; }
|
|
219
|
-
.score .pips i { width: 8px; height: 8px; border: 1px solid var(--border); border-radius: var(--radius-
|
|
220
|
-
.score .pips i.on { border-color: var(--accent); background: var(--accent); }
|
|
224
|
+
.score .pips i { width: 8px; height: 8px; border: 1px solid var(--color-border); border-radius: var(--radius-pill); }
|
|
225
|
+
.score .pips i.on { border-color: var(--color-accent); background: var(--color-accent); }
|
|
221
226
|
.score b { font-weight: var(--weight-medium); }
|
|
222
|
-
.score b span { color: var(--
|
|
227
|
+
.score b span { color: var(--color-muted); font-weight: var(--weight-regular); }
|
|
223
228
|
|
|
224
229
|
/* Tabs */
|
|
225
230
|
/* The list scrolls, so it clips on every side: the padding keeps the selected tab's shadow whole
|
|
226
231
|
and its fill off the frame edge. */
|
|
227
|
-
.tablist { display: flex; width: max-content; max-width: 100%; overflow-x: auto; padding: var(--space-1); }
|
|
232
|
+
.tablist { --glide-lead: 260ms; --glide-trail: 300ms; display: flex; width: max-content; max-width: 100%; overflow-x: auto; padding: var(--space-1); isolation: isolate; }
|
|
228
233
|
/* A clipped edge fades over 24px. The script names the clipped ends in data-clip as the list scrolls or resizes. */
|
|
229
234
|
.tablist[data-clip="start"] { mask-image: linear-gradient(to right, transparent, #000 24px); }
|
|
230
235
|
.tablist[data-clip="end"] { mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); }
|
|
231
236
|
.tablist[data-clip="start end"] { mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
|
|
232
|
-
.tab { flex: none; min-height: var(--control-md); padding: var(--space-2) var(--space-3); border: 0; border-radius: var(--radius-
|
|
233
|
-
.tab:is(:hover, .is-hover) { background: var(--row-hover); color: var(--text); }
|
|
234
|
-
/* The selected tab takes the navigation row's lifted fill
|
|
235
|
-
|
|
237
|
+
.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:is(:hover, .is-hover):where(:not(:disabled)) { background: var(--color-row-hover); color: var(--color-text); }
|
|
239
|
+
/* The selected tab takes the navigation row's lifted fill: one selected state for both. The fill is a
|
|
240
|
+
::before layer behind the label, so it can glide between tabs as the segmented thumb does. */
|
|
241
|
+
.tab[aria-selected="true"] { background: transparent; color: var(--color-nav-current-text); }
|
|
242
|
+
.tab[aria-selected="true"]::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--color-nav-current); box-shadow: var(--shadow-nav-current); pointer-events: none; }
|
|
243
|
+
/* A change of tab starts the new fill at the old one's edges; the script marks it with data-slide. */
|
|
244
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
245
|
+
.tablist[data-slide] .tab { transition: color var(--glide-lead) ease; }
|
|
246
|
+
.tablist[data-slide="right"] .tab[aria-selected="true"]::before { animation: glide-left var(--glide-trail) ease, glide-right var(--glide-lead) ease; }
|
|
247
|
+
.tablist[data-slide="left"] .tab[aria-selected="true"]::before { animation: glide-left var(--glide-lead) ease, glide-right var(--glide-trail) ease; }
|
|
248
|
+
}
|
|
236
249
|
/* Inset: the tab list scrolls sideways, which would clip an outer ring. */
|
|
237
|
-
.tab:is(:focus-visible, .is-focus) { outline: var(--focus-width) solid var(--focus); outline-offset: calc(var(--focus-width) * -1); }
|
|
238
|
-
.tabpanel { padding-top: var(--space-3); font-size: var(--text-sm); color: var(--
|
|
239
|
-
.tabs-heading { margin-bottom: var(--space-1); color: var(--text); font-size: var(--text-md); font-weight: var(--weight-medium); letter-spacing: 0; }
|
|
250
|
+
.tab:is(:focus-visible, .is-focus) { outline: var(--focus-width) solid var(--color-focus); outline-offset: calc(var(--focus-width) * -1); }
|
|
251
|
+
.tabpanel { padding-top: var(--space-3); font-size: var(--text-sm); color: var(--color-muted); }
|
|
252
|
+
.tabs-heading { margin-bottom: var(--space-1); color: var(--color-text); font-size: var(--text-md); font-weight: var(--weight-medium); letter-spacing: 0; }
|
|
240
253
|
|
|
241
254
|
/* Badge */
|
|
242
|
-
.badge { display: inline-flex; align-items: center; gap: 0.375rem; width: fit-content; padding: 0.1875rem 0.5625rem; border: 1px solid transparent; border-radius: var(--radius-pill); background: var(--surface-
|
|
243
|
-
.badge:is(.success, .warning, .danger, .info) { background: color-mix(in srgb, var(--tone) 22%, var(--surface-raised)); color: light-dark(color-mix(in srgb, var(--tone) 75%, var(--text)), color-mix(in srgb, var(--tone) 85%, var(--text))); }
|
|
255
|
+
.badge { display: inline-flex; align-items: center; gap: 0.375rem; width: fit-content; padding: 0.1875rem 0.5625rem; border: 1px solid transparent; border-radius: var(--radius-pill); background: var(--color-surface-muted); color: var(--color-muted); font: var(--weight-medium) var(--text-xs) / 1.25 var(--font-ui); white-space: nowrap; }
|
|
256
|
+
.badge:is(.success, .warning, .danger, .info) { background: color-mix(in srgb, var(--tone) 22%, var(--color-surface-raised)); color: light-dark(color-mix(in srgb, var(--tone) 75%, var(--color-text)), color-mix(in srgb, var(--tone) 85%, var(--color-text))); }
|
|
244
257
|
.badge:is(.success, .warning, .danger, .info)::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
|
|
245
|
-
.badge.success { --tone: var(--success); }
|
|
246
|
-
.badge.warning { --tone: var(--warning); }
|
|
247
|
-
.badge.danger { --tone: var(--
|
|
248
|
-
.badge.info { --tone: var(--info); }
|
|
258
|
+
.badge.success { --tone: var(--color-success); }
|
|
259
|
+
.badge.warning { --tone: var(--color-warning); }
|
|
260
|
+
.badge.danger { --tone: var(--color-error); }
|
|
261
|
+
.badge.info { --tone: var(--color-info); }
|
|
249
262
|
|
|
250
263
|
/* Alert */
|
|
251
|
-
.alert { display: flex; align-items: flex-start; gap: var(--space-3); max-width: var(--measure); padding: var(--space-3) var(--space-4); border: 1px solid transparent; border-radius: var(--radius-
|
|
252
|
-
.alert .icon { margin-top: 0.125rem; color: var(--
|
|
253
|
-
.alert.success { background: var(--success-
|
|
254
|
-
.alert.warning { background: var(--warning-
|
|
255
|
-
.alert.danger { background: var(--
|
|
256
|
-
.alert.info { background: var(--info-
|
|
264
|
+
.alert { display: flex; align-items: flex-start; gap: var(--space-3); max-width: var(--measure); padding: var(--space-3) var(--space-4); border: 1px solid transparent; border-radius: var(--radius-panel); background: var(--color-surface); color: var(--color-text); font-size: var(--text-sm); }
|
|
265
|
+
.alert .icon { margin-top: 0.125rem; color: var(--color-muted); }
|
|
266
|
+
.alert.success { background: var(--color-success-surface); } .alert.success .icon { color: var(--color-success); }
|
|
267
|
+
.alert.warning { background: var(--color-warning-surface); } .alert.warning .icon { color: var(--color-warning); }
|
|
268
|
+
.alert.danger { background: var(--color-error-surface); } .alert.danger .icon { color: var(--color-error); }
|
|
269
|
+
.alert.info { background: var(--color-info-surface); } .alert.info .icon { color: var(--color-info); }
|
|
257
270
|
|
|
258
271
|
/* Surface and card */
|
|
259
|
-
.surface, .card { min-width: 0; border: 1px solid transparent; border-radius: var(--radius-
|
|
272
|
+
.surface, .card { min-width: 0; border: 1px solid transparent; border-radius: var(--radius-panel); background: var(--color-surface-raised); box-shadow: var(--shadow-surface); }
|
|
260
273
|
.surface { padding: var(--space-4); }
|
|
261
274
|
.surface[data-padding="compact"] { padding: var(--space-3); }
|
|
262
275
|
.card { width: min(100%, 360px); overflow: hidden; }
|
|
263
276
|
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4); }
|
|
264
277
|
.card-head h4 { font-size: var(--text-md); font-weight: var(--weight-medium); line-height: var(--leading); letter-spacing: 0; }
|
|
265
|
-
.card-body { padding: 0 var(--space-4) var(--space-4); font-size: var(--text-sm); color: var(--
|
|
266
|
-
.card-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); margin-inline: var(--space-4); padding-block: var(--space-3); border-top: 1px solid var(--border-subtle); color: var(--
|
|
278
|
+
.card-body { padding: 0 var(--space-4) var(--space-4); font-size: var(--text-sm); color: var(--color-muted); }
|
|
279
|
+
.card-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); margin-inline: var(--space-4); padding-block: var(--space-3); border-top: 1px solid var(--color-border-subtle); color: var(--color-muted); font-size: var(--text-sm); }
|
|
267
280
|
|
|
268
281
|
/* Figure */
|
|
269
282
|
.figure { display: grid; gap: var(--space-3); min-width: 0; margin: 0; }
|
|
270
|
-
.figure-plate { min-width: 0; overflow-x: auto; padding: var(--space-5); border: 1px solid var(--border-subtle); border-radius: var(--radius-
|
|
271
|
-
.figure figcaption { max-width: var(--measure); color: var(--
|
|
272
|
-
.figure figcaption b { color: var(--text); font-weight: var(--weight-medium); }
|
|
283
|
+
.figure-plate { min-width: 0; overflow-x: auto; padding: var(--space-5); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-panel); background: var(--color-surface); }
|
|
284
|
+
.figure figcaption { max-width: var(--measure); color: var(--color-muted); font-size: var(--text-sm); }
|
|
285
|
+
.figure figcaption b { color: var(--color-text); font-weight: var(--weight-medium); }
|
|
273
286
|
|
|
274
287
|
/* Dialog and drawer. The catalogue shows them in place; real ones are native dialogs opened with showModal(). */
|
|
275
|
-
.dialog { display: grid; width: min(512px, 100%); max-height: min(672px, calc(100dvh - var(--space-8))); overflow: hidden; padding: 0; border: 1px solid transparent; border-radius: var(--radius-
|
|
288
|
+
.dialog { display: grid; width: min(512px, 100%); max-height: min(672px, calc(100dvh - var(--space-8))); overflow: hidden; padding: 0; border: 1px solid transparent; border-radius: var(--radius-panel); background: var(--color-surface-raised); color: var(--color-text); box-shadow: var(--shadow-dialog); }
|
|
276
289
|
/* The component sets display, so a closed native dialog needs its hidden state back. */
|
|
277
290
|
dialog:not([open]) { display: none; }
|
|
278
291
|
dialog.dialog { margin: auto; }
|
|
279
|
-
dialog.dialog::backdrop { background: var(--overlay); }
|
|
292
|
+
dialog.dialog::backdrop { background: var(--color-overlay); }
|
|
280
293
|
.dialog-head, .dialog-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); padding: var(--space-4); }
|
|
281
|
-
.dialog-head { border-bottom: 1px solid var(--border-subtle); }
|
|
294
|
+
.dialog-head { border-bottom: 1px solid var(--color-border-subtle); }
|
|
282
295
|
.dialog-head h4 { font-size: 1.125rem; font-weight: var(--weight-semibold); letter-spacing: -0.02em; }
|
|
283
|
-
.dialog-head p { margin-top: var(--space-1); color: var(--
|
|
296
|
+
.dialog-head p { margin-top: var(--space-1); color: var(--color-muted); }
|
|
284
297
|
.dialog-body { min-height: 0; overflow: auto; padding: var(--space-4); }
|
|
285
|
-
.dialog-foot { justify-content: flex-end; gap: var(--space-2); border-top: 1px solid var(--border-subtle); background: var(--surface); }
|
|
298
|
+
.dialog-foot { justify-content: flex-end; gap: var(--space-2); border-top: 1px solid var(--color-border-subtle); background: var(--color-surface); }
|
|
286
299
|
/* The close button is a quiet action; this sets its size only. */
|
|
287
|
-
.close { flex: none; width: var(--control-lg); min-height: var(--control-lg); padding: 0; color: var(--
|
|
288
|
-
.drawer { display: grid; grid-template-rows: auto minmax(0, 1fr); width: min(calc(var(--sidebar) + var(--space-12)), 100%); height: 260px; overflow: hidden; padding: 0; border: 1px solid transparent; background: var(--surface-raised); color: var(--text); box-shadow: var(--shadow-
|
|
300
|
+
.close { flex: none; width: var(--control-lg); min-height: var(--control-lg); padding: 0; color: var(--color-muted); }
|
|
301
|
+
.drawer { display: grid; grid-template-rows: auto minmax(0, 1fr); width: min(calc(var(--sidebar) + var(--space-12)), 100%); height: 260px; overflow: hidden; padding: 0; border: 1px solid transparent; background: var(--color-surface-raised); color: var(--color-text); box-shadow: var(--shadow-dialog); }
|
|
289
302
|
dialog.drawer { position: fixed; inset: 0 auto 0 0; height: 100dvh; max-height: none; margin: 0; }
|
|
290
|
-
dialog.drawer::backdrop { background: var(--overlay); }
|
|
303
|
+
dialog.drawer::backdrop { background: var(--color-overlay); }
|
|
304
|
+
/* The page behind an open drawer does not scroll, through the slide out too. Hiding the root's overflow keeps the
|
|
305
|
+
reader's position. The gutter is reserved all the time, so a classic scrollbar that hides does not reflow the page. */
|
|
306
|
+
:root { scrollbar-gutter: stable; }
|
|
307
|
+
:root:has(dialog.drawer[open]) { overflow: hidden; }
|
|
291
308
|
@media (prefers-reduced-motion: no-preference) {
|
|
292
309
|
dialog.drawer[open] { animation: drawer-in var(--duration) var(--ease-out); }
|
|
293
310
|
dialog.drawer[open]::backdrop { animation: fade-in var(--duration) var(--ease-out); }
|
|
@@ -299,70 +316,153 @@
|
|
|
299
316
|
@keyframes drawer-out { to { transform: translateX(-100%); } }
|
|
300
317
|
@keyframes fade-in { from { opacity: 0; } }
|
|
301
318
|
@keyframes fade-out { to { opacity: 0; } }
|
|
302
|
-
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-subtle); }
|
|
319
|
+
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-border-subtle); }
|
|
303
320
|
.drawer-head h4 { font-size: var(--text-md); font-weight: var(--weight-medium); letter-spacing: 0; }
|
|
304
321
|
.drawer-body { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: var(--space-4); }
|
|
305
322
|
|
|
306
323
|
/* Navigation list */
|
|
307
324
|
.navlist { display: grid; gap: 0.125rem; width: min(100%, 240px); }
|
|
308
|
-
.navlist .group-label { padding: 0 var(--space-3) var(--space-1); color: var(--
|
|
309
|
-
.navlist a { position: relative; display: flex; align-items: center; min-height: var(--row); padding-inline: var(--space-3); border-radius: var(--radius-
|
|
310
|
-
.navlist a:is(:hover, .is-hover) { background: var(--row-hover); color: var(--text); text-decoration: none; }
|
|
311
|
-
.navlist a[aria-current="page"] { background: var(--nav-current); box-shadow: var(--shadow-nav-current); color: var(--nav-current-text); font-weight: var(--weight-medium); }
|
|
312
|
-
.navlist a[aria-current="location"] { color: var(--text); font-weight: var(--weight-medium); }
|
|
313
|
-
.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(--accent); }
|
|
325
|
+
.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
|
+
.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:is(:hover, .is-hover) { background: var(--color-row-hover); color: var(--color-text); text-decoration: none; }
|
|
328
|
+
.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
|
+
.navlist a[aria-current="location"] { color: var(--color-text); font-weight: var(--weight-medium); }
|
|
330
|
+
.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); }
|
|
331
|
+
/* Optical centring: a line box keeps room for descenders, so a label in a flex row sits about 1px above
|
|
332
|
+
centre. Where text-box is supported, a text-only row becomes a block that trims its line to the cap
|
|
333
|
+
height and centres it, and the pip centres itself. Block padding gives a wrapped label room above its
|
|
334
|
+
first cap and below its last descenders; a single line still centres in the min-height. Rows with an
|
|
335
|
+
icon or a count keep flex layout, and browsers without text-box keep today's rendering. */
|
|
336
|
+
@supports (text-box: trim-both cap alphabetic) {
|
|
337
|
+
.navlist a:not(:has(> *)) { display: block; align-content: center; padding-block: var(--space-2); text-box: trim-both cap alphabetic; }
|
|
338
|
+
.navlist a:not(:has(> *))[aria-current="location"]::before { inset-block: 0; margin-block: auto; }
|
|
339
|
+
}
|
|
314
340
|
/* Inset: the rail and the drawer scroll. */
|
|
315
|
-
.navlist a:is(:focus-visible, .is-focus) { outline: var(--focus-width) solid var(--focus); outline-offset: calc(var(--focus-width) * -1); }
|
|
341
|
+
.navlist a:is(:focus-visible, .is-focus) { outline: var(--focus-width) solid var(--color-focus); outline-offset: calc(var(--focus-width) * -1); }
|
|
316
342
|
/* Phone trigger: a secondary button with a three-line menu glyph, because it opens a side drawer. */
|
|
317
343
|
.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; }
|
|
318
344
|
/* No-JavaScript fallback: the list opens in place. The summary is a secondary button with a chevron; only the chevron is local. */
|
|
319
345
|
.rail-summary { list-style: none; width: max-content; max-width: 100%; }
|
|
320
346
|
.rail-summary::-webkit-details-marker { display: none; }
|
|
321
347
|
.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); }
|
|
322
|
-
details.rail[open] > .navlist { margin-top: var(--space-2); }
|
|
348
|
+
details.rail-details[open] > .navlist { margin-top: var(--space-2); }
|
|
349
|
+
/* A collapsible group's label is a disclosure button in the group-label type. Only rails over about 40 rows use it. */
|
|
350
|
+
.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:is(:hover, .is-hover):where(:not(:disabled)) { background: var(--color-row-hover); color: var(--color-text); }
|
|
352
|
+
.group-toggle .icon { transition: transform var(--duration-fast) var(--ease-out); }
|
|
353
|
+
.group-toggle[aria-expanded="false"] .icon { transform: rotate(-90deg); }
|
|
354
|
+
/* Inset: the rail list scrolls. */
|
|
355
|
+
.group-toggle:is(:focus-visible, .is-focus) { outline: var(--focus-width) solid var(--color-focus); outline-offset: calc(var(--focus-width) * -1); }
|
|
356
|
+
/* Horizontal strip: the same rows in one line that scrolls sideways. The padding keeps the current row's shadow whole.
|
|
357
|
+
A clipped edge fades over 24px, as tabs do; the script names the clipped ends in data-clip. */
|
|
358
|
+
.navlist.strip { display: flex; width: auto; max-width: 100%; overflow-x: auto; padding: 0.125rem; }
|
|
359
|
+
.navlist.strip a { flex: none; white-space: nowrap; }
|
|
360
|
+
.navlist.strip[data-clip="start"] { mask-image: linear-gradient(to right, transparent, #000 24px); }
|
|
361
|
+
.navlist.strip[data-clip="end"] { mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); }
|
|
362
|
+
.navlist.strip[data-clip="start end"] { mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
|
|
363
|
+
|
|
364
|
+
/* Section rail: sticky and full height. The find field and the footer stay put while the list scrolls,
|
|
365
|
+
and the list's padding keeps the current row's shadow whole. */
|
|
366
|
+
.rail { position: sticky; top: 0; align-self: start; display: flex; flex-direction: column; gap: var(--space-3); height: 100dvh; padding-block: var(--space-6) var(--space-4); }
|
|
367
|
+
.rail-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0.125rem; }
|
|
368
|
+
.rail .navlist { width: auto; }
|
|
369
|
+
.rail .navlist + .navlist { margin-top: var(--space-4); }
|
|
370
|
+
.rail-foot { padding-top: var(--space-3); border-top: 1px solid var(--color-border-subtle); color: var(--color-muted); font-size: var(--text-sm); }
|
|
371
|
+
.rail-foot .switch-row label { color: var(--color-muted); }
|
|
372
|
+
/* In a rail the current section takes the current-page look, with no pip. Strips and contents lists keep the pip. */
|
|
373
|
+
:is(.rail, .rail-specimen) a[aria-current="location"] { background: var(--color-nav-current); box-shadow: var(--shadow-nav-current); color: var(--color-nav-current-text); }
|
|
374
|
+
:is(.rail, .rail-specimen) a[aria-current="location"]::before { content: none; }
|
|
375
|
+
/* Tablet and phone: Find and Menu, icon-only and square, in the header row. */
|
|
376
|
+
.section-bar { display: flex; gap: var(--space-2); }
|
|
377
|
+
.section-bar .btn { width: var(--control-lg); padding: 0; }
|
|
378
|
+
|
|
379
|
+
/* Find field: a search input with a leading icon and a trailing key hint. */
|
|
380
|
+
.find { position: relative; display: block; width: 100%; max-width: 260px; }
|
|
381
|
+
.find .input { width: 100%; padding-inline: 2rem 2.25rem; }
|
|
382
|
+
.find > .icon { position: absolute; left: 10px; top: 50%; translate: 0 -50%; color: var(--color-muted); pointer-events: none; }
|
|
383
|
+
.find > .key { position: absolute; right: 8px; top: 50%; translate: 0 -50%; pointer-events: none; }
|
|
384
|
+
.find:focus-within > .key, .find:has(.input:not(:placeholder-shown)) > .key { display: none; }
|
|
385
|
+
/* Touch-only devices have no / key to press, so the hint hides. */
|
|
386
|
+
@media (hover: none) { .find > .key { display: none; } }
|
|
387
|
+
.find-empty { display: grid; justify-items: start; gap: var(--space-1); padding: var(--space-2) var(--space-3); color: var(--color-muted); font-size: var(--text-sm); }
|
|
388
|
+
.find-empty .btn.text { margin-inline-start: calc(-1 * var(--space-1)); }
|
|
389
|
+
.find-count { color: var(--color-muted); font-size: var(--text-xs); }
|
|
390
|
+
|
|
391
|
+
/* Breadcrumbs. The separator is drawn by CSS, so it is not read. */
|
|
392
|
+
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-2); margin: 0; padding: 0; list-style: none; font-size: var(--text-sm); }
|
|
393
|
+
.crumbs li { display: inline-flex; align-items: center; gap: var(--space-2); min-width: 0; }
|
|
394
|
+
.crumbs li + li::before { content: "/" / ""; color: var(--color-muted); }
|
|
395
|
+
.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:is(:hover, .is-hover) { color: var(--color-text); text-decoration: underline; text-underline-offset: 0.2em; }
|
|
397
|
+
.crumbs [aria-current="page"] { color: var(--color-text); font-weight: var(--weight-medium); overflow-wrap: anywhere; }
|
|
398
|
+
/* Crumbs share the header row with the strip, so they centre on the cap height too. */
|
|
399
|
+
@supports (text-box: trim-both cap alphabetic) {
|
|
400
|
+
.crumbs a:not(:has(> *)) { display: block; align-content: center; padding-block: var(--space-2); text-box: trim-both cap alphabetic; }
|
|
401
|
+
.crumbs [aria-current="page"], .crumbs li + li::before { text-box: trim-both cap alphabetic; }
|
|
402
|
+
}
|
|
403
|
+
/* Phones show only the parent, as a back link; .is-back pins that for the specimen. */
|
|
404
|
+
.crumbs.is-back li:not(:nth-last-child(2)) { display: none; }
|
|
405
|
+
.crumbs.is-back li::before { content: none; }
|
|
406
|
+
.crumbs.is-back li:nth-last-child(2) a::before { content: "‹\a0" / ""; }
|
|
407
|
+
|
|
408
|
+
/* Pager: previous at the start, next always at the end. */
|
|
409
|
+
.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
|
+
.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:is(:hover, .is-hover) { background: var(--color-row-hover); }
|
|
412
|
+
.pager a[rel="next"] { grid-column: 2; justify-items: end; text-align: end; }
|
|
413
|
+
.pager-dir { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--color-muted); font-size: var(--text-xs); }
|
|
414
|
+
.pager-title { font-weight: var(--weight-medium); }
|
|
415
|
+
|
|
416
|
+
/* Keyboard key: mono, with an edge and no shadow. */
|
|
417
|
+
.key { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 0.3125rem; border: 1px solid var(--color-border); border-radius: var(--radius-inline); background: var(--color-surface); color: var(--color-muted); font: var(--weight-medium) var(--text-xs) / 1 var(--font-mono); vertical-align: 0.1em; }
|
|
418
|
+
|
|
419
|
+
/* Skip link: hidden above the page until it takes focus. */
|
|
420
|
+
.skip { position: absolute; top: calc(-1 * var(--space-16)); left: var(--space-4); z-index: 10; padding: var(--space-2) var(--space-3); border: 1px solid transparent; border-radius: var(--radius-field); background: var(--color-surface-raised); box-shadow: var(--shadow-dialog); color: var(--color-text); }
|
|
421
|
+
.skip:focus { top: var(--space-4); }
|
|
422
|
+
.skip.is-focus { position: static; outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset); }
|
|
323
423
|
/* List selection */
|
|
324
424
|
.rows { display: grid; width: min(100%, 360px); }
|
|
325
|
-
.rows [role="option"] { position: relative; display: flex; align-items: center; min-height: var(--row); padding: 0 var(--space-3); border-radius: var(--radius-
|
|
425
|
+
.rows [role="option"] { position: relative; display: flex; align-items: center; min-height: var(--row); padding: 0 var(--space-3); border-radius: var(--radius-inline); font-size: var(--text-sm); }
|
|
326
426
|
/* Dividers are straight lines inset by the row padding, so they never follow a rounded corner.
|
|
327
427
|
A filled row (hovered or selected) hides the divider above it and the one below it. */
|
|
328
|
-
.rows [role="option"] + [role="option"]::before { content: ""; position: absolute; inset: 0 var(--space-3) auto; border-top: 1px solid var(--border-subtle); }
|
|
428
|
+
.rows [role="option"] + [role="option"]::before { content: ""; position: absolute; inset: 0 var(--space-3) auto; border-top: 1px solid var(--color-border-subtle); }
|
|
329
429
|
.rows [role="option"]:is(:hover, .is-hover, [aria-selected="true"])::before,
|
|
330
430
|
.rows [role="option"]:is(:hover, .is-hover, [aria-selected="true"]) + [role="option"]::before { display: none; }
|
|
331
|
-
.rows [role="option"]:is(:hover, .is-hover) { background: var(--row-hover); }
|
|
431
|
+
.rows [role="option"]:is(:hover, .is-hover) { background: var(--color-row-hover); }
|
|
332
432
|
/* The selected row takes the navigation row's current recipe; it comes after hover, so hover keeps the fill. */
|
|
333
|
-
.rows [role="option"][aria-selected="true"] { background: var(--nav-current); box-shadow: var(--shadow-nav-current); color: var(--nav-current-text); font-weight: var(--weight-medium); }
|
|
433
|
+
.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); }
|
|
334
434
|
@media (forced-colors: active) { .rows [role="option"][aria-selected="true"] { border-inline-start: 2px solid Highlight; } }
|
|
335
435
|
|
|
336
436
|
/* Code block: a source well */
|
|
337
|
-
.code { width: 100%; max-width: var(--measure); min-width: 0; overflow: hidden; border: 1px solid transparent; border-radius: var(--radius-
|
|
338
|
-
.code-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); min-height: 2.5rem; padding: var(--space-1) var(--space-1) var(--space-1) var(--space-3); border-bottom: 1px solid var(--border-subtle); background: var(--surface-raised); font-size: var(--text-xs); }
|
|
437
|
+
.code { width: 100%; max-width: var(--measure); min-width: 0; overflow: hidden; border: 1px solid transparent; border-radius: var(--radius-panel); background: var(--color-code); color: var(--color-code-text); box-shadow: var(--shadow-surface); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
|
|
438
|
+
.code-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); min-height: 2.5rem; padding: var(--space-1) var(--space-1) var(--space-1) var(--space-3); border-bottom: 1px solid var(--color-border-subtle); background: var(--color-surface-raised); font-size: var(--text-xs); }
|
|
339
439
|
.code-head b { font-weight: var(--weight-semibold); }
|
|
340
|
-
.code-head .lang { color: var(--
|
|
440
|
+
.code-head .lang { color: var(--color-muted); }
|
|
341
441
|
/* Copy is a quiet action; this sets its size and place. */
|
|
342
442
|
.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; }
|
|
343
443
|
/* The code block has its own palette, so its Copy keeps the plate's text colour on hover. */
|
|
344
|
-
.code .copy:is(:hover, .is-hover) { color: inherit; }
|
|
444
|
+
.code .copy:is(:hover, .is-hover):where(:not(:disabled)) { color: inherit; }
|
|
345
445
|
/* Inset: the code block clips its content. */
|
|
346
|
-
.code pre:is(:focus-visible, .is-focus) { outline: var(--focus-width) solid var(--focus); outline-offset: calc(var(--focus-width) * -1); }
|
|
446
|
+
.code pre:is(:focus-visible, .is-focus) { outline: var(--focus-width) solid var(--color-focus); outline-offset: calc(var(--focus-width) * -1); }
|
|
347
447
|
.code .copy.quiet-action:is(:focus-visible, .is-focus) { outline-offset: calc(var(--focus-width) * -1); }
|
|
348
448
|
.code pre { margin: 0; padding: var(--space-4); overflow: auto; max-height: 32rem; font-size: var(--text-code); line-height: 1.65; tab-size: 2; }
|
|
349
449
|
/* Each line is a baseline-aligned row, so a prompt or line number sits on the text's baseline. */
|
|
350
450
|
.code .line { display: flex; align-items: baseline; min-height: 1.65em; }
|
|
351
451
|
.code .line > span { white-space: pre; }
|
|
352
|
-
.code .ln { min-width: 2.5em; padding-right: 1em; flex: none; text-align: right; color: var(--
|
|
353
|
-
.code .k { color: var(--
|
|
452
|
+
.code .ln { min-width: 2.5em; padding-right: 1em; flex: none; text-align: right; color: var(--color-muted); user-select: none; }
|
|
453
|
+
.code .k { color: var(--color-syntax-keyword); } .code .s { color: var(--color-syntax-string); } .code .n { color: var(--color-syntax-number); } .code .c { color: var(--color-syntax-comment); }
|
|
354
454
|
.code.compact { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
|
|
355
455
|
.code.compact pre { padding: var(--space-2) var(--space-3); }
|
|
356
456
|
.code.compact .copy { margin: var(--space-1); }
|
|
357
457
|
|
|
358
458
|
/* Code block with a live example: a live stage over its source, in one frame. */
|
|
359
|
-
.example { width: 100%; min-width: 0; margin: 0; overflow: hidden; border: 1px solid var(--border-subtle); border-radius: var(--radius-
|
|
459
|
+
.example { width: 100%; min-width: 0; margin: 0; overflow: hidden; border: 1px solid var(--color-border-subtle); border-radius: var(--radius-panel); background: var(--color-bg); }
|
|
360
460
|
/* The stage sits on the page background, so the preview shows components on the surface they sit on in a page. */
|
|
361
461
|
.example-stage { display: grid; place-items: safe center; min-height: 8rem; overflow-x: auto; padding: var(--space-8); }
|
|
362
462
|
.example-stage > * { min-width: 0; }
|
|
363
463
|
/* The frame draws the edge, so the source is flat and full width, with one hairline above it.
|
|
364
464
|
Copy comes first in DOM order and is placed in the source's top right corner. */
|
|
365
|
-
.example > .code { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; max-width: none; border-width: 1px 0 0; border-color: var(--border-subtle); border-radius: 0; box-shadow: none; }
|
|
465
|
+
.example > .code { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; max-width: none; border-width: 1px 0 0; border-color: var(--color-border-subtle); border-radius: 0; box-shadow: none; }
|
|
366
466
|
.example > .code > pre { grid-row: 1; grid-column: 1; }
|
|
367
467
|
.example > .code > .copy { grid-row: 1; grid-column: 2; margin: var(--space-1); }
|
|
368
468
|
|
|
@@ -370,130 +470,127 @@
|
|
|
370
470
|
|
|
371
471
|
/* Command plate: dark in both themes and tinted with the project hue. */
|
|
372
472
|
/* The plate is dark in both themes, so its focus ring takes the dark-theme accent, which reaches 3:1 on it. */
|
|
373
|
-
.code.command { --code-text: var(--terminal-text); --focus: var(--project-dark); border-color: var(--command-border); background: var(--command-bg); color: var(--terminal-text); }
|
|
374
|
-
.code.command .code-head { border-color: var(--command-border); background: transparent; color: var(--terminal-caption-text); }
|
|
375
|
-
.code.command .code-head .lang { color: var(--terminal-caption-text); }
|
|
473
|
+
.code.command { --color-code-text: var(--color-terminal-text); --color-focus: var(--color-project-dark); border-color: var(--color-command-border); background: var(--color-command-bg); color: var(--color-terminal-text); }
|
|
474
|
+
.code.command .code-head { border-color: var(--color-command-border); background: transparent; color: var(--color-terminal-caption-text); }
|
|
475
|
+
.code.command .code-head .lang { color: var(--color-terminal-caption-text); }
|
|
376
476
|
/* The prompt is drawn by CSS, so copied and spoken text omit it. */
|
|
377
|
-
.code.command .line::before { content: "$ " / ""; flex: none; white-space: pre; color: var(--project-dark); user-select: none; }
|
|
477
|
+
.code.command .line::before { content: "$ " / ""; flex: none; white-space: pre; color: var(--color-project-dark); user-select: none; }
|
|
378
478
|
|
|
379
479
|
/* Terminal capture: neutral plate with a mono status line. The header stays terminal-dark in
|
|
380
480
|
both page appearances, so the capture scopes its own tab, text, and focus colours. */
|
|
381
481
|
.capture {
|
|
382
|
-
--nav-current: color-mix(in srgb, var(--project-dark) 20%, transparent);
|
|
383
|
-
--shadow-nav-current: var(--
|
|
384
|
-
--row-hover: color-mix(in srgb, var(--terminal-text) 4%, transparent);
|
|
385
|
-
--nav-current-text: var(--project-dark);
|
|
386
|
-
--text: var(--terminal-text);
|
|
387
|
-
--
|
|
388
|
-
--accent: var(--project-dark);
|
|
389
|
-
--focus: var(--project-dark);
|
|
390
|
-
--border-subtle: var(--terminal-border);
|
|
391
|
-
width: 100%; max-width: 640px; min-width: 0; overflow: hidden; border: 1px solid var(--border-subtle); border-radius: var(--radius-
|
|
482
|
+
--color-nav-current: color-mix(in srgb, var(--color-project-dark) 20%, transparent);
|
|
483
|
+
--shadow-nav-current: var(--shadow-nav-current-dark);
|
|
484
|
+
--color-row-hover: color-mix(in srgb, var(--color-terminal-text) 4%, transparent);
|
|
485
|
+
--color-nav-current-text: var(--color-project-dark);
|
|
486
|
+
--color-text: var(--color-terminal-text);
|
|
487
|
+
--color-muted: var(--color-terminal-caption-text);
|
|
488
|
+
--color-accent: var(--color-project-dark);
|
|
489
|
+
--color-focus: var(--color-project-dark);
|
|
490
|
+
--color-border-subtle: var(--color-terminal-border);
|
|
491
|
+
width: 100%; max-width: 640px; min-width: 0; overflow: hidden; border: 1px solid var(--color-border-subtle); border-radius: var(--radius-panel); background: var(--color-terminal); color: var(--color-terminal-text); box-shadow: var(--shadow-surface);
|
|
392
492
|
}
|
|
393
493
|
.capture-head { display: flex; align-items: center; min-width: 0; }
|
|
394
494
|
.capture .tablist { flex: 1; width: auto; padding-inline: var(--space-2); }
|
|
395
495
|
.capture .tab { min-height: var(--control-lg); font-family: var(--font-mono); font-size: var(--text-sm); }
|
|
396
496
|
/* Full size is a quiet action; this sets its size and place. */
|
|
397
|
-
.full { display: inline-flex; align-items: center; gap: 0.375rem; flex: none; min-height: var(--control-lg); padding: 0 var(--space-3); color: var(--
|
|
497
|
+
.full { display: inline-flex; align-items: center; gap: 0.375rem; flex: none; min-height: var(--control-lg); padding: 0 var(--space-3); color: var(--color-muted); font-size: var(--text-sm); }
|
|
398
498
|
/* Inset: the panel clips its content. */
|
|
399
499
|
.capture .full.quiet-action:is(:focus-visible, .is-focus) { outline-offset: calc(var(--focus-width) * -1); }
|
|
400
500
|
.capture .tabpanel { padding-top: 0; color: inherit; }
|
|
401
501
|
/* Without JavaScript each capture keeps its heading, and panels after the first take a rule. */
|
|
402
502
|
.capture .tabs-heading { margin: 0; padding: var(--space-3) var(--space-4); font-family: var(--font-mono); font-size: var(--text-sm); }
|
|
403
|
-
.capture:not([data-enhanced]) .tabpanel + .tabpanel { border-top: 1px solid var(--border-subtle); }
|
|
503
|
+
.capture:not([data-enhanced]) .tabpanel + .tabpanel { border-top: 1px solid var(--color-border-subtle); }
|
|
404
504
|
dialog.capture-viewer { width: min(960px, calc(100% - var(--space-8))); }
|
|
405
505
|
.capture-viewer .dialog-head h4 { font-family: var(--font-mono); }
|
|
406
506
|
.capture-viewer .dialog-body { padding: 0; }
|
|
407
507
|
/* The full-size viewer clones the screen outside .capture, so it carries its own plate focus. */
|
|
408
|
-
.screen { --focus: var(--project-dark); margin: 0; padding: var(--space-4); overflow-x: auto; background: var(--terminal); color: var(--terminal-text); font-size: var(--text-code); line-height: 1.5; }
|
|
508
|
+
.screen { --color-focus: var(--color-project-dark); margin: 0; padding: var(--space-4); overflow-x: auto; background: var(--color-terminal); color: var(--color-terminal-text); font-size: var(--text-code); line-height: 1.5; }
|
|
409
509
|
/* Inset: the capture and the viewer body clip the screen's edges. */
|
|
410
510
|
.screen:is(:focus-visible, .is-focus) { outline-offset: calc(var(--focus-width) * -1); }
|
|
411
|
-
.screen .hi { color: var(--project-dark); }
|
|
412
|
-
.screen .dim { color: var(--terminal-caption-text); }
|
|
413
|
-
.capture-caption { padding: var(--space-1) var(--space-4); background: var(--terminal-caption); color: var(--terminal-caption-text); font: var(--text-xs) / var(--leading) var(--font-mono); overflow-wrap: anywhere; }
|
|
511
|
+
.screen .hi { color: var(--color-project-dark); }
|
|
512
|
+
.screen .dim { color: var(--color-terminal-caption-text); }
|
|
513
|
+
.capture-caption { padding: var(--space-1) var(--space-4); background: var(--color-terminal-caption); color: var(--color-terminal-caption-text); font: var(--text-xs) / var(--leading) var(--font-mono); overflow-wrap: anywhere; }
|
|
414
514
|
|
|
415
515
|
/* Site header */
|
|
416
|
-
.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(--text); background: var(--bg); width: 100%; }
|
|
516
|
+
.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%; }
|
|
417
517
|
.projects { position: relative; }
|
|
418
518
|
/* The trigger is a quiet action; this sets its size and type. */
|
|
419
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; }
|
|
420
520
|
.projects > summary::-webkit-details-marker { display: none; }
|
|
421
521
|
/* The ~/ mark is decorative: the empty alternative text keeps it out of the name. */
|
|
422
|
-
.projects > summary::before { content: "~/" / ""; color: var(--project); }
|
|
522
|
+
.projects > summary::before { content: "~/" / ""; color: var(--color-project); }
|
|
423
523
|
/* The open menu keeps the hover tint. :where keeps it below the quiet action's press. */
|
|
424
524
|
:where(.projects[open]) > summary { background: color-mix(in srgb, currentColor 12%, transparent); }
|
|
425
525
|
.projects .icon { transition: transform var(--duration-fast) var(--ease-out); }
|
|
426
526
|
.projects[open] .icon { transform: rotate(180deg); }
|
|
427
|
-
.projects .navlist { position: absolute; z-index: 3; top: 100%; left: 0; min-width: 224px; margin-top: var(--space-1); padding: var(--space-1); border: 1px solid transparent; border-radius: var(--radius-
|
|
527
|
+
.projects .navlist { position: absolute; z-index: 3; top: 100%; left: 0; min-width: 224px; margin-top: var(--space-1); padding: var(--space-1); border: 1px solid transparent; border-radius: var(--radius-panel); background: var(--color-surface-raised); box-shadow: var(--shadow-dialog); }
|
|
428
528
|
.projects.is-open .navlist { position: static; }
|
|
429
|
-
|
|
529
|
+
/* Rows sit --space-1 inside the menu, so they are concentric with it, as select picker rows are. */
|
|
530
|
+
.projects .navlist a { border-radius: calc(var(--radius-panel) - var(--space-1)); font-family: var(--font-mono); }
|
|
430
531
|
.site-end { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-6); margin-left: auto; }
|
|
431
|
-
|
|
432
|
-
.site-links a {
|
|
433
|
-
.site-links a:hover { color: var(--text); }
|
|
532
|
+
/* The site links are a navigation strip at the header's 44px. */
|
|
533
|
+
.site-links a { min-height: var(--control-lg); }
|
|
434
534
|
|
|
435
535
|
/* Page type and helpers */
|
|
436
536
|
.folio-h2 { font: var(--weight-semibold) var(--text-xl) / var(--leading-tight) var(--font-mono); letter-spacing: var(--tracking-tight); }
|
|
437
|
-
.folio-h2::before { content: "## " / ""; color: var(--accent); }
|
|
537
|
+
.folio-h2::before { content: "## " / ""; color: var(--color-accent); }
|
|
438
538
|
.folio-display { font: var(--weight-semibold) var(--text-display) / 1.08 var(--font-mono); letter-spacing: var(--tracking-tight); overflow-wrap: anywhere; }
|
|
439
539
|
.steps { display: grid; gap: var(--space-5); max-width: var(--measure); margin: 0; padding: 0; list-style: none; counter-reset: step; }
|
|
440
540
|
.steps li { position: relative; display: grid; gap: var(--space-1); padding-left: var(--space-12); counter-increment: step; }
|
|
441
|
-
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: var(--space-8); font: var(--weight-semibold) var(--text-lg) / var(--leading-tight) var(--font-mono); color: var(--accent); text-align: right; }
|
|
442
|
-
.steps li:not(:last-child)::after { content: ""; position: absolute; left: calc(var(--space-8) + var(--space-2)); top: var(--space-6); bottom: calc(-1 * var(--space-4)); border-left: 1px solid var(--border-subtle); }
|
|
541
|
+
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: var(--space-8); font: var(--weight-semibold) var(--text-lg) / var(--leading-tight) var(--font-mono); color: var(--color-accent); text-align: right; }
|
|
542
|
+
.steps li:not(:last-child)::after { content: ""; position: absolute; left: calc(var(--space-8) + var(--space-2)); top: var(--space-6); bottom: calc(-1 * var(--space-4)); border-left: 1px solid var(--color-border-subtle); }
|
|
443
543
|
.steps h4 { font-size: var(--text-lg); }
|
|
444
|
-
.steps p { color: var(--
|
|
544
|
+
.steps p { color: var(--color-muted); }
|
|
445
545
|
.definitions { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-2) var(--space-6); max-width: var(--measure); margin: 0; font-size: var(--text-sm); }
|
|
446
546
|
.definitions dt { font-weight: var(--weight-medium); }
|
|
447
|
-
.definitions dd { margin: 0; color: var(--
|
|
547
|
+
.definitions dd { margin: 0; color: var(--color-muted); }
|
|
448
548
|
.definitions code { white-space: nowrap; }
|
|
449
|
-
/* Skip link: hidden above the page until it takes focus. */
|
|
450
|
-
.skip { position: absolute; top: calc(-1 * var(--space-16)); left: var(--space-4); z-index: 10; padding: var(--space-2) var(--space-3); border: 1px solid transparent; border-radius: var(--radius-field); background: var(--surface-raised); box-shadow: var(--shadow-popover); color: var(--text); }
|
|
451
|
-
.skip:focus { top: var(--space-4); }
|
|
452
|
-
.skip.is-focus { position: static; outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }
|
|
453
549
|
.facts { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); margin: 0; font: var(--text-sm) / var(--leading) var(--font-mono); }
|
|
454
550
|
.facts > div { display: flex; flex-wrap: wrap; column-gap: var(--space-2); }
|
|
455
|
-
.facts dt { color: var(--
|
|
551
|
+
.facts dt { color: var(--color-muted); }
|
|
456
552
|
.facts dd { margin: 0; overflow-wrap: anywhere; }
|
|
457
553
|
.cmdlist { width: 100%; max-width: var(--measure); border-collapse: collapse; font-size: var(--text-sm); }
|
|
458
|
-
.cmdlist th { padding: var(--space-2) var(--space-4) var(--space-2) 0; border-bottom: 1px solid var(--border-subtle); color: var(--
|
|
459
|
-
.cmdlist td { padding: var(--space-1) var(--space-4) var(--space-1) 0; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
|
|
554
|
+
.cmdlist th { padding: var(--space-2) var(--space-4) var(--space-2) 0; border-bottom: 1px solid var(--color-border-subtle); color: var(--color-muted); font-size: var(--text-xs); font-weight: var(--weight-medium); text-align: left; }
|
|
555
|
+
.cmdlist td { padding: var(--space-1) var(--space-4) var(--space-1) 0; border-bottom: 1px solid var(--color-border-subtle); vertical-align: middle; }
|
|
460
556
|
.cmdlist td:first-child { width: 1%; white-space: nowrap; }
|
|
461
|
-
.cmdlist td:nth-child(2) { color: var(--
|
|
557
|
+
.cmdlist td:nth-child(2) { color: var(--color-muted); }
|
|
462
558
|
.cmdlist td:last-child { width: 1%; padding-right: 0; }
|
|
463
559
|
.cmdlist .copy { margin: 0; }
|
|
464
|
-
:where(.cmdlist) .copy { color: var(--
|
|
465
|
-
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2) var(--space-5); width: 100%; padding-block: var(--space-4); border-top: 1px solid var(--border-subtle); font: var(--text-sm) / var(--leading) var(--font-mono); }
|
|
466
|
-
.site-footer a { color: var(--
|
|
560
|
+
:where(.cmdlist) .copy { color: var(--color-muted); }
|
|
561
|
+
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2) var(--space-5); width: 100%; padding-block: var(--space-4); border-top: 1px solid var(--color-border-subtle); font: var(--text-sm) / var(--leading) var(--font-mono); }
|
|
562
|
+
.site-footer a { color: var(--color-muted); }
|
|
467
563
|
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0 var(--space-5); }
|
|
468
564
|
|
|
469
565
|
/* ---------- Focus, forced colors, and touch ---------- */
|
|
470
|
-
/* One ring for every role: --focus-width of --focus (the accent) with a --focus-offset gap and no
|
|
566
|
+
/* One ring for every role: --focus-width of --color-focus (the accent) with a --focus-offset gap and no
|
|
471
567
|
glow, over the control's own raise or sink. The tokens.css base draws it on links; these rules pin
|
|
472
568
|
it and move it to the visible part of composite controls. */
|
|
473
|
-
:is(.btn, .quiet-action, .check input, .segmented button, .toggle):is(:focus-visible, .is-focus),
|
|
569
|
+
:is(.btn, .quiet-action, .check input, .segmented button, .toggle, .crumbs a):is(:focus-visible, .is-focus),
|
|
474
570
|
:is(.dialog, .drawer):focus-visible,
|
|
475
571
|
.switch:is(:focus-visible, .is-focus) .switch-track,
|
|
476
|
-
.radio-card:has(input:is(:focus-visible, .is-focus)) { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }
|
|
572
|
+
.radio-card:has(input:is(:focus-visible, .is-focus)) { outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset); }
|
|
477
573
|
/* Inside a segmented control, the ring hugs the thumb instead of crossing into the next option. */
|
|
478
574
|
.segmented button:is(:focus-visible, .is-focus) { outline-offset: calc(var(--focus-width) * -1); }
|
|
479
575
|
/* Fields draw no ring: the edge turns the accent with a muted accent line inside it, and the fill stays. */
|
|
480
|
-
:is(.input, .select, .textarea):is(:focus-visible, .is-focus) { outline: none; border-color: var(--accent); box-shadow: var(--field-
|
|
481
|
-
:is(.input, .select, .textarea)[aria-invalid="true"]:is(:focus-visible, .is-focus) { border-color: var(--
|
|
576
|
+
:is(.input, .select, .textarea):is(:focus-visible, .is-focus) { outline: none; border-color: var(--color-accent); box-shadow: var(--shadow-field-focus); }
|
|
577
|
+
:is(.input, .select, .textarea)[aria-invalid="true"]:is(:focus-visible, .is-focus) { border-color: var(--color-error); box-shadow: var(--shadow-field-focus-invalid); }
|
|
482
578
|
/* The search wrapper takes the field focus, so the input inside it draws nothing. */
|
|
483
|
-
.search:is(:has(input:focus-visible), .is-focus) { outline: none; border-color: var(--accent); box-shadow: var(--field-
|
|
579
|
+
.search:is(:has(input:focus-visible), .is-focus) { outline: none; border-color: var(--color-accent); box-shadow: var(--shadow-field-focus); }
|
|
484
580
|
/* A search wrapper follows the shared invalid and disabled field states through the input it holds. */
|
|
485
|
-
.search:has(input[aria-invalid="true"]) { border-color: var(--
|
|
486
|
-
.search:has(input[aria-invalid="true"]):is(:has(input:focus-visible), .is-focus) { border-color: var(--
|
|
487
|
-
.search:has(input:disabled) { background: var(--
|
|
581
|
+
.search:has(input[aria-invalid="true"]) { border-color: var(--color-error); }
|
|
582
|
+
.search:has(input[aria-invalid="true"]):is(:has(input:focus-visible), .is-focus) { border-color: var(--color-error); box-shadow: var(--shadow-field-focus-invalid); }
|
|
583
|
+
.search:has(input:disabled) { background: var(--color-well); box-shadow: none; opacity: 0.58; cursor: not-allowed; }
|
|
488
584
|
|
|
489
585
|
@media (forced-colors: active) {
|
|
490
586
|
/* The inset accent line drops, so a focused field draws the system ring just inside its edge. */
|
|
491
587
|
:is(.input, .select, .textarea):is(:focus-visible, .is-focus), .search:is(:has(input:focus-visible), .is-focus) { outline: var(--focus-width) solid Highlight; outline-offset: -1px; }
|
|
492
588
|
/* The lifted fill drops, so the selected tab takes a system border; the padding absorbs it. */
|
|
493
589
|
.tab[aria-selected="true"] { border: 2px solid Highlight; padding: calc(var(--space-2) - 2px) calc(var(--space-3) - 2px); }
|
|
590
|
+
.tab[aria-selected="true"]::before { content: none; }
|
|
494
591
|
.check input:checked { forced-color-adjust: none; border-color: Highlight; background: Highlight; }
|
|
495
592
|
/* The masked search cross would lose its fill, so it opts out and takes the system text colour. */
|
|
496
|
-
.search input::-webkit-search-cancel-button, .search input::-webkit-search-cancel-button:hover { forced-color-adjust: none; background: CanvasText; }
|
|
593
|
+
.search input::-webkit-search-cancel-button, .search input:where(:not(:disabled))::-webkit-search-cancel-button:hover { forced-color-adjust: none; background: CanvasText; }
|
|
497
594
|
.check input[type="checkbox"]:checked::before { border-color: HighlightText; }
|
|
498
595
|
.check input[type="radio"]:checked { background: HighlightText; }
|
|
499
596
|
.radio-card input:checked { forced-color-adjust: none; border-color: Highlight; background: Highlight; color: HighlightText; }
|
|
@@ -511,6 +608,14 @@
|
|
|
511
608
|
its pip, redrawn in the system highlight, so the two still differ. */
|
|
512
609
|
.navlist a[aria-current="page"] { border-inline-start: 2px solid Highlight; }
|
|
513
610
|
.navlist a[aria-current="location"]::before { forced-color-adjust: none; background: Highlight; }
|
|
611
|
+
/* A rail's current section has no pip, so it takes the current page's system border. */
|
|
612
|
+
:is(.rail, .rail-specimen) a[aria-current="location"] { border-inline-start: 2px solid Highlight; }
|
|
613
|
+
.key { border-color: CanvasText; }
|
|
614
|
+
/* The tone dot is a fill, so it opts out of adjustment and takes the label's system colour. */
|
|
615
|
+
.badge:is(.success, .warning, .danger, .info)::before { forced-color-adjust: none; background: CanvasText; }
|
|
616
|
+
/* An SVG keeps the colour it sets, so the status icon takes the system text colour. */
|
|
617
|
+
.alert .icon, .alert:is(.success, .warning, .danger, .info) .icon { color: CanvasText; }
|
|
618
|
+
.coverage td { color: CanvasText; }
|
|
514
619
|
/* Value marks: only the mark opts out of adjustment and redraws in the system highlight. */
|
|
515
620
|
.progress > span, .score .pips i.on { forced-color-adjust: none; border-color: Highlight; background: Highlight; }
|
|
516
621
|
/* Each engine's range pseudo-element has its own rule: an unknown one drops the whole list. */
|
|
@@ -521,30 +626,39 @@
|
|
|
521
626
|
}
|
|
522
627
|
|
|
523
628
|
/* ---------- Catalogue page ---------- */
|
|
629
|
+
/* One scroll offset for every in-page jump; sections set no scroll-margin-top. The location tracker reads the same value. */
|
|
630
|
+
html { scroll-padding-top: var(--space-4); }
|
|
524
631
|
.frame { width: min(calc(var(--page-max) + var(--sidebar)), calc(100% - var(--space-12))); margin-inline: auto; }
|
|
525
|
-
|
|
526
|
-
.page-head
|
|
527
|
-
.
|
|
528
|
-
|
|
632
|
+
/* Header: the site name, the design system's pages as a navigation strip, and the appearance control. */
|
|
633
|
+
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-6); min-height: var(--space-16); border-bottom: 1px solid var(--color-border-subtle); }
|
|
634
|
+
.site-name { margin: 0 auto 0 0; font: var(--weight-semibold) var(--text-sm) / 1 var(--font-mono); }
|
|
635
|
+
/* Header links are navigation rows at the site header's 44px. The strip's label shows only in the drawer. */
|
|
636
|
+
.page-head .strip a { min-height: var(--control-lg); }
|
|
637
|
+
.navlist.strip > .group-label { display: none; }
|
|
529
638
|
.layout { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); gap: var(--space-8); }
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
/* One column that may shrink below its content, so a long title or specimen cannot widen the page. */
|
|
534
|
-
main { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-12); min-width: 0; padding-block: var(--space-8) var(--space-16); }
|
|
639
|
+
/* One column that may shrink below its content, so a long title or specimen cannot widen the page.
|
|
640
|
+
A short page, such as one left by a find with no matches, keeps its rows at the top. */
|
|
641
|
+
main { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: var(--space-12); min-width: 0; padding-block: var(--space-8) var(--space-16); }
|
|
535
642
|
.intro { display: grid; gap: var(--space-3); }
|
|
536
643
|
.intro h1 { font: var(--weight-semibold) var(--text-3xl) / 1.08 var(--font-mono); letter-spacing: var(--tracking-tight); overflow-wrap: anywhere; }
|
|
537
|
-
.intro p { max-width: var(--measure); color: var(--
|
|
538
|
-
.layer-head { display: grid; gap: var(--space-2); padding-top: var(--space-6); border-top: 1px solid var(--border-subtle); }
|
|
539
|
-
.layer-head h2 { font: var(--weight-semibold) var(--text-xl) / var(--leading-tight) var(--font-mono); }
|
|
540
|
-
.layer-head h2::before { content: "## " / ""; color: var(--accent); }
|
|
541
|
-
.layer-head p { max-width: var(--measure); color: var(--
|
|
542
|
-
.component { display: grid; gap: var(--space-3); min-width: 0;
|
|
644
|
+
.intro p { max-width: var(--measure); color: var(--color-muted); font-size: var(--text-reading); }
|
|
645
|
+
.layer-head { display: grid; gap: var(--space-2); padding-top: var(--space-6); border-top: 1px solid var(--color-border-subtle); }
|
|
646
|
+
:is(.layer-head, .index) > h2 { font: var(--weight-semibold) var(--text-xl) / var(--leading-tight) var(--font-mono); }
|
|
647
|
+
:is(.layer-head, .index) > h2::before { content: "## " / ""; color: var(--color-accent); }
|
|
648
|
+
.layer-head p { max-width: var(--measure); color: var(--color-muted); }
|
|
649
|
+
.component { display: grid; gap: var(--space-3); min-width: 0; }
|
|
543
650
|
.component > header { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-3); }
|
|
544
651
|
.component h3 { font-size: var(--text-lg); }
|
|
545
652
|
.component > header a { font-size: var(--text-sm); }
|
|
546
|
-
|
|
547
|
-
.
|
|
653
|
+
/* Each component has a one-line purpose, which Find also matches, and a Copy link quiet action. */
|
|
654
|
+
.purpose { max-width: var(--measure); margin-top: calc(-1 * var(--space-2)); color: var(--color-muted); font-size: var(--text-sm); }
|
|
655
|
+
/* The spec's Do and Don't lines, as a two-column definition list under the purpose. components.md owns the text. */
|
|
656
|
+
.guidance { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-1) var(--space-3); max-width: var(--measure); margin: 0; font-size: var(--text-sm); }
|
|
657
|
+
.guidance dt { font-weight: var(--weight-medium); }
|
|
658
|
+
.guidance dd { margin: 0; color: var(--color-muted); }
|
|
659
|
+
.copy-link { width: var(--control-sm); height: var(--control-sm); align-self: center; color: var(--color-muted); }
|
|
660
|
+
.note { max-width: var(--measure); color: var(--color-muted); font-size: var(--text-sm); }
|
|
661
|
+
.row { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: var(--space-2) var(--space-6); padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border-subtle); }
|
|
548
662
|
.row:last-child { border-bottom: 0; }
|
|
549
663
|
.row h4 { padding-top: var(--space-2); font-size: var(--text-sm); font-weight: var(--weight-medium); letter-spacing: 0; }
|
|
550
664
|
.states { display: flex; flex-wrap: wrap; align-items: start; gap: var(--space-4) var(--space-6); min-width: 0; }
|
|
@@ -554,30 +668,88 @@
|
|
|
554
668
|
/* Layout only: a segmented control scrolls inside its column at large text sizes, labels on one line. */
|
|
555
669
|
:is(.state, .page-head) > .segmented { max-width: 100%; overflow-x: auto; white-space: nowrap; }
|
|
556
670
|
:is(.state, .page-head) > .segmented button { flex: none; }
|
|
557
|
-
.caption { color: var(--
|
|
671
|
+
.caption { color: var(--color-muted); font-size: var(--text-xs); }
|
|
558
672
|
.wide { flex-basis: 100%; }
|
|
559
673
|
/* Fields fill their container; the catalogue gives each specimen a preferred width. */
|
|
560
674
|
.state > :is(.field, .input, .select, .textarea, .search) { width: 220px; }
|
|
675
|
+
.state .pager { padding-top: 0; border-top: 0; }
|
|
676
|
+
.rail-specimen { display: grid; gap: var(--space-3); width: 240px; }
|
|
677
|
+
.phone-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); width: min(100%, 360px); padding-block: var(--space-3); border-bottom: 1px solid var(--color-border-subtle); }
|
|
678
|
+
|
|
679
|
+
/* By purpose: each group with its components, in two balanced columns. */
|
|
680
|
+
.index { display: grid; gap: var(--space-4); }
|
|
681
|
+
.index-grid { columns: 2; column-gap: var(--space-8); }
|
|
682
|
+
.index-grid > div { break-inside: avoid; padding-bottom: var(--space-6); }
|
|
683
|
+
.index-grid h3 { margin-bottom: var(--space-2); font-size: var(--text-md); }
|
|
684
|
+
.index-grid h3 a { color: var(--color-text); text-decoration: none; }
|
|
685
|
+
.index-grid h3 a:hover { text-decoration: underline; }
|
|
686
|
+
.index-grid ul { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
|
|
687
|
+
.index-grid li { display: grid; font-size: var(--text-sm); }
|
|
688
|
+
.index-grid li > span { color: var(--color-muted); }
|
|
689
|
+
|
|
690
|
+
/* Control states. The wrapper is positioned, so the visually hidden cell text stays inside the scroller. */
|
|
691
|
+
.coverage-wrap { position: relative; overflow-x: auto; margin-top: calc(-1 * var(--space-8)); }
|
|
692
|
+
.coverage { width: 100%; border-collapse: collapse; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
|
|
693
|
+
.coverage th, .coverage td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--color-border-subtle); text-align: center; }
|
|
694
|
+
.coverage thead th { color: var(--color-muted); font-size: var(--text-xs); font-weight: var(--weight-medium); }
|
|
695
|
+
.coverage :is(thead th:first-child, tbody th) { padding-inline-start: 0; text-align: left; font-weight: var(--weight-regular); white-space: nowrap; }
|
|
696
|
+
.coverage td { color: var(--color-accent); }
|
|
697
|
+
.coverage .none { color: var(--color-muted); }
|
|
698
|
+
|
|
699
|
+
/* The menu drawer holds Find, the pages, the appearance control, and the rail's groups. */
|
|
700
|
+
.drawer .rail { position: static; height: auto; padding: 0; }
|
|
701
|
+
.drawer .rail-list { overflow: visible; }
|
|
702
|
+
.drawer .find { max-width: none; }
|
|
703
|
+
/* The find field stays at the top of the drawer while the list scrolls under it. */
|
|
704
|
+
.drawer .rail-find { position: sticky; top: calc(-1 * var(--space-4)); z-index: 1; margin: calc(-1 * var(--space-4)) calc(-1 * var(--space-4)) 0; padding: var(--space-4); background: var(--color-surface-raised); }
|
|
705
|
+
.drawer .navlist.strip { display: grid; overflow: visible; margin-bottom: var(--space-4); padding: 0; }
|
|
706
|
+
.drawer .navlist.strip > .group-label { display: block; }
|
|
707
|
+
.drawer .navlist.strip a { white-space: normal; }
|
|
708
|
+
.drawer-appearance { display: grid; gap: var(--space-2); margin-bottom: var(--space-4); padding-bottom: var(--space-4); border-bottom: 1px solid var(--color-border-subtle); }
|
|
709
|
+
.drawer-appearance > .group-label { padding-inline: var(--space-3); color: var(--color-muted); font-size: var(--text-xs); font-weight: var(--weight-semibold); }
|
|
710
|
+
.drawer-appearance > .segmented { justify-self: start; max-width: 100%; }
|
|
711
|
+
/* A tap opens the drawer with focus on its body, which draws no ring; the rows show their own. */
|
|
712
|
+
#nav-drawer-body:focus { outline: none; }
|
|
561
713
|
|
|
562
714
|
@media (max-width: 800px) {
|
|
715
|
+
/* With the script, the header is one sticky row with Find and Menu. --head-inset is its height, and
|
|
716
|
+
in-page jumps land below it. */
|
|
717
|
+
:root { --head-inset: calc(var(--control-lg) + 2 * var(--space-3) + 1px); }
|
|
718
|
+
html { scroll-padding-top: calc(var(--head-inset) + var(--space-4)); }
|
|
719
|
+
.page-head { padding-block: var(--space-3); }
|
|
720
|
+
.page-head:has(> .section-bar) { position: sticky; top: 0; z-index: 5; flex-wrap: nowrap; background: var(--color-bg); }
|
|
721
|
+
.page-head:has(> .section-bar) > .site-name { min-width: 0; }
|
|
722
|
+
/* The buttons sit inside the scroll inset, so they cancel it; otherwise focusing one scrolls the page. */
|
|
723
|
+
.page-head > .section-bar > * { scroll-margin-top: calc(-1 * (var(--head-inset) + var(--space-4))); }
|
|
724
|
+
/* Without the script, the links take a second row and the rail stays in place above the content. */
|
|
725
|
+
.page-head .strip { order: 3; flex-basis: 100%; margin-inline: -2px; }
|
|
563
726
|
.layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
|
|
564
|
-
|
|
565
|
-
.
|
|
566
|
-
|
|
567
|
-
.
|
|
568
|
-
.
|
|
569
|
-
.toc .navlist .group-label { display: flex; align-items: center; padding: 0 var(--space-1) 0 0; }
|
|
727
|
+
.layout > .rail { position: static; height: auto; padding-block: var(--space-4); border-bottom: 1px solid var(--color-border-subtle); }
|
|
728
|
+
.layout > .rail .rail-list { overflow: visible; }
|
|
729
|
+
/* The rail sits in the drawer or, without the script, right after the header, so it needs no skip link. */
|
|
730
|
+
.skip[href="#contents"] { display: none; }
|
|
731
|
+
.index-grid { columns: 1; }
|
|
570
732
|
.row { grid-template-columns: minmax(0, 1fr); }
|
|
571
733
|
/* Touch: unsized controls grow to --control-lg. Size specimens keep their sizes. */
|
|
572
734
|
.btn:not([data-size]), .segmented:not([data-size]) button, .navlist a, .tab { min-height: var(--control-lg); }
|
|
735
|
+
/* An unsized segmented control grows its item size too, so icon-only options stay square. */
|
|
736
|
+
.segmented:not([data-size]) { --item: var(--control-lg); }
|
|
573
737
|
.input:not([data-size]), .select:not([data-size]), .range:not([data-size]) { height: var(--control-lg); }
|
|
574
738
|
.search { height: var(--control-lg); }
|
|
575
739
|
.check:not([data-size]), .switch:not([data-size]), .toggle:not([data-size]) { min-height: var(--control-lg); }
|
|
740
|
+
.copy-link { width: var(--control-lg); height: var(--control-lg); }
|
|
741
|
+
.crumbs a, .group-toggle { min-height: var(--control-lg); }
|
|
576
742
|
.folio-display { font-size: var(--text-display-sm); }
|
|
577
743
|
}
|
|
578
744
|
@media (max-width: 640px) {
|
|
579
745
|
/* Phones: a dialog becomes a bottom sheet with rounded top corners. */
|
|
580
|
-
dialog.dialog { width: 100%; max-width: none; margin: auto 0 0; border-radius: var(--radius-
|
|
746
|
+
dialog.dialog { width: 100%; max-width: none; margin: auto 0 0; border-radius: var(--radius-panel) var(--radius-panel) 0 0; }
|
|
747
|
+
/* Breadcrumbs show only the parent, as a back link. */
|
|
748
|
+
.crumbs li:not(:nth-last-child(2)) { display: none; }
|
|
749
|
+
.crumbs li::before { content: none; }
|
|
750
|
+
.crumbs li:nth-last-child(2) a::before { content: "‹\a0" / ""; }
|
|
751
|
+
.pager { grid-template-columns: minmax(0, 1fr); }
|
|
752
|
+
.pager a[rel="next"] { grid-column: 1; }
|
|
581
753
|
.definitions { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-1); }
|
|
582
754
|
.definitions dd + dt { margin-top: var(--space-3); }
|
|
583
755
|
.frame { width: calc(100% - var(--space-8)); }
|
|
@@ -586,7 +758,7 @@
|
|
|
586
758
|
.example-stage { padding: var(--space-6) var(--space-4); }
|
|
587
759
|
.cmdlist thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
|
|
588
760
|
.cmdlist, .cmdlist tbody { display: block; }
|
|
589
|
-
.cmdlist tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-2); padding-block: var(--space-2); border-bottom: 1px solid var(--border-subtle); }
|
|
761
|
+
.cmdlist tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-2); padding-block: var(--space-2); border-bottom: 1px solid var(--color-border-subtle); }
|
|
590
762
|
.cmdlist td, .cmdlist td:first-child, .cmdlist td:last-child { width: auto; padding: 0; border: 0; white-space: normal; overflow-wrap: anywhere; }
|
|
591
763
|
.cmdlist td:nth-child(2) { grid-column: 1; }
|
|
592
764
|
.cmdlist td:last-child { grid-column: 2; grid-row: 1 / span 2; }
|
|
@@ -605,52 +777,115 @@
|
|
|
605
777
|
<symbol id="i-expand" viewBox="0 0 16 16"><path d="M9.5 2.5h4v4M6.5 13.5h-4v-4M13.5 2.5 9 7M2.5 13.5 7 9"/></symbol>
|
|
606
778
|
<symbol id="i-list" viewBox="0 0 16 16"><path d="M5.5 4.5h8M5.5 8h8M5.5 11.5h8M2.5 4.5h.01M2.5 8h.01M2.5 11.5h.01"/></symbol>
|
|
607
779
|
<symbol id="i-grid" viewBox="0 0 16 16"><rect x="2.5" y="2.5" width="4.5" height="4.5" rx="1"/><rect x="9" y="2.5" width="4.5" height="4.5" rx="1"/><rect x="2.5" y="9" width="4.5" height="4.5" rx="1"/><rect x="9" y="9" width="4.5" height="4.5" rx="1"/></symbol>
|
|
780
|
+
<symbol id="i-link" viewBox="0 0 16 16"><path d="M6.8 9.2a2.5 2.5 0 0 0 3.5 0l2.2-2.2a2.5 2.5 0 0 0-3.5-3.5l-.8.8M9.2 6.8a2.5 2.5 0 0 0-3.5 0L3.5 9a2.5 2.5 0 0 0 3.5 3.5l.8-.8"/></symbol>
|
|
781
|
+
<symbol id="i-menu" viewBox="0 0 16 16"><path d="M1.5 3.5h13M1.5 8h13M1.5 12.5h13"/></symbol>
|
|
782
|
+
<symbol id="i-arrow-left" viewBox="0 0 16 16"><path d="M12.5 8h-9M7 4.5 3.5 8 7 11.5"/></symbol>
|
|
783
|
+
<symbol id="i-arrow-right" viewBox="0 0 16 16"><path d="M3.5 8h9M9 4.5l3.5 3.5L9 11.5"/></symbol>
|
|
608
784
|
</svg>
|
|
609
785
|
|
|
610
|
-
<a class="skip" href="#
|
|
786
|
+
<a class="skip" href="#main">Skip to content</a>
|
|
787
|
+
<a class="skip" href="#contents">Skip to contents</a>
|
|
611
788
|
<div class="frame">
|
|
612
789
|
<header class="page-head">
|
|
613
|
-
<
|
|
614
|
-
<nav aria-label="
|
|
615
|
-
|
|
616
|
-
<a href="reference.html">Application example</a>
|
|
617
|
-
<a href="docs.html">Documentation example</a>
|
|
618
|
-
<a href="product.html">Product page example</a>
|
|
619
|
-
</nav>
|
|
620
|
-
<div class="segmented" role="group" aria-label="Theme" data-live>
|
|
790
|
+
<p class="site-name">Design system</p>
|
|
791
|
+
<nav class="navlist strip" aria-label="Pages"><span class="group-label" aria-hidden="true">Pages</span><a href="reference.html#foundations">Foundations</a><a href="components.html" aria-current="page">Components</a><a href="reference.html">Application example</a><a href="docs.html">Documentation example</a><a href="product.html">Product page example</a></nav>
|
|
792
|
+
<div class="segmented" role="group" aria-label="Appearance" data-live hidden>
|
|
621
793
|
<button type="button" data-theme-choice="system" aria-pressed="true">System</button>
|
|
622
794
|
<button type="button" data-theme-choice="light" aria-pressed="false">Light</button>
|
|
623
795
|
<button type="button" data-theme-choice="dark" aria-pressed="false">Dark</button>
|
|
624
796
|
</div>
|
|
625
797
|
</header>
|
|
626
798
|
|
|
799
|
+
<!-- Phones: the script moves this bar into the header row, and the rail into the menu drawer. -->
|
|
800
|
+
<div class="section-bar" id="section-bar" hidden>
|
|
801
|
+
<button class="btn secondary" type="button" data-size="lg" id="section-find" aria-label="Find a component" aria-haspopup="dialog"><svg class="icon" aria-hidden="true"><use href="#i-search"/></svg></button>
|
|
802
|
+
<button class="btn secondary" type="button" data-size="lg" id="section-menu" aria-label="Menu" aria-haspopup="dialog"><svg class="icon" aria-hidden="true"><use href="#i-menu"/></svg></button>
|
|
803
|
+
</div>
|
|
804
|
+
|
|
627
805
|
<div class="layout">
|
|
628
|
-
<
|
|
629
|
-
<div class="
|
|
630
|
-
<
|
|
631
|
-
<
|
|
806
|
+
<aside class="rail" id="rail" aria-label="Contents">
|
|
807
|
+
<div class="rail-find" hidden>
|
|
808
|
+
<div class="find"><svg class="icon" aria-hidden="true"><use href="#i-search"/></svg><input class="input" type="search" id="find" placeholder="Find a component" aria-label="Find a component" aria-describedby="find-count" autocomplete="off" spellcheck="false" aria-keyshortcuts="/"><kbd class="key" aria-hidden="true">/</kbd></div>
|
|
809
|
+
<p class="sr-only" role="status" id="find-count"></p>
|
|
632
810
|
</div>
|
|
633
|
-
<
|
|
634
|
-
<
|
|
635
|
-
|
|
811
|
+
<nav class="rail-list" id="contents" aria-label="Components">
|
|
812
|
+
<div class="navlist" role="group" aria-labelledby="rail-overview">
|
|
813
|
+
<span class="group-label" id="rail-overview">Overview</span>
|
|
814
|
+
<a href="#index" data-terms="by purpose overview index overview all components">By purpose</a>
|
|
815
|
+
</div>
|
|
816
|
+
<div class="navlist" role="group" aria-labelledby="rail-actions">
|
|
817
|
+
<span class="group-label" id="rail-actions">Actions</span>
|
|
818
|
+
<a href="#button" data-terms="button actions the main action control: primary, secondary, ghost, danger, and text. cta submit link">Button</a><a href="#quiet-action" data-terms="quiet action actions a small transparent action inside a component, such as copy or close. icon button copy close">Quiet action</a>
|
|
819
|
+
</div>
|
|
820
|
+
<div class="navlist" role="group" aria-labelledby="rail-selection">
|
|
821
|
+
<span class="group-label" id="rail-selection">Selection</span>
|
|
822
|
+
<a href="#checkbox-and-radio" data-terms="checkbox and radio selection pick several options, or one from a short list. check tick option">Checkbox and radio</a><a href="#radio-card-group" data-terms="radio card group selection pick one option that needs a description. choice card option">Radio card group</a><a href="#switch" data-terms="switch selection turn a setting on or off at once. toggle on off">Switch</a><a href="#toggle-button" data-terms="toggle button selection a labelled card that latches on, with a switch inside. toggle card pressed">Toggle button</a><a href="#segmented-control" data-terms="segmented control selection two to five short options that apply at once. button group toggle group theme view mode">Segmented control</a>
|
|
823
|
+
</div>
|
|
824
|
+
<div class="navlist" role="group" aria-labelledby="rail-inputs">
|
|
825
|
+
<span class="group-label" id="rail-inputs">Inputs</span>
|
|
826
|
+
<a href="#text-input-and-textarea" data-terms="text input and textarea inputs type a short value or a longer note. field textbox search form">Text input and textarea</a><a href="#select" data-terms="select inputs choose from a longer list. dropdown picker menu">Select</a><a href="#field-wrapper" data-terms="field wrapper inputs label, description, and error text around a field. label help error validation form">Field wrapper</a><a href="#slider" data-terms="slider inputs set a value in a range. range">Slider</a>
|
|
827
|
+
</div>
|
|
828
|
+
<div class="navlist" role="group" aria-labelledby="rail-feedback">
|
|
829
|
+
<span class="group-label" id="rail-feedback">Feedback and status</span>
|
|
830
|
+
<a href="#progress" data-terms="progress feedback and status show how far a task has got. loading bar meter">Progress</a><a href="#score" data-terms="score feedback and status show a value out of a maximum. rating pips">Score</a><a href="#badge" data-terms="badge feedback and status a short status label. tag chip pill label status">Badge</a><a href="#alert" data-terms="alert feedback and status a real caveat or status message in the page. callout banner notice warning error">Alert</a>
|
|
831
|
+
</div>
|
|
832
|
+
<div class="navlist" role="group" aria-labelledby="rail-containers">
|
|
833
|
+
<span class="group-label" id="rail-containers">Containers and overlays</span>
|
|
834
|
+
<a href="#surface-and-card" data-terms="surface and card containers and overlays panels and cards for parallel, comparable content. panel box tile">Surface and card</a><a href="#figure" data-terms="figure containers and overlays an image or diagram with a caption. image screenshot caption">Figure</a><a href="#dialog" data-terms="dialog containers and overlays a modal task that needs an answer before the page continues. modal popup sheet confirm">Dialog</a><a href="#drawer" data-terms="drawer containers and overlays a side panel, such as phone navigation. sheet off-canvas sidebar menu">Drawer</a>
|
|
835
|
+
</div>
|
|
836
|
+
<div class="navlist" role="group" aria-labelledby="rail-navigation">
|
|
837
|
+
<span class="group-label" id="rail-navigation">Navigation</span>
|
|
838
|
+
<a href="#navigation-list" data-terms="navigation list navigation rows of links with current page and current location. nav menu sidebar rail toc contents strip">Navigation list</a><a href="#section-rail" data-terms="section rail navigation a sticky list of sections that moves into a drawer on phones. sidebar on this page toc contents scroll spy">Section rail</a><a href="#find-field" data-terms="find field navigation filter a navigation list as you type. search filter shortcut slash">Find field</a><a href="#breadcrumbs" data-terms="breadcrumbs navigation the path from the site to this page. crumbs hierarchy back path">Breadcrumbs</a><a href="#pager" data-terms="pager navigation previous and next pages in a sequence. pagination prev next sequence">Pager</a><a href="#tabs" data-terms="tabs navigation switch panels about one object, without leaving the page. tablist panels">Tabs</a><a href="#skip-link" data-terms="skip link navigation jump past the header to the content. skip to content a11y bypass">Skip link</a><a href="#keyboard-key" data-terms="keyboard key navigation show a key or shortcut in text. kbd shortcut hotkey">Keyboard key</a>
|
|
839
|
+
</div>
|
|
840
|
+
<div class="navlist" role="group" aria-labelledby="rail-code">
|
|
841
|
+
<span class="group-label" id="rail-code">Code and examples</span>
|
|
842
|
+
<a href="#code-block" data-terms="code block code and examples source code with an optional header and copy, and a live example above it. snippet pre syntax example demo preview playground">Code block</a>
|
|
843
|
+
</div>
|
|
844
|
+
<div class="navlist" role="group" aria-labelledby="rail-identity">
|
|
845
|
+
<span class="group-label" id="rail-identity">Identity</span>
|
|
846
|
+
<a href="#command-plate" data-terms="command plate identity a shell command on a hue-tinted plate. install shell terminal">Command plate</a><a href="#terminal-capture" data-terms="terminal capture identity a recorded terminal screen with a status line. screenshot tui">Terminal capture</a><a href="#site-header" data-terms="site header identity the ~/name header with project switcher and appearance. header project switcher appearance">Site header</a><a href="#page-type-and-helpers" data-terms="page type and helpers identity mono headings, steps, definitions, facts, and the footer. headings steps footer definitions">Page type and helpers</a>
|
|
847
|
+
</div>
|
|
848
|
+
<div class="navlist" role="group" aria-labelledby="rail-reference">
|
|
849
|
+
<span class="group-label" id="rail-reference">Reference</span>
|
|
850
|
+
<a href="#state-coverage" data-terms="control states reference coverage hover pressed selected focus disabled busy invalid matrix">Control states</a>
|
|
851
|
+
</div>
|
|
852
|
+
<div class="find-empty" id="find-empty" hidden><p>No component matches <q></q>.</p><button class="btn text" type="button" id="find-clear">Clear</button></div>
|
|
853
|
+
</nav>
|
|
854
|
+
<div class="rail-foot" hidden>
|
|
855
|
+
<div class="switch-row"><button class="switch" id="shortcut-switch" type="button" role="switch" aria-checked="true" aria-labelledby="shortcut-label"><span class="switch-track" aria-hidden="true"></span></button><label id="shortcut-label" for="shortcut-switch">Single-key shortcuts</label></div>
|
|
636
856
|
</div>
|
|
637
|
-
</
|
|
857
|
+
</aside>
|
|
638
858
|
|
|
639
859
|
<main id="main">
|
|
640
860
|
<section class="intro" aria-labelledby="title">
|
|
641
861
|
<h1 id="title">Components</h1>
|
|
642
862
|
<p>Every component in the design language, in each state that applies. The styles use only <a href="tokens.css"><code>tokens.css</code></a>, and the markup carries the roles and states a React or Vue version should copy. <a href="components.md">Component specs</a> describe each one; <a href="decisions.md">decisions</a> say why.</p>
|
|
643
|
-
<p>The first specimen in each row is live. The others pin one state for display and do not respond
|
|
863
|
+
<p>Each component’s badge names its layer: a new project adopts Core as it is, with its own hue and fonts set in the <code>tokens.css</code> identity block, and replaces Identity with its own look. The first specimen in each row is live. The others pin one state for display and do not respond, and every caption names its state.</p>
|
|
864
|
+
</section>
|
|
865
|
+
|
|
866
|
+
<section class="index" id="index" aria-labelledby="index-title">
|
|
867
|
+
<h2 id="index-title">By purpose</h2>
|
|
868
|
+
<div class="index-grid">
|
|
869
|
+
<div><h3><a href="#group-actions">Actions</a></h3><ul><li><a href="#button">Button</a><span>The main action control: primary, secondary, ghost, danger, and text.</span></li><li><a href="#quiet-action">Quiet action</a><span>A small transparent action inside a component, such as Copy or Close.</span></li></ul></div>
|
|
870
|
+
<div><h3><a href="#group-selection">Selection</a></h3><ul><li><a href="#checkbox-and-radio">Checkbox and radio</a><span>Pick several options, or one from a short list.</span></li><li><a href="#radio-card-group">Radio card group</a><span>Pick one option that needs a description.</span></li><li><a href="#switch">Switch</a><span>Turn a setting on or off at once.</span></li><li><a href="#toggle-button">Toggle button</a><span>A labelled card that latches on, with a switch inside.</span></li><li><a href="#segmented-control">Segmented control</a><span>Two to five short options that apply at once.</span></li></ul></div>
|
|
871
|
+
<div><h3><a href="#group-inputs">Inputs</a></h3><ul><li><a href="#text-input-and-textarea">Text input and textarea</a><span>Type a short value or a longer note.</span></li><li><a href="#select">Select</a><span>Choose from a longer list.</span></li><li><a href="#field-wrapper">Field wrapper</a><span>Label, description, and error text around a field.</span></li><li><a href="#slider">Slider</a><span>Set a value in a range.</span></li></ul></div>
|
|
872
|
+
<div><h3><a href="#group-feedback">Feedback and status</a></h3><ul><li><a href="#progress">Progress</a><span>Show how far a task has got.</span></li><li><a href="#score">Score</a><span>Show a value out of a maximum.</span></li><li><a href="#badge">Badge</a><span>A short status label.</span></li><li><a href="#alert">Alert</a><span>A real caveat or status message in the page.</span></li></ul></div>
|
|
873
|
+
<div><h3><a href="#group-containers">Containers and overlays</a></h3><ul><li><a href="#surface-and-card">Surface and card</a><span>Panels and cards for parallel, comparable content.</span></li><li><a href="#figure">Figure</a><span>An image or diagram with a caption.</span></li><li><a href="#dialog">Dialog</a><span>A modal task that needs an answer before the page continues.</span></li><li><a href="#drawer">Drawer</a><span>A side panel, such as phone navigation.</span></li></ul></div>
|
|
874
|
+
<div><h3><a href="#group-navigation">Navigation</a></h3><ul><li><a href="#navigation-list">Navigation list</a><span>Rows of links with current page and current location.</span></li><li><a href="#section-rail">Section rail</a><span>A sticky list of sections that moves into a drawer on phones.</span></li><li><a href="#find-field">Find field</a><span>Filter a navigation list as you type.</span></li><li><a href="#breadcrumbs">Breadcrumbs</a><span>The path from the site to this page.</span></li><li><a href="#pager">Pager</a><span>Previous and next pages in a sequence.</span></li><li><a href="#tabs">Tabs</a><span>Switch panels about one object, without leaving the page.</span></li><li><a href="#skip-link">Skip link</a><span>Jump past the header to the content.</span></li><li><a href="#keyboard-key">Keyboard key</a><span>Show a key or shortcut in text.</span></li></ul></div>
|
|
875
|
+
<div><h3><a href="#group-code">Code and examples</a></h3><ul><li><a href="#code-block">Code block</a><span>Source code with an optional header and Copy, and a live example above it.</span></li></ul></div>
|
|
876
|
+
<div><h3><a href="#group-identity">Identity: terminal folio</a></h3><ul><li><a href="#command-plate">Command plate</a><span>A shell command on a hue-tinted plate.</span></li><li><a href="#terminal-capture">Terminal capture</a><span>A recorded terminal screen with a status line.</span></li><li><a href="#site-header">Site header</a><span>The ~/name header with project switcher and appearance.</span></li><li><a href="#page-type-and-helpers">Page type and helpers</a><span>Mono headings, steps, definitions, facts, and the footer.</span></li></ul></div>
|
|
877
|
+
</div>
|
|
644
878
|
</section>
|
|
645
879
|
|
|
646
|
-
<section class="layer-head" aria-labelledby="
|
|
647
|
-
<h2 id="
|
|
648
|
-
<p>
|
|
880
|
+
<section class="layer-head" id="group-actions" aria-labelledby="group-actions-title">
|
|
881
|
+
<h2 id="group-actions-title">Actions</h2>
|
|
882
|
+
<p>Start, confirm, or cancel something.</p>
|
|
649
883
|
</section>
|
|
650
884
|
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
<
|
|
885
|
+
<section class="component" id="button" data-layer="Core" data-states="hover pressed focus disabled busy" aria-labelledby="button-title">
|
|
886
|
+
<header><h3 id="button-title">Button</h3><span class="badge">Core</span><a href="components.md#button">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="button" aria-label="Copy link to Button" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
887
|
+
<p class="purpose">The main action control: primary, secondary, ghost, danger, and text.</p>
|
|
888
|
+
<dl class="guidance"><dt>Do</dt><dd>One primary button in each decision group, labelled with a verb for its result, such as “Save changes”. Every other action in the group is secondary, ghost, or text.</dd><dt>Don’t</dt><dd>The danger variant on an action the reader can undo. Danger marks an action that destroys something.</dd></dl>
|
|
654
889
|
<div class="row"><h4>Primary</h4><div class="states">
|
|
655
890
|
<div class="state"><button class="btn" type="button"><svg class="icon" aria-hidden="true"><use href="#i-plus"/></svg>New monitor</button><span class="caption">Rest</span></div>
|
|
656
891
|
<div class="state" inert><button class="btn is-hover" type="button">New monitor</button><span class="caption">Hover</span></div>
|
|
@@ -698,8 +933,10 @@
|
|
|
698
933
|
</div></div>
|
|
699
934
|
</section>
|
|
700
935
|
|
|
701
|
-
<section class="component" id="quiet-action" data-layer="Core" aria-labelledby="quiet-action-title">
|
|
702
|
-
<header><h3 id="quiet-action-title">Quiet action</h3><span class="badge">Core</span><a href="components.md#quiet-action">Spec</a></header>
|
|
936
|
+
<section class="component" id="quiet-action" data-layer="Core" data-states="hover pressed focus disabled" aria-labelledby="quiet-action-title">
|
|
937
|
+
<header><h3 id="quiet-action-title">Quiet action</h3><span class="badge">Core</span><a href="components.md#quiet-action">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="quiet-action" aria-label="Copy link to Quiet action" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
938
|
+
<p class="purpose">A small transparent action inside a component, such as Copy or Close.</p>
|
|
939
|
+
<dl class="guidance"><dt>Do</dt><dd>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.</dd><dt>Don’t</dt><dd>An action that stands on its own in the page, such as Save or Next. That is a button.</dd></dl>
|
|
703
940
|
<p class="note">One recipe for Copy, Full size, dialog and drawer close, and the project trigger. Each component sets only its size and place.</p>
|
|
704
941
|
<div class="row"><h4>Icon</h4><div class="states">
|
|
705
942
|
<div class="state"><button class="quiet-action close" type="button" aria-label="Close"><svg class="icon" aria-hidden="true"><use href="#i-close"/></svg></button><span class="caption">Rest</span></div>
|
|
@@ -716,64 +953,15 @@
|
|
|
716
953
|
</div></div>
|
|
717
954
|
</section>
|
|
718
955
|
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
<
|
|
722
|
-
<div class="row"><h4>Input</h4><div class="states">
|
|
723
|
-
<div class="state"><div class="field"><label class="field-label" for="in-rest">Service</label><input class="input" id="in-rest" placeholder="checkout-api"></div><span class="caption">Rest</span></div>
|
|
724
|
-
<div class="state" inert><div class="field"><label class="field-label" for="in-focus">Service</label><input class="input is-focus" id="in-focus" value="checkout-api"></div><span class="caption">Focus visible</span></div>
|
|
725
|
-
<div class="state" inert><div class="field"><label class="field-label" for="in-disabled">Service</label><input class="input" id="in-disabled" value="checkout-api" disabled></div><span class="caption">Disabled</span></div>
|
|
726
|
-
<div class="state" inert><div class="field"><label class="field-label" for="in-invalid">Service</label><input class="input" id="in-invalid" aria-invalid="true" aria-errormessage="in-invalid-error"><p class="field-error" id="in-invalid-error">Enter a service name.</p></div><span class="caption">Invalid</span></div>
|
|
727
|
-
<div class="state" inert><div class="field"><label class="field-label" for="in-invalid-focus">Service</label><input class="input is-focus" id="in-invalid-focus" aria-invalid="true" aria-errormessage="in-invalid-focus-error"><p class="field-error" id="in-invalid-focus-error">Enter a service name.</p></div><span class="caption">Invalid, focus visible</span></div>
|
|
728
|
-
</div></div>
|
|
729
|
-
<div class="row"><h4>Search</h4><div class="states">
|
|
730
|
-
<div class="state"><label class="search"><svg class="icon" aria-hidden="true"><use href="#i-search"/></svg><input type="search" aria-label="Search monitors" value="latency"></label><span class="caption">Live; focus it to show the clear cross, which darkens on hover</span></div>
|
|
731
|
-
<div class="state" inert><label class="search is-focus"><svg class="icon" aria-hidden="true"><use href="#i-search"/></svg><input type="search" aria-label="Search monitors, focused" value="latency"></label><span class="caption">Focus visible</span></div>
|
|
732
|
-
</div></div>
|
|
733
|
-
<div class="row"><h4>Sizes</h4><div class="states">
|
|
734
|
-
<div class="state" inert><input class="input" data-size="sm" aria-label="Small input" placeholder="Small"><span class="caption">sm</span></div>
|
|
735
|
-
<div class="state" inert><input class="input" data-size="md" aria-label="Medium input" placeholder="Medium"><span class="caption">md</span></div>
|
|
736
|
-
<div class="state" inert><input class="input" data-size="lg" aria-label="Large input" placeholder="Large"><span class="caption">lg</span></div>
|
|
737
|
-
</div></div>
|
|
738
|
-
<div class="row"><h4>Textarea</h4><div class="states">
|
|
739
|
-
<div class="state"><div class="field"><label class="field-label" for="ta-rest">Note</label><textarea class="textarea" id="ta-rest" placeholder="What changed?"></textarea></div><span class="caption">Rest</span></div>
|
|
740
|
-
<div class="state" inert><div class="field"><label class="field-label" for="ta-focus">Note</label><textarea class="textarea is-focus" id="ta-focus">Raised the threshold.</textarea></div><span class="caption">Focus visible</span></div>
|
|
741
|
-
<div class="state" inert><div class="field"><label class="field-label" for="ta-disabled">Note</label><textarea class="textarea" id="ta-disabled" disabled>Raised the threshold.</textarea></div><span class="caption">Disabled</span></div>
|
|
742
|
-
<div class="state" inert><div class="field"><label class="field-label" for="ta-invalid">Note</label><textarea class="textarea" id="ta-invalid" aria-invalid="true" aria-errormessage="ta-invalid-error"></textarea><p class="field-error" id="ta-invalid-error">Add a note.</p></div><span class="caption">Invalid</span></div>
|
|
743
|
-
</div></div>
|
|
956
|
+
<section class="layer-head" id="group-selection" aria-labelledby="group-selection-title">
|
|
957
|
+
<h2 id="group-selection-title">Selection</h2>
|
|
958
|
+
<p>Choose options or turn something on.</p>
|
|
744
959
|
</section>
|
|
745
960
|
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
<
|
|
749
|
-
<
|
|
750
|
-
<div class="state"><div class="field"><label class="field-label" for="se-rest">Window</label><select class="select" id="se-rest"><option>Last hour</option><option>Last 24 hours</option><option>Last 7 days</option></select></div><span class="caption">Rest</span></div>
|
|
751
|
-
<div class="state" inert><div class="field"><label class="field-label" for="se-focus">Window</label><select class="select is-focus" id="se-focus"><option>Last hour</option></select></div><span class="caption">Focus visible</span></div>
|
|
752
|
-
<div class="state" inert><div class="field"><label class="field-label" for="se-disabled">Window</label><select class="select" id="se-disabled" disabled><option>Last hour</option></select></div><span class="caption">Disabled</span></div>
|
|
753
|
-
<div class="state" inert><div class="field"><label class="field-label" for="se-invalid">Window</label><select class="select" id="se-invalid" aria-invalid="true" aria-errormessage="se-invalid-error"><option></option></select><p class="field-error" id="se-invalid-error">Choose a window.</p></div><span class="caption">Invalid</span></div>
|
|
754
|
-
</div></div>
|
|
755
|
-
<div class="row"><h4>Sizes</h4><div class="states">
|
|
756
|
-
<div class="state" inert><select class="select" data-size="sm" aria-label="Small select"><option>Small</option></select><span class="caption">sm</span></div>
|
|
757
|
-
<div class="state" inert><select class="select" data-size="md" aria-label="Medium select"><option>Medium</option></select><span class="caption">md</span></div>
|
|
758
|
-
<div class="state" inert><select class="select" data-size="lg" aria-label="Large select"><option>Large</option></select><span class="caption">lg</span></div>
|
|
759
|
-
</div></div>
|
|
760
|
-
<div class="row"><h4>Open picker</h4><div class="states">
|
|
761
|
-
<div class="state" inert aria-hidden="true"><ul class="picker"><li>Last hour</li><li class="is-hover">Last 24 hours</li><li aria-selected="true">Last 7 days</li></ul><span class="caption">A static drawing: hover on one option, another checked</span></div>
|
|
762
|
-
</div></div>
|
|
763
|
-
</section>
|
|
764
|
-
|
|
765
|
-
<!-- Field wrapper -->
|
|
766
|
-
<section class="component" id="field-wrapper" data-layer="Core" aria-labelledby="fieldw-title">
|
|
767
|
-
<header><h3 id="fieldw-title">Field wrapper</h3><span class="badge">Core</span><a href="components.md#field-wrapper">Spec</a></header>
|
|
768
|
-
<div class="row"><h4>Description and error</h4><div class="states">
|
|
769
|
-
<div class="state"><div class="field"><label class="field-label" for="fw-desc">Threshold</label><input class="input" id="fw-desc" inputmode="numeric" value="300" aria-describedby="fw-desc-text"><p class="field-description" id="fw-desc-text">Milliseconds at p95.</p></div><span class="caption">With description</span></div>
|
|
770
|
-
<div class="state" inert><div class="field"><label class="field-label" for="fw-error">Threshold</label><input class="input" id="fw-error" value="-1" aria-invalid="true" aria-errormessage="fw-error-text"><p class="field-error" id="fw-error-text">Enter a positive number.</p></div><span class="caption">Error replaces the description</span></div>
|
|
771
|
-
</div></div>
|
|
772
|
-
</section>
|
|
773
|
-
|
|
774
|
-
<!-- Checkbox and radio -->
|
|
775
|
-
<section class="component" id="checkbox-and-radio" data-layer="Core" aria-labelledby="check-title">
|
|
776
|
-
<header><h3 id="check-title">Checkbox and radio</h3><span class="badge">Core</span><a href="components.md#checkbox-and-radio">Spec</a></header>
|
|
961
|
+
<section class="component" id="checkbox-and-radio" data-layer="Core" data-states="selected focus disabled" aria-labelledby="check-title">
|
|
962
|
+
<header><h3 id="check-title">Checkbox and radio</h3><span class="badge">Core</span><a href="components.md#checkbox-and-radio">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="checkbox-and-radio" aria-label="Copy link to Checkbox and radio" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
963
|
+
<p class="purpose">Pick several options, or one from a short list.</p>
|
|
964
|
+
<dl class="guidance"><dt>Do</dt><dd>Checkboxes for options the reader can pick in any combination. Radios for one choice from a short list that stays in view.</dd><dt>Don’t</dt><dd>A label written as a question, such as “Send updates?”, or as a negative, such as “Don’t email me”. Name the option: “Email me updates”.</dd></dl>
|
|
777
965
|
<div class="row"><h4>Checkbox</h4><div class="states">
|
|
778
966
|
<div class="state"><label class="check"><input type="checkbox">Notify on recovery</label><span class="caption">Rest</span></div>
|
|
779
967
|
<div class="state" inert><label class="check"><input type="checkbox" checked>Notify on recovery</label><span class="caption">Checked</span></div>
|
|
@@ -793,9 +981,10 @@
|
|
|
793
981
|
</div></div>
|
|
794
982
|
</section>
|
|
795
983
|
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
<
|
|
984
|
+
<section class="component" id="radio-card-group" data-layer="Core" data-states="hover selected focus disabled" aria-labelledby="rc-title">
|
|
985
|
+
<header><h3 id="rc-title">Radio card group</h3><span class="badge">Core</span><a href="components.md#radio-card-group">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="radio-card-group" aria-label="Copy link to Radio card group" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
986
|
+
<p class="purpose">Pick one option that needs a description.</p>
|
|
987
|
+
<dl class="guidance"><dt>Do</dt><dd>Use radio cards when the reader chooses by a description, such as plans or deploy modes. Give each card a title and one line on what differs.</dd><dt>Don’t</dt><dd>Radio cards for options that a title alone explains. Use radios.</dd></dl>
|
|
799
988
|
<div class="row"><h4>Live</h4><div class="states">
|
|
800
989
|
<div class="state wide"><fieldset class="radio-cards"><legend class="sr-only">Delivery</legend><label class="radio-card"><input type="radio" name="delivery" checked><strong>Immediate</strong><span class="muted">Send each alert.</span></label><label class="radio-card"><input type="radio" name="delivery"><strong>Digest</strong><span class="muted">Group the alerts.</span></label></fieldset><span class="caption">Rest; Immediate is selected</span></div>
|
|
801
990
|
</div></div>
|
|
@@ -805,9 +994,10 @@
|
|
|
805
994
|
</div></div>
|
|
806
995
|
</section>
|
|
807
996
|
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
<
|
|
997
|
+
<section class="component" id="switch" data-layer="Core" data-states="selected focus disabled" aria-labelledby="switch-title">
|
|
998
|
+
<header><h3 id="switch-title">Switch</h3><span class="badge">Core</span><a href="components.md#switch">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="switch" aria-label="Copy link to Switch" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
999
|
+
<p class="purpose">Turn a setting on or off at once.</p>
|
|
1000
|
+
<dl class="guidance"><dt>Do</dt><dd>Use a switch for a setting that applies the moment it changes. Its label names the setting, such as “Dark mode”, and stays the same when on or off.</dd><dt>Don’t</dt><dd>A switch in a form that applies on submit. Use a checkbox there.</dd></dl>
|
|
811
1001
|
<div class="row"><h4>States</h4><div class="states">
|
|
812
1002
|
<div class="state"><div class="switch-row"><button class="switch" id="sw-rest" type="button" role="switch" aria-checked="false" aria-labelledby="sw-rest-label"><span class="switch-track" aria-hidden="true"></span></button><label id="sw-rest-label" for="sw-rest">Alerts</label></div><span class="caption">Off, live</span></div>
|
|
813
1003
|
<div class="state" inert><div class="switch-row"><button class="switch" id="sw-on" type="button" role="switch" aria-checked="true" aria-labelledby="sw-on-label"><span class="switch-track" aria-hidden="true"></span></button><label id="sw-on-label" for="sw-on">Alerts</label></div><span class="caption">On</span></div>
|
|
@@ -822,9 +1012,10 @@
|
|
|
822
1012
|
</div></div>
|
|
823
1013
|
</section>
|
|
824
1014
|
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
<
|
|
1015
|
+
<section class="component" id="toggle-button" data-layer="Core" data-states="hover pressed focus disabled" aria-labelledby="toggle-title">
|
|
1016
|
+
<header><h3 id="toggle-title">Toggle button</h3><span class="badge">Core</span><a href="components.md#toggle-button">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="toggle-button" aria-label="Copy link to Toggle button" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1017
|
+
<p class="purpose">A labelled card that latches on, with a switch inside.</p>
|
|
1018
|
+
<dl class="guidance"><dt>Do</dt><dd>Use it for an on or off option whose label sits inside the control, such as “Wrap lines” in a viewer’s toolbar.</dd><dt>Don’t</dt><dd>A toggle button for an action that runs once, such as Refresh. It stays on until pressed again; an action is a button.</dd></dl>
|
|
828
1019
|
<div class="row"><h4>States</h4><div class="states">
|
|
829
1020
|
<div class="state"><button class="toggle" type="button" aria-pressed="false" data-live-toggle><span class="toggle-track" aria-hidden="true"></span><span class="toggle-text">Wrap lines<small>Long lines fold</small></span></button><span class="caption">Rest, live</span></div>
|
|
830
1021
|
<div class="state" inert><button class="toggle is-hover" type="button" aria-pressed="false"><span class="toggle-track" aria-hidden="true"></span><span class="toggle-text">Wrap lines</span></button><span class="caption">Hover</span></div>
|
|
@@ -839,9 +1030,10 @@
|
|
|
839
1030
|
</div></div>
|
|
840
1031
|
</section>
|
|
841
1032
|
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
<
|
|
1033
|
+
<section class="component" id="segmented-control" data-layer="Core" data-states="hover pressed focus disabled" aria-labelledby="seg-title">
|
|
1034
|
+
<header><h3 id="seg-title">Segmented control</h3><span class="badge">Core</span><a href="components.md#segmented-control">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="segmented-control" aria-label="Copy link to Segmented control" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1035
|
+
<p class="purpose">Two to five short options that apply at once.</p>
|
|
1036
|
+
<dl class="guidance"><dt>Do</dt><dd>Use it for two to five short options that apply at once and change how the same content shows, such as a view mode or the System, Light, and Dark choice.</dd><dt>Don’t</dt><dd>A segmented control that switches between panels of content. Use tabs.</dd></dl>
|
|
845
1037
|
<p class="note">The live control glides its thumb between options: 260ms for the leading edge, 300ms for the trailing edge. The theme picker at the top uses the same script, and it does not glide when the page loads a saved choice.</p>
|
|
846
1038
|
<div class="row"><h4>Text</h4><div class="states">
|
|
847
1039
|
<div class="state"><div class="segmented" role="group" aria-label="View" data-live><button type="button" aria-pressed="true">List</button><button type="button" aria-pressed="false">Board</button><button type="button" aria-pressed="false">Timeline</button></div><span class="caption">Rest, live</span></div>
|
|
@@ -856,24 +1048,94 @@
|
|
|
856
1048
|
</div></div>
|
|
857
1049
|
</section>
|
|
858
1050
|
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
<
|
|
1051
|
+
<section class="layer-head" id="group-inputs" aria-labelledby="group-inputs-title">
|
|
1052
|
+
<h2 id="group-inputs-title">Inputs</h2>
|
|
1053
|
+
<p>Enter text and values.</p>
|
|
1054
|
+
</section>
|
|
1055
|
+
|
|
1056
|
+
<section class="component" id="text-input-and-textarea" data-layer="Core" data-states="focus disabled invalid" aria-labelledby="input-title">
|
|
1057
|
+
<header><h3 id="input-title">Text input and textarea</h3><span class="badge">Core</span><a href="components.md#text-input-and-textarea">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="text-input-and-textarea" aria-label="Copy link to Text input and textarea" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1058
|
+
<p class="purpose">Type a short value or a longer note.</p>
|
|
1059
|
+
<dl class="guidance"><dt>Do</dt><dd>A textarea for an answer longer than one line, and <code>type="search"</code> for a field that filters.</dd><dt>Don’t</dt><dd>A label or an instruction that lives only in the placeholder. It disappears as the reader types.</dd></dl>
|
|
1060
|
+
<div class="row"><h4>Input</h4><div class="states">
|
|
1061
|
+
<div class="state"><div class="field"><label class="field-label" for="in-rest">Service</label><input class="input" id="in-rest" placeholder="checkout-api"></div><span class="caption">Rest</span></div>
|
|
1062
|
+
<div class="state" inert><div class="field"><label class="field-label" for="in-focus">Service</label><input class="input is-focus" id="in-focus" value="checkout-api"></div><span class="caption">Focus visible</span></div>
|
|
1063
|
+
<div class="state" inert><div class="field"><label class="field-label" for="in-disabled">Service</label><input class="input" id="in-disabled" value="checkout-api" disabled></div><span class="caption">Disabled</span></div>
|
|
1064
|
+
<div class="state" inert><div class="field"><label class="field-label" for="in-invalid">Service</label><input class="input" id="in-invalid" aria-invalid="true" aria-errormessage="in-invalid-error"><p class="field-error" id="in-invalid-error">Enter a service name.</p></div><span class="caption">Invalid</span></div>
|
|
1065
|
+
<div class="state" inert><div class="field"><label class="field-label" for="in-invalid-focus">Service</label><input class="input is-focus" id="in-invalid-focus" aria-invalid="true" aria-errormessage="in-invalid-focus-error"><p class="field-error" id="in-invalid-focus-error">Enter a service name.</p></div><span class="caption">Invalid, focus visible</span></div>
|
|
1066
|
+
</div></div>
|
|
1067
|
+
<div class="row"><h4>Search</h4><div class="states">
|
|
1068
|
+
<div class="state"><label class="search"><svg class="icon" aria-hidden="true"><use href="#i-search"/></svg><input type="search" aria-label="Search monitors" value="latency"></label><span class="caption">Live; focus it to show the clear cross, which darkens on hover</span></div>
|
|
1069
|
+
<div class="state" inert><label class="search is-focus"><svg class="icon" aria-hidden="true"><use href="#i-search"/></svg><input type="search" aria-label="Search monitors, focused" value="latency"></label><span class="caption">Focus visible</span></div>
|
|
1070
|
+
</div></div>
|
|
1071
|
+
<div class="row"><h4>Sizes</h4><div class="states">
|
|
1072
|
+
<div class="state" inert><input class="input" data-size="sm" aria-label="Small input" placeholder="Small"><span class="caption">sm</span></div>
|
|
1073
|
+
<div class="state" inert><input class="input" data-size="md" aria-label="Medium input" placeholder="Medium"><span class="caption">md</span></div>
|
|
1074
|
+
<div class="state" inert><input class="input" data-size="lg" aria-label="Large input" placeholder="Large"><span class="caption">lg</span></div>
|
|
1075
|
+
</div></div>
|
|
1076
|
+
<div class="row"><h4>Textarea</h4><div class="states">
|
|
1077
|
+
<div class="state"><div class="field"><label class="field-label" for="ta-rest">Note</label><textarea class="textarea" id="ta-rest" placeholder="What changed?"></textarea></div><span class="caption">Rest</span></div>
|
|
1078
|
+
<div class="state" inert><div class="field"><label class="field-label" for="ta-focus">Note</label><textarea class="textarea is-focus" id="ta-focus">Raised the threshold.</textarea></div><span class="caption">Focus visible</span></div>
|
|
1079
|
+
<div class="state" inert><div class="field"><label class="field-label" for="ta-disabled">Note</label><textarea class="textarea" id="ta-disabled" disabled>Raised the threshold.</textarea></div><span class="caption">Disabled</span></div>
|
|
1080
|
+
<div class="state" inert><div class="field"><label class="field-label" for="ta-invalid">Note</label><textarea class="textarea" id="ta-invalid" aria-invalid="true" aria-errormessage="ta-invalid-error"></textarea><p class="field-error" id="ta-invalid-error">Add a note.</p></div><span class="caption">Invalid</span></div>
|
|
1081
|
+
</div></div>
|
|
1082
|
+
</section>
|
|
1083
|
+
|
|
1084
|
+
<section class="component" id="select" data-layer="Core" data-states="focus disabled invalid" aria-labelledby="select-title">
|
|
1085
|
+
<header><h3 id="select-title">Select</h3><span class="badge">Core</span><a href="components.md#select">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="select" aria-label="Copy link to Select" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1086
|
+
<p class="purpose">Choose from a longer list.</p>
|
|
1087
|
+
<dl class="guidance"><dt>Do</dt><dd>Use a select for one choice from more than five options, in a predictable order: alphabetical, numeric, or by frequency of use.</dd><dt>Don’t</dt><dd>A first option that acts as the label, such as “Choose a region”. The label goes above the field.</dd></dl>
|
|
1088
|
+
<div class="row"><h4>Closed</h4><div class="states">
|
|
1089
|
+
<div class="state"><div class="field"><label class="field-label" for="se-rest">Window</label><select class="select" id="se-rest"><option>Last hour</option><option>Last 24 hours</option><option>Last 7 days</option></select></div><span class="caption">Rest</span></div>
|
|
1090
|
+
<div class="state" inert><div class="field"><label class="field-label" for="se-focus">Window</label><select class="select is-focus" id="se-focus"><option>Last hour</option></select></div><span class="caption">Focus visible</span></div>
|
|
1091
|
+
<div class="state" inert><div class="field"><label class="field-label" for="se-disabled">Window</label><select class="select" id="se-disabled" disabled><option>Last hour</option></select></div><span class="caption">Disabled</span></div>
|
|
1092
|
+
<div class="state" inert><div class="field"><label class="field-label" for="se-invalid">Window</label><select class="select" id="se-invalid" aria-invalid="true" aria-errormessage="se-invalid-error"><option></option></select><p class="field-error" id="se-invalid-error">Choose a window.</p></div><span class="caption">Invalid</span></div>
|
|
1093
|
+
</div></div>
|
|
1094
|
+
<div class="row"><h4>Sizes</h4><div class="states">
|
|
1095
|
+
<div class="state" inert><select class="select" data-size="sm" aria-label="Small select"><option>Small</option></select><span class="caption">sm</span></div>
|
|
1096
|
+
<div class="state" inert><select class="select" data-size="md" aria-label="Medium select"><option>Medium</option></select><span class="caption">md</span></div>
|
|
1097
|
+
<div class="state" inert><select class="select" data-size="lg" aria-label="Large select"><option>Large</option></select><span class="caption">lg</span></div>
|
|
1098
|
+
</div></div>
|
|
1099
|
+
<div class="row"><h4>Open picker</h4><div class="states">
|
|
1100
|
+
<div class="state" inert aria-hidden="true"><ul class="picker"><li>Last hour</li><li class="is-hover">Last 24 hours</li><li aria-selected="true">Last 7 days</li></ul><span class="caption">A static drawing: hover on one option, another checked</span></div>
|
|
1101
|
+
</div></div>
|
|
1102
|
+
</section>
|
|
1103
|
+
|
|
1104
|
+
<section class="component" id="field-wrapper" data-layer="Core" data-states="invalid" aria-labelledby="fieldw-title">
|
|
1105
|
+
<header><h3 id="fieldw-title">Field wrapper</h3><span class="badge">Core</span><a href="components.md#field-wrapper">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="field-wrapper" aria-label="Copy link to Field wrapper" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1106
|
+
<p class="purpose">Label, description, and error text around a field.</p>
|
|
1107
|
+
<dl class="guidance"><dt>Do</dt><dd>Write the error as the fix, such as “Enter a date after today”, and the description as a format or limit, such as “Up to 64 characters”.</dd><dt>Don’t</dt><dd>A description that repeats the label, or an error that only says “Invalid”.</dd></dl>
|
|
1108
|
+
<div class="row"><h4>Description and error</h4><div class="states">
|
|
1109
|
+
<div class="state"><div class="field"><label class="field-label" for="fw-desc">Threshold</label><input class="input" id="fw-desc" inputmode="numeric" value="300" aria-describedby="fw-desc-text"><p class="field-description" id="fw-desc-text">Milliseconds at p95.</p></div><span class="caption">With description</span></div>
|
|
1110
|
+
<div class="state" inert><div class="field"><label class="field-label" for="fw-error">Threshold</label><input class="input" id="fw-error" value="-1" aria-invalid="true" aria-errormessage="fw-error-text"><p class="field-error" id="fw-error-text">Enter a positive number.</p></div><span class="caption">Error replaces the description</span></div>
|
|
1111
|
+
</div></div>
|
|
1112
|
+
</section>
|
|
1113
|
+
|
|
1114
|
+
<section class="component" id="slider" data-layer="Core" data-states="focus disabled" aria-labelledby="slider-title">
|
|
1115
|
+
<header><h3 id="slider-title">Slider</h3><span class="badge">Core</span><a href="components.md#slider">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="slider" aria-label="Copy link to Slider" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1116
|
+
<p class="purpose">Set a value in a range.</p>
|
|
1117
|
+
<dl class="guidance"><dt>Do</dt><dd>Use a slider for an approximate value in a range, such as volume or opacity, and show the current value as text beside it.</dd><dt>Don’t</dt><dd>A slider for a value the reader must set exactly, such as a port or a price. Use a text input.</dd></dl>
|
|
862
1118
|
<div class="row"><h4>States</h4><div class="states">
|
|
863
|
-
<div class="state"><div class="field"><label class="field-label" for="sl-rest">Sample rate</label><input class="range" id="sl-rest" type="range" min="0" max="100" value="40" style="--value:40%" data-live-range></div><span class="caption">Rest, live</span></div>
|
|
864
|
-
<div class="state" inert><input class="range is-focus" type="range" aria-label="Sample rate, focused" min="0" max="100" value="60" style="--value:60%"><span class="caption">Focus visible</span></div>
|
|
865
|
-
<div class="state" inert><input class="range" type="range" aria-label="Sample rate, disabled" min="0" max="100" value="60" style="--value:60%" disabled><span class="caption">Disabled</span></div>
|
|
1119
|
+
<div class="state"><div class="field"><label class="field-label" for="sl-rest">Sample rate</label><div class="slider"><input class="range" id="sl-rest" type="range" min="0" max="100" value="40" style="--value:40%" data-live-range><output class="slider-value" for="sl-rest" aria-live="off">40%</output></div></div><span class="caption">Rest, live</span></div>
|
|
1120
|
+
<div class="state" inert><div class="slider"><input class="range is-focus" id="sl-focus" type="range" aria-label="Sample rate, focused" min="0" max="100" value="60" style="--value:60%"><output class="slider-value" for="sl-focus" aria-live="off">60%</output></div><span class="caption">Focus visible</span></div>
|
|
1121
|
+
<div class="state" inert><div class="slider"><input class="range" id="sl-disabled" type="range" aria-label="Sample rate, disabled" min="0" max="100" value="60" style="--value:60%" disabled><output class="slider-value" for="sl-disabled" aria-live="off">60%</output></div><span class="caption">Disabled</span></div>
|
|
866
1122
|
</div></div>
|
|
867
1123
|
<div class="row"><h4>Sizes</h4><div class="states">
|
|
868
|
-
<div class="state" inert><input class="range" data-size="sm" type="range" aria-label="Small slider" min="0" max="100" value="50"><span class="caption">sm</span></div>
|
|
869
|
-
<div class="state" inert><input class="range" type="range" aria-label="Medium slider" min="0" max="100" value="50"><span class="caption">md</span></div>
|
|
870
|
-
<div class="state" inert><input class="range" data-size="lg" type="range" aria-label="Large slider" min="0" max="100" value="50"><span class="caption">lg</span></div>
|
|
1124
|
+
<div class="state" inert><div class="slider"><input class="range" id="sl-sm" data-size="sm" type="range" aria-label="Small slider" min="0" max="100" value="50"><output class="slider-value" for="sl-sm" aria-live="off">50%</output></div><span class="caption">sm</span></div>
|
|
1125
|
+
<div class="state" inert><div class="slider"><input class="range" id="sl-md" type="range" aria-label="Medium slider" min="0" max="100" value="50"><output class="slider-value" for="sl-md" aria-live="off">50%</output></div><span class="caption">md</span></div>
|
|
1126
|
+
<div class="state" inert><div class="slider"><input class="range" id="sl-lg" data-size="lg" type="range" aria-label="Large slider" min="0" max="100" value="50"><output class="slider-value" for="sl-lg" aria-live="off">50%</output></div><span class="caption">lg</span></div>
|
|
871
1127
|
</div></div>
|
|
872
1128
|
</section>
|
|
873
1129
|
|
|
874
|
-
|
|
1130
|
+
<section class="layer-head" id="group-feedback" aria-labelledby="group-feedback-title">
|
|
1131
|
+
<h2 id="group-feedback-title">Feedback and status</h2>
|
|
1132
|
+
<p>Show state, progress, and caveats.</p>
|
|
1133
|
+
</section>
|
|
1134
|
+
|
|
875
1135
|
<section class="component" id="progress" data-layer="Core" aria-labelledby="progress-title">
|
|
876
|
-
<header><h3 id="progress-title">Progress</h3><span class="badge">Core</span><a href="components.md#progress">Spec</a></header>
|
|
1136
|
+
<header><h3 id="progress-title">Progress</h3><span class="badge">Core</span><a href="components.md#progress">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="progress" aria-label="Copy link to Progress" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1137
|
+
<p class="purpose">Show how far a task has got.</p>
|
|
1138
|
+
<dl class="guidance"><dt>Do</dt><dd>Use it for a task with a known end, such as an import, and name it for the task.</dd><dt>Don’t</dt><dd>A progress bar for a measured value, such as disk usage or a rating. It shows a task moving to its end; use text or a score.</dd></dl>
|
|
877
1139
|
<div class="row"><h4>Values</h4><div class="states">
|
|
878
1140
|
<div class="state"><div class="progress" role="progressbar" aria-label="Import, empty" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span style="transform:translateX(-100%)"></span></div><span class="caption">0%</span></div>
|
|
879
1141
|
<div class="state"><div class="progress" role="progressbar" aria-label="Import" aria-valuemin="0" aria-valuemax="100" aria-valuenow="40"><span style="transform:translateX(-60%)"></span></div><span class="caption">40%</span></div>
|
|
@@ -881,35 +1143,20 @@
|
|
|
881
1143
|
</div></div>
|
|
882
1144
|
</section>
|
|
883
1145
|
|
|
884
|
-
<!-- Score -->
|
|
885
1146
|
<section class="component" id="score" data-layer="Core" aria-labelledby="score-title">
|
|
886
|
-
<header><h3 id="score-title">Score</h3><span class="badge">Core</span><a href="components.md#score">Spec</a></header>
|
|
1147
|
+
<header><h3 id="score-title">Score</h3><span class="badge">Core</span><a href="components.md#score">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="score" aria-label="Copy link to Score" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1148
|
+
<p class="purpose">Show a value out of a maximum.</p>
|
|
1149
|
+
<dl class="guidance"><dt>Do</dt><dd>Use it for a value out of a fixed maximum, such as 4/5, and keep one maximum across a list so the rows compare.</dd><dt>Don’t</dt><dd>A score for a percentage or an open-ended count. Write the number as text.</dd></dl>
|
|
887
1150
|
<div class="row"><h4>Values</h4><div class="states">
|
|
888
1151
|
<div class="state"><span class="score"><span class="pips" aria-hidden="true"><i class="on"></i><i class="on"></i><i class="on"></i><i></i><i></i></span><b>3<span>/5</span></b></span><span class="caption">3 of 5</span></div>
|
|
889
1152
|
<div class="state"><span class="score"><span class="pips" aria-hidden="true"><i class="on"></i><i class="on"></i><i class="on"></i><i class="on"></i><i class="on"></i></span><b>5<span>/5</span></b></span><span class="caption">5 of 5</span></div>
|
|
890
1153
|
</div></div>
|
|
891
1154
|
</section>
|
|
892
1155
|
|
|
893
|
-
<!-- Tabs -->
|
|
894
|
-
<section class="component" id="tabs" data-layer="Core" aria-labelledby="tabs-title">
|
|
895
|
-
<header><h3 id="tabs-title">Tabs</h3><span class="badge">Core</span><a href="components.md#tabs">Spec</a></header>
|
|
896
|
-
<div class="row"><h4>Live</h4><div class="states">
|
|
897
|
-
<div class="state wide" data-tabs data-label="Monitor">
|
|
898
|
-
<!-- Without JavaScript every panel shows under its heading; the script builds the tab list. -->
|
|
899
|
-
<section class="tabpanel" id="panel-overview" aria-labelledby="panel-overview-heading"><h5 class="tabs-heading" id="panel-overview-heading">Overview</h5><p>Arrow keys move between tabs; Home and End jump to the ends.</p></section>
|
|
900
|
-
<section class="tabpanel" id="panel-history" aria-labelledby="panel-history-heading"><h5 class="tabs-heading" id="panel-history-heading">History</h5><p>Seven days of evaluations.</p></section>
|
|
901
|
-
<section class="tabpanel" id="panel-settings" aria-labelledby="panel-settings-heading"><h5 class="tabs-heading" id="panel-settings-heading">Settings</h5><p>Threshold and notification settings.</p></section>
|
|
902
|
-
</div>
|
|
903
|
-
</div></div>
|
|
904
|
-
<div class="row"><h4>Pinned</h4><div class="states">
|
|
905
|
-
<div class="state" inert><div class="tablist" role="tablist" aria-label="Monitor, hover"><button class="tab" type="button" role="tab" aria-selected="true">Overview</button><button class="tab is-hover" type="button" role="tab" aria-selected="false">History</button></div><span class="caption">Hover on History</span></div>
|
|
906
|
-
<div class="state" inert><div class="tablist" role="tablist" aria-label="Monitor, focus"><button class="tab is-focus" type="button" role="tab" aria-selected="true">Overview</button><button class="tab" type="button" role="tab" aria-selected="false">History</button></div><span class="caption">Focus visible</span></div>
|
|
907
|
-
</div></div>
|
|
908
|
-
</section>
|
|
909
|
-
|
|
910
|
-
<!-- Badge -->
|
|
911
1156
|
<section class="component" id="badge" data-layer="Core" aria-labelledby="badge-title">
|
|
912
|
-
<header><h3 id="badge-title">Badge</h3><span class="badge">Core</span><a href="components.md#badge">Spec</a></header>
|
|
1157
|
+
<header><h3 id="badge-title">Badge</h3><span class="badge">Core</span><a href="components.md#badge">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="badge" aria-label="Copy link to Badge" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1158
|
+
<p class="purpose">A short status label.</p>
|
|
1159
|
+
<dl class="guidance"><dt>Do</dt><dd>A one- or two-word status or category on an item, such as “Healthy” or “Beta”, with a status tone only when it is a status.</dd><dt>Don’t</dt><dd>A badge that repeats the title, or one on every row with the same value. Badge the exceptions.</dd></dl>
|
|
913
1160
|
<div class="row"><h4>Tones</h4><div class="states">
|
|
914
1161
|
<div class="state"><span class="badge">No data</span><span class="caption">Neutral</span></div>
|
|
915
1162
|
<div class="state"><span class="badge success">Healthy</span><span class="caption">Success</span></div>
|
|
@@ -919,9 +1166,10 @@
|
|
|
919
1166
|
</div></div>
|
|
920
1167
|
</section>
|
|
921
1168
|
|
|
922
|
-
<!-- Alert -->
|
|
923
1169
|
<section class="component" id="alert" data-layer="Core" aria-labelledby="alert-title">
|
|
924
|
-
<header><h3 id="alert-title">Alert</h3><span class="badge">Core</span><a href="components.md#alert">Spec</a></header>
|
|
1170
|
+
<header><h3 id="alert-title">Alert</h3><span class="badge">Core</span><a href="components.md#alert">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="alert" aria-label="Copy link to Alert" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1171
|
+
<p class="purpose">A real caveat or status message in the page.</p>
|
|
1172
|
+
<dl class="guidance"><dt>Do</dt><dd>Use an alert for a caveat or status message the reader needs before acting. When action is needed, name it, such as “Reconnect the source to resume sync”.</dd><dt>Don’t</dt><dd>An alert for decoration or routine emphasis. A short status label is a badge; explanations and recovery instructions stay in an alert.</dd></dl>
|
|
925
1173
|
<div class="row"><h4>Tones</h4><div class="states">
|
|
926
1174
|
<div class="state wide"><div class="alert"><svg class="icon" aria-hidden="true"><use href="#i-help"/></svg><p>Values are sampled every 5 minutes.</p></div><span class="caption">Neutral</span></div>
|
|
927
1175
|
<div class="state wide"><div class="alert success"><svg class="icon" aria-hidden="true"><use href="#i-check"/></svg><p>The monitor recovered at 14:20.</p></div><span class="caption">Success</span></div>
|
|
@@ -931,9 +1179,15 @@
|
|
|
931
1179
|
</div></div>
|
|
932
1180
|
</section>
|
|
933
1181
|
|
|
934
|
-
|
|
1182
|
+
<section class="layer-head" id="group-containers" aria-labelledby="group-containers-title">
|
|
1183
|
+
<h2 id="group-containers-title">Containers and overlays</h2>
|
|
1184
|
+
<p>Group content, or lay a task over the page.</p>
|
|
1185
|
+
</section>
|
|
1186
|
+
|
|
935
1187
|
<section class="component" id="surface-and-card" data-layer="Core" aria-labelledby="card-title">
|
|
936
|
-
<header><h3 id="card-title">Surface and card</h3><span class="badge">Core</span><a href="components.md#surface-and-card">Spec</a></header>
|
|
1188
|
+
<header><h3 id="card-title">Surface and card</h3><span class="badge">Core</span><a href="components.md#surface-and-card">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="surface-and-card" aria-label="Copy link to Surface and card" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1189
|
+
<p class="purpose">Panels and cards for parallel, comparable content.</p>
|
|
1190
|
+
<dl class="guidance"><dt>Do</dt><dd>Use cards for a few parallel, self-contained items that a reader compares, such as plans or projects.</dd><dt>Don’t</dt><dd>A panel inside a panel, or cards around ordinary prose.</dd></dl>
|
|
937
1191
|
<div class="row"><h4>Card</h4><div class="states">
|
|
938
1192
|
<div class="state wide"><article class="card" aria-labelledby="card-sample-title"><div class="card-head"><h4 id="card-sample-title">API p95 latency</h4><span class="badge danger">Alerting</span></div><div class="card-body">412 ms against a 300 ms threshold for 10 minutes.</div><div class="card-foot"><span>checkout-api</span><span>Updated 2 minutes ago</span></div></article><span class="caption">Header, body, and footer</span></div>
|
|
939
1193
|
</div></div>
|
|
@@ -943,54 +1197,154 @@
|
|
|
943
1197
|
</div></div>
|
|
944
1198
|
</section>
|
|
945
1199
|
|
|
946
|
-
<!-- Figure -->
|
|
947
1200
|
<section class="component" id="figure" data-layer="Core" aria-labelledby="figure-title">
|
|
948
|
-
<header><h3 id="figure-title">Figure</h3><span class="badge">Core</span><a href="components.md#figure">Spec</a></header>
|
|
1201
|
+
<header><h3 id="figure-title">Figure</h3><span class="badge">Core</span><a href="components.md#figure">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="figure" aria-label="Copy link to Figure" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1202
|
+
<p class="purpose">An image or diagram with a caption.</p>
|
|
1203
|
+
<dl class="guidance"><dt>Do</dt><dd>Caption every figure with what it shows. When the prose refers to one figure by number, number them all.</dd><dt>Don’t</dt><dd>A screenshot of code or of a component. Show code as text, so the reader can copy it, and a component live.</dd></dl>
|
|
949
1204
|
<figure class="figure"><div class="figure-plate"><div class="cluster" style="display:flex;gap:var(--space-2);flex-wrap:wrap"><span class="badge success">Healthy</span><span class="badge warning">Warning</span><span class="badge danger">Alerting</span></div></div><figcaption><b>Figure 1.</b> A well with its caption below.</figcaption></figure>
|
|
950
1205
|
</section>
|
|
951
1206
|
|
|
952
|
-
<!-- Dialog -->
|
|
953
1207
|
<section class="component" id="dialog" data-layer="Core" aria-labelledby="dialog-title">
|
|
954
|
-
<header><h3 id="dialog-title">Dialog</h3><span class="badge">Core</span><a href="components.md#dialog">Spec</a></header>
|
|
1208
|
+
<header><h3 id="dialog-title">Dialog</h3><span class="badge">Core</span><a href="components.md#dialog">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="dialog" aria-label="Copy link to Dialog" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1209
|
+
<p class="purpose">A modal task that needs an answer before the page continues.</p>
|
|
1210
|
+
<dl class="guidance"><dt>Do</dt><dd>Use a dialog for a short task the reader must finish or cancel before the page continues, such as confirming a deletion. Title it with that task.</dd><dt>Don’t</dt><dd>A dialog that opens without the reader asking, such as on page load, or one that holds a long form. A long form gets its own page.</dd></dl>
|
|
955
1211
|
<div class="row"><h4>Live</h4><div class="states">
|
|
956
1212
|
<div class="state"><button class="btn secondary" type="button" data-open="live-dialog">Open dialog</button><span class="caption">Opens a native modal dialog</span></div>
|
|
957
1213
|
</div></div>
|
|
958
1214
|
<div class="row"><h4>In place</h4><div class="states">
|
|
959
|
-
<div class="state wide" inert><div class="dialog" role="dialog" aria-labelledby="dlg-static-title" aria-describedby="dlg-static-desc"><div class="dialog-head"><div><h4 id="dlg-static-title">Delete monitor</h4><p id="dlg-static-desc">This removes its history.</p></div><button class="quiet-action close" type="button" aria-label="Close dialog"><svg class="icon" aria-hidden="true"><use href="#i-close"/></svg></button></div><div class="dialog-body">API p95 latency stops alerting at once.</div><div class="dialog-foot"><button class="btn secondary" type="button">Cancel</button><button class="btn danger" type="button">Delete</button></div></div><span class="caption">Static specimen; the real one sits over an <code>--overlay</code> backdrop</span></div>
|
|
1215
|
+
<div class="state wide" inert><div class="dialog" role="dialog" aria-labelledby="dlg-static-title" aria-describedby="dlg-static-desc"><div class="dialog-head"><div><h4 id="dlg-static-title">Delete monitor</h4><p id="dlg-static-desc">This removes its history.</p></div><button class="quiet-action close" type="button" aria-label="Close dialog"><svg class="icon" aria-hidden="true"><use href="#i-close"/></svg></button></div><div class="dialog-body">API p95 latency stops alerting at once.</div><div class="dialog-foot"><button class="btn secondary" type="button">Cancel</button><button class="btn danger" type="button">Delete</button></div></div><span class="caption">Static specimen; the real one sits over an <code>--color-overlay</code> backdrop</span></div>
|
|
960
1216
|
</div></div>
|
|
961
1217
|
</section>
|
|
962
1218
|
|
|
963
|
-
<!-- Drawer -->
|
|
964
1219
|
<section class="component" id="drawer" data-layer="Core" aria-labelledby="drawer-title">
|
|
965
|
-
<header><h3 id="drawer-title">Drawer</h3><span class="badge">Core</span><a href="components.md#drawer">Spec</a></header>
|
|
1220
|
+
<header><h3 id="drawer-title">Drawer</h3><span class="badge">Core</span><a href="components.md#drawer">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="drawer" aria-label="Copy link to Drawer" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1221
|
+
<p class="purpose">A side panel, such as phone navigation.</p>
|
|
1222
|
+
<dl class="guidance"><dt>Do</dt><dd>Use a drawer for navigation or supporting detail that slides in from the side, such as the phone menu, and open it from a named button.</dd><dt>Don’t</dt><dd>The page’s main task inside a drawer. The drawer holds navigation or detail; the task stays on the page.</dd></dl>
|
|
966
1223
|
<div class="row"><h4>Live</h4><div class="states">
|
|
967
|
-
<div class="state"><button class="btn secondary menu-glyph" type="button" data-size="lg" data-open="live-drawer">Contents</button><span class="caption">
|
|
1224
|
+
<div class="state"><button class="btn secondary menu-glyph" type="button" data-size="lg" data-open="live-drawer">Contents</button><span class="caption">Rest, live: a page’s contents trigger opens a side drawer</span></div>
|
|
968
1225
|
</div></div>
|
|
969
1226
|
<div class="row"><h4>In place</h4><div class="states">
|
|
970
|
-
<div class="state wide" inert><div class="drawer" role="dialog" aria-labelledby="drw-static-title"><div class="drawer-head"><h4 id="drw-static-title">Contents</h4><button class="quiet-action close" type="button" aria-label="Close drawer"><svg class="icon" aria-hidden="true"><use href="#i-close"/></svg></button></div><div class="drawer-body"><nav class="navlist" aria-label="Contents, static"><a href="#button" aria-current="
|
|
1227
|
+
<div class="state wide" inert><div class="drawer" role="dialog" aria-labelledby="drw-static-title"><div class="drawer-head"><h4 id="drw-static-title">Contents</h4><button class="quiet-action close" type="button" aria-label="Close drawer"><svg class="icon" aria-hidden="true"><use href="#i-close"/></svg></button></div><div class="drawer-body"><nav class="navlist" aria-label="Contents, static"><a href="#button" aria-current="location">Button</a><a href="#select">Select</a><a href="#switch">Switch</a></nav></div></div><span class="caption">Open, pinned; Button is the current section</span></div>
|
|
971
1228
|
</div></div>
|
|
972
1229
|
</section>
|
|
973
1230
|
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
<
|
|
1231
|
+
<section class="layer-head" id="group-navigation" aria-labelledby="group-navigation-title">
|
|
1232
|
+
<h2 id="group-navigation-title">Navigation</h2>
|
|
1233
|
+
<p>Move between pages and sections, and find things.</p>
|
|
1234
|
+
</section>
|
|
1235
|
+
|
|
1236
|
+
<section class="component" id="navigation-list" data-layer="Core" data-states="hover selected focus" aria-labelledby="nav-title">
|
|
1237
|
+
<header><h3 id="nav-title">Navigation list</h3><span class="badge">Core</span><a href="components.md#navigation-list">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="navigation-list" aria-label="Copy link to Navigation list" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1238
|
+
<p class="purpose">Rows of links with current page and current location.</p>
|
|
1239
|
+
<dl class="guidance"><dt>Do</dt><dd>Label a page link with the destination page’s title, and an in-page link with its destination section’s heading.</dd><dt>Don’t</dt><dd>Actions such as Delete or Sign out in a navigation list. Every row is a link to a place; an action is a button.</dd></dl>
|
|
977
1240
|
<div class="row"><h4>Rows</h4><div class="states">
|
|
978
|
-
<div class="state"><nav class="navlist" aria-label="Sample routes"><span class="group-label">Guides</span><a href="
|
|
979
|
-
<div class="state" inert><nav class="navlist" aria-label="Sample routes, pinned"><a href="#navigation-list" class="is-hover">Hover</a><a href="
|
|
1241
|
+
<div class="state"><nav class="navlist" aria-label="Sample routes"><span class="group-label">Guides</span><a href="components.html" aria-current="page">Install</a><a href="#navigation-list">Configure</a><a href="#navigation-list">Release</a></nav><span class="caption">Live; Install is the current page</span></div>
|
|
1242
|
+
<div class="state" inert><nav class="navlist" aria-label="Sample routes, pinned"><a href="#navigation-list" class="is-hover">Hover</a><a href="components.html" aria-current="page" class="is-hover">Current page, hover</a><a href="#navigation-list" aria-current="location">Current location</a><a href="#navigation-list" class="is-focus">Focus visible</a></nav><span class="caption">Hover, current page with hover, current location, and focus visible</span></div>
|
|
980
1243
|
</div></div>
|
|
981
|
-
<div class="row"><h4>
|
|
982
|
-
<div class="state" inert><button class="btn secondary
|
|
983
|
-
<div class="state" inert><button class="btn secondary menu-glyph
|
|
984
|
-
<div class="state"
|
|
1244
|
+
<div class="row"><h4>Drawer triggers</h4><div class="states">
|
|
1245
|
+
<div class="state" inert><div class="section-bar"><button class="btn secondary" type="button" data-size="lg" aria-label="Menu"><svg class="icon" aria-hidden="true"><use href="#i-menu"/></svg></button></div><span class="caption">Rest: the site shell’s Menu button, in the header row; see Section rail</span></div>
|
|
1246
|
+
<div class="state" inert><button class="btn secondary menu-glyph" type="button" data-size="lg">On this page</button><span class="caption">Rest: a page’s own contents drawer, such as a docs page’s On this page</span></div>
|
|
1247
|
+
<div class="state" inert><button class="btn secondary menu-glyph is-active" type="button" data-size="lg">On this page</button><span class="caption">Pressed: the page’s contents trigger</span></div>
|
|
1248
|
+
<div class="state"><details class="rail-details"><summary class="btn secondary rail-summary" data-size="lg">On this page</summary><nav class="navlist" aria-label="On this page, no JavaScript"><a href="#navigation-list" aria-current="location">Rows</a><a href="#code-block">Next section</a></nav></details><span class="caption">Live: the contents trigger’s no-JavaScript fallback</span></div>
|
|
985
1249
|
</div></div>
|
|
986
1250
|
<div class="row"><h4>List selection</h4><div class="states">
|
|
987
1251
|
<div class="state wide" inert><div class="rows" role="listbox" aria-label="Monitors"><div role="option" aria-selected="false">Active consumers</div><div role="option" aria-selected="false">5xx error rate</div><div role="option" aria-selected="true">API p95 latency</div><div role="option" aria-selected="false" class="is-hover">Request volume</div></div><span class="caption">Selected row, and hover on the next</span></div>
|
|
988
1252
|
</div></div>
|
|
989
1253
|
</section>
|
|
990
1254
|
|
|
991
|
-
|
|
1255
|
+
<section class="component" id="section-rail" data-layer="Core" aria-labelledby="section-rail-title">
|
|
1256
|
+
<header><h3 id="section-rail-title">Section rail</h3><span class="badge">Core</span><a href="components.md#section-rail">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="section-rail" aria-label="Copy link to Section rail" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1257
|
+
<p class="purpose">A sticky list of sections that moves into a drawer on phones.</p>
|
|
1258
|
+
<dl class="guidance"><dt>Do</dt><dd>Use a rail for the sections of a long page, or for a site’s pages. A site’s pages may take a navigation strip of 6 links or fewer instead.</dd><dt>Don’t</dt><dd>A rail beside a strip or a contents list that holds the same links. Each level has one list.</dd></dl>
|
|
1259
|
+
<div class="row"><h4>Desktop rail</h4><div class="states">
|
|
1260
|
+
<div class="state"><div class="rail-specimen"><div class="find"><svg class="icon" aria-hidden="true"><use href="#i-search"/></svg><input class="input" type="search" aria-label="Find a component, specimen" placeholder="Find a component"><kbd class="key" aria-hidden="true">/</kbd></div>
|
|
1261
|
+
<nav class="navlist" aria-label="Rail specimen"><span class="group-label">Inputs</span><a href="#section-rail">Select</a><a href="#section-rail" aria-current="location">Slider</a><a href="#section-rail">Field wrapper</a></nav></div><span class="caption">Live; Slider is the current section</span></div>
|
|
1262
|
+
<div class="state" inert><div class="rail-specimen"><nav class="navlist" aria-label="Collapsible specimen"><button class="group-toggle" type="button" aria-expanded="true"><span>Inputs</span><svg class="icon" aria-hidden="true"><use href="#i-chevron-down"/></svg></button><a href="#section-rail">Select</a><a href="#section-rail">Slider</a><button class="group-toggle" type="button" aria-expanded="false"><span>Feedback</span><svg class="icon" aria-hidden="true"><use href="#i-chevron-down"/></svg></button></nav></div><span class="caption">Collapsible groups: Inputs open, Feedback closed</span></div>
|
|
1263
|
+
</div></div>
|
|
1264
|
+
<div class="row"><h4>Phone header</h4><div class="states">
|
|
1265
|
+
<div class="state wide" inert><div class="phone-head"><p class="site-name">Design system</p><div class="section-bar"><button class="btn secondary" type="button" data-size="lg" aria-label="Find a component"><svg class="icon" aria-hidden="true"><use href="#i-search"/></svg></button><button class="btn secondary" type="button" data-size="lg" aria-label="Menu"><svg class="icon" aria-hidden="true"><use href="#i-menu"/></svg></button></div></div><span class="caption">Rest: the sticky header row at tablet width, with Find and Menu</span></div>
|
|
1266
|
+
</div></div>
|
|
1267
|
+
</section>
|
|
1268
|
+
|
|
1269
|
+
<section class="component" id="find-field" data-layer="Core" aria-labelledby="find-field-title">
|
|
1270
|
+
<header><h3 id="find-field-title">Find field</h3><span class="badge">Core</span><a href="components.md#find-field">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="find-field" aria-label="Copy link to Find field" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1271
|
+
<p class="purpose">Filter a navigation list as you type.</p>
|
|
1272
|
+
<dl class="guidance"><dt>Do</dt><dd>Use it at the top of a long navigation list, such as a section rail, to filter its rows by name or purpose.</dd><dt>Don’t</dt><dd>A find field used as a site-wide search. It matches only the rows of the list it filters.</dd></dl>
|
|
1273
|
+
<div class="row"><h4>States</h4><div class="states">
|
|
1274
|
+
<div class="state"><div class="find"><svg class="icon" aria-hidden="true"><use href="#i-search"/></svg><input class="input" type="search" aria-label="Find a component, rest specimen" placeholder="Find a component"><kbd class="key" aria-hidden="true">/</kbd></div><span class="caption">Rest, live; the key hint shows the shortcut</span></div>
|
|
1275
|
+
<div class="state" inert><div class="find"><svg class="icon" aria-hidden="true"><use href="#i-search"/></svg><input class="input is-focus" type="search" aria-label="Find a component, focus specimen" value="tog"></div><span class="find-count">3 matches</span><span class="caption">Focus visible with a query; the hint hides</span></div>
|
|
1276
|
+
<div class="state" inert><div class="find-empty"><p>No component matches <q>tooltip</q>.</p><button class="btn text" type="button">Clear</button></div><span class="caption">No matches</span></div>
|
|
1277
|
+
<div class="state" inert><div class="find"><svg class="icon" aria-hidden="true"><use href="#i-search"/></svg><input class="input" type="search" aria-label="Find a component, shortcuts off specimen" placeholder="Find a component"></div><span class="caption">Rest, shortcuts off: no hint</span></div>
|
|
1278
|
+
</div></div>
|
|
1279
|
+
</section>
|
|
1280
|
+
|
|
1281
|
+
<section class="component" id="breadcrumbs" data-layer="Core" aria-labelledby="breadcrumbs-title">
|
|
1282
|
+
<header><h3 id="breadcrumbs-title">Breadcrumbs</h3><span class="badge">Core</span><a href="components.md#breadcrumbs">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="breadcrumbs" aria-label="Copy link to Breadcrumbs" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1283
|
+
<p class="purpose">The path from the site to this page.</p>
|
|
1284
|
+
<dl class="guidance"><dt>Do</dt><dd>Use breadcrumbs only at depth 3 or more, or on a page outside its site’s shell.</dd><dt>Don’t</dt><dd>A trail whose only crumb repeats the page’s h1.</dd></dl>
|
|
1285
|
+
<div class="row"><h4>Trail</h4><div class="states">
|
|
1286
|
+
<div class="state"><nav class="crumbs" aria-label="Breadcrumb, specimen"><ol><li><a href="#breadcrumbs">Design system</a></li><li><a href="#breadcrumbs">Components</a></li><li><span aria-current="page">Navigation</span></li></ol></nav><span class="caption">Rest, live; the current page is text</span></div>
|
|
1287
|
+
<div class="state" inert><nav class="crumbs" aria-label="Breadcrumb, pinned"><ol><li><a href="#breadcrumbs" class="is-hover">Design system</a></li><li><a href="#breadcrumbs" class="is-focus">Components</a></li><li><span aria-current="page">Navigation</span></li></ol></nav><span class="caption">Hover on Design system, focus visible on Components</span></div>
|
|
1288
|
+
<div class="state" inert><nav class="crumbs is-back" aria-label="Breadcrumb, phone"><ol><li><a href="#breadcrumbs">Design system</a></li><li><a href="#breadcrumbs">Components</a></li><li><span aria-current="page">Navigation</span></li></ol></nav><span class="caption">Phone: the parent only, as a back link</span></div>
|
|
1289
|
+
</div></div>
|
|
1290
|
+
</section>
|
|
1291
|
+
|
|
1292
|
+
<section class="component" id="pager" data-layer="Core" aria-labelledby="pager-title">
|
|
1293
|
+
<header><h3 id="pager-title">Pager</h3><span class="badge">Core</span><a href="components.md#pager">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="pager" aria-label="Copy link to Pager" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1294
|
+
<p class="purpose">Previous and next pages in a sequence.</p>
|
|
1295
|
+
<dl class="guidance"><dt>Do</dt><dd>Use a pager for pages a reader goes through in order, such as a guide’s chapters or the skills in one group.</dd><dt>Don’t</dt><dd>A pager on pages with no reading order, or one per section on a page with a section rail.</dd></dl>
|
|
1296
|
+
<div class="row"><h4>Sequence</h4><div class="states">
|
|
1297
|
+
<div class="state wide"><nav class="pager" aria-label="Pages, specimen"><a href="#pager" rel="prev"><span class="pager-dir"><svg class="icon" aria-hidden="true"><use href="#i-arrow-left"/></svg>Previous</span><span class="pager-title">Foundations</span></a><a href="#pager" rel="next"><span class="pager-dir">Next<svg class="icon" aria-hidden="true"><use href="#i-arrow-right"/></svg></span><span class="pager-title">Application example</span></a></nav><span class="caption">Rest, live; previous and next</span></div>
|
|
1298
|
+
<div class="state wide" inert><nav class="pager" aria-label="Pages, pinned"><a href="#pager" rel="next" class="is-hover"><span class="pager-dir">Next<svg class="icon" aria-hidden="true"><use href="#i-arrow-right"/></svg></span><span class="pager-title">Components</span></a></nav><span class="caption">First page: next only, still at the end; hover</span></div>
|
|
1299
|
+
</div></div>
|
|
1300
|
+
</section>
|
|
1301
|
+
|
|
1302
|
+
<section class="component" id="tabs" data-layer="Core" data-states="hover selected focus" aria-labelledby="tabs-title">
|
|
1303
|
+
<header><h3 id="tabs-title">Tabs</h3><span class="badge">Core</span><a href="components.md#tabs">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="tabs" aria-label="Copy link to Tabs" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1304
|
+
<p class="purpose">Switch panels about one object, without leaving the page.</p>
|
|
1305
|
+
<dl class="guidance"><dt>Do</dt><dd>Use tabs for panels about one object, such as a monitor’s Overview and History, when the URL does not change.</dd><dt>Don’t</dt><dd>Links with <code>role="tab"</code>, or one set that mixes pages and panels. Pages take a navigation strip.</dd></dl>
|
|
1306
|
+
<div class="row"><h4>Live</h4><div class="states">
|
|
1307
|
+
<div class="state wide" data-tabs data-label="Monitor">
|
|
1308
|
+
<!-- Without JavaScript every panel shows under its heading; the script builds the tab list. -->
|
|
1309
|
+
<section class="tabpanel" id="panel-overview" aria-labelledby="panel-overview-heading"><h5 class="tabs-heading" id="panel-overview-heading">Overview</h5><p>Arrow keys move between tabs; Home and End jump to the ends.</p></section>
|
|
1310
|
+
<section class="tabpanel" id="panel-history" aria-labelledby="panel-history-heading"><h5 class="tabs-heading" id="panel-history-heading">History</h5><p>Seven days of evaluations.</p></section>
|
|
1311
|
+
<section class="tabpanel" id="panel-settings" aria-labelledby="panel-settings-heading"><h5 class="tabs-heading" id="panel-settings-heading">Settings</h5><p>Threshold and notification settings.</p></section>
|
|
1312
|
+
<span class="caption">Live; Overview is selected</span>
|
|
1313
|
+
</div>
|
|
1314
|
+
</div></div>
|
|
1315
|
+
<div class="row"><h4>Pinned</h4><div class="states">
|
|
1316
|
+
<div class="state" inert><div class="tablist" role="tablist" aria-label="Monitor, hover"><button class="tab" type="button" role="tab" aria-selected="true">Overview</button><button class="tab is-hover" type="button" role="tab" aria-selected="false">History</button></div><span class="caption">Hover on History</span></div>
|
|
1317
|
+
<div class="state" inert><div class="tablist" role="tablist" aria-label="Monitor, focus"><button class="tab is-focus" type="button" role="tab" aria-selected="true">Overview</button><button class="tab" type="button" role="tab" aria-selected="false">History</button></div><span class="caption">Focus visible</span></div>
|
|
1318
|
+
</div></div>
|
|
1319
|
+
</section>
|
|
1320
|
+
|
|
1321
|
+
<section class="component" id="skip-link" data-layer="Core" aria-labelledby="skip-link-title">
|
|
1322
|
+
<header><h3 id="skip-link-title">Skip link</h3><span class="badge">Core</span><a href="components.md#skip-link">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="skip-link" aria-label="Copy link to Skip link" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1323
|
+
<p class="purpose">Jump past the header to the content.</p>
|
|
1324
|
+
<dl class="guidance"><dt>Do</dt><dd>A “Skip to content” link on every page with a header or rail before <code>main</code>; the first Tab shows it.</dd><dt>Don’t</dt><dd>Hiding it with <code>display: none</code>, which also takes it out of the Tab order.</dd></dl>
|
|
1325
|
+
<div class="row"><h4>Focused</h4><div class="states">
|
|
1326
|
+
<div class="state" inert><a class="skip is-focus" href="#main">Skip to content</a><span class="caption">Focus visible; hidden above the page until focused</span></div>
|
|
1327
|
+
</div></div>
|
|
1328
|
+
</section>
|
|
1329
|
+
|
|
1330
|
+
<section class="component" id="keyboard-key" data-layer="Core" aria-labelledby="keyboard-key-title">
|
|
1331
|
+
<header><h3 id="keyboard-key-title">Keyboard key</h3><span class="badge">Core</span><a href="components.md#keyboard-key">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="keyboard-key" aria-label="Copy link to Keyboard key" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1332
|
+
<p class="purpose">Show a key or shortcut in text.</p>
|
|
1333
|
+
<dl class="guidance"><dt>Do</dt><dd>A key or shortcut in running text or shortcut docs, one key per <code><kbd></code>.</dd><dt>Don’t</dt><dd>A key style for code or button names. Code takes <code><code></code>; a button’s name is plain text.</dd></dl>
|
|
1334
|
+
<div class="row"><h4>Keys</h4><div class="states">
|
|
1335
|
+
<div class="state"><p class="note">Press <kbd class="key">/</kbd> to find, <kbd class="key">Esc</kbd> to clear, and <kbd class="key">Enter</kbd> to go to the first match.</p><span class="caption">Rest, in running text</span></div>
|
|
1336
|
+
</div></div>
|
|
1337
|
+
</section>
|
|
1338
|
+
|
|
1339
|
+
<section class="layer-head" id="group-code" aria-labelledby="group-code-title">
|
|
1340
|
+
<h2 id="group-code-title">Code and examples</h2>
|
|
1341
|
+
<p>Show source and live examples.</p>
|
|
1342
|
+
</section>
|
|
1343
|
+
|
|
992
1344
|
<section class="component" id="code-block" data-layer="Core" aria-labelledby="code-title">
|
|
993
|
-
<header><h3 id="code-title">Code block</h3><span class="badge">Core</span><a href="components.md#code-block">Spec</a></header>
|
|
1345
|
+
<header><h3 id="code-title">Code block</h3><span class="badge">Core</span><a href="components.md#code-block">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="code-block" aria-label="Copy link to Code block" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1346
|
+
<p class="purpose">Source code with an optional header and Copy, and a live example above it.</p>
|
|
1347
|
+
<dl class="guidance"><dt>Do</dt><dd>Use a code block for source with no live result. When the reader should see the result too, use the variant with a live example.</dd><dt>Don’t</dt><dd>The same language label on every block of a page. Put useful setup context above the block instead.</dd></dl>
|
|
994
1348
|
<div class="row"><h4>Source well</h4><div class="states">
|
|
995
1349
|
<div class="state wide"><div class="code"><div class="code-head"><b>monitor.ts</b><span class="lang">TypeScript</span><button class="quiet-action copy" type="button" data-copy="code-src"><svg class="icon" aria-hidden="true"><use href="#i-copy"/></svg>Copy</button></div><pre tabindex="0" role="region" aria-label="monitor.ts"><code id="code-src"><span class="line"><span class="ln">1</span><span><span class="k">const</span> threshold = <span class="n">300</span> <span class="c">// ms at p95</span></span></span><span class="line"><span class="ln">2</span><span><span class="k">export const</span> name = <span class="s">'API p95 latency'</span></span></span></code></pre></div><span class="caption">Header, line numbers, and Copy, live</span></div>
|
|
996
1350
|
<div class="state wide" inert><div class="code compact"><pre><code><span class="line"><span>import { threshold } from './monitor'</span></span></code></pre><button class="quiet-action copy is-focus" type="button" aria-label="Copy import"><svg class="icon" aria-hidden="true"><use href="#i-copy"/></svg></button></div><span class="caption">Compact, with focus visible on Copy</span></div>
|
|
@@ -1001,25 +1355,26 @@
|
|
|
1001
1355
|
<p class="sr-only" role="status" id="copy-status"></p>
|
|
1002
1356
|
</section>
|
|
1003
1357
|
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
<
|
|
1007
|
-
<p>The personal sites' own look. A new project replaces these with its own identity and keeps the core.</p>
|
|
1358
|
+
<section class="layer-head" id="group-identity" aria-labelledby="group-identity-title">
|
|
1359
|
+
<h2 id="group-identity-title">Identity: terminal folio</h2>
|
|
1360
|
+
<p>The personal sites’ look. A new project replaces these with its own.</p>
|
|
1008
1361
|
</section>
|
|
1009
1362
|
|
|
1010
|
-
<!-- Command plate -->
|
|
1011
1363
|
<section class="component" id="command-plate" data-layer="Identity" aria-labelledby="cmd-title">
|
|
1012
|
-
<header><h3 id="cmd-title">Command plate</h3><span class="badge">Identity</span><a href="components.md#command-plate">Spec</a></header>
|
|
1364
|
+
<header><h3 id="cmd-title">Command plate</h3><span class="badge">Identity</span><a href="components.md#command-plate">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="command-plate" aria-label="Copy link to Command plate" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1365
|
+
<p class="purpose">A shell command on a hue-tinted plate.</p>
|
|
1366
|
+
<dl class="guidance"><dt>Do</dt><dd>Use it for a shell command the reader runs, one command per line.</dd><dt>Don’t</dt><dd>A <code>$</code> typed into the command. CSS draws the prompt; a typed one is copied with the command.</dd></dl>
|
|
1013
1367
|
<div class="row"><h4>Commands</h4><div class="states">
|
|
1014
1368
|
<div class="state wide"><div class="code command compact"><pre tabindex="0" role="region" aria-label="Install command"><code id="cmd-install"><span class="line"><span>brew install filipgutica/tap/filip-stack</span></span></code></pre><button class="quiet-action copy" type="button" data-copy="cmd-install" aria-label="Copy install command"><svg class="icon" aria-hidden="true"><use href="#i-copy"/></svg></button></div><span class="caption">Compact, live; the <code>$</code> is drawn by CSS</span></div>
|
|
1015
1369
|
<div class="state wide"><div class="code command"><div class="code-head"><b>Set up</b><button class="quiet-action copy" type="button" data-copy="cmd-setup"><svg class="icon" aria-hidden="true"><use href="#i-copy"/></svg>Copy</button></div><pre tabindex="0" role="region" aria-label="Set up commands"><code id="cmd-setup"><span class="line"><span>pnpm install --frozen-lockfile</span></span><span class="line"><span>pnpm check</span></span></code></pre></div><span class="caption">With a header, two lines</span></div>
|
|
1016
|
-
<div class="state wide" inert><div class="code command compact"><pre><code><span class="line"><span>filip-stack apply</span></span></code></pre><button class="quiet-action copy is-focus" type="button" aria-label="Copy apply command"><svg class="icon" aria-hidden="true"><use href="#i-copy"/></svg></button></div><span class="caption">Focus visible on Copy, in <code>--project-dark</code></span></div>
|
|
1370
|
+
<div class="state wide" inert><div class="code command compact"><pre><code><span class="line"><span>filip-stack apply</span></span></code></pre><button class="quiet-action copy is-focus" type="button" aria-label="Copy apply command"><svg class="icon" aria-hidden="true"><use href="#i-copy"/></svg></button></div><span class="caption">Focus visible on Copy, in <code>--color-project-dark</code></span></div>
|
|
1017
1371
|
</div></div>
|
|
1018
1372
|
</section>
|
|
1019
1373
|
|
|
1020
|
-
<!-- Terminal capture -->
|
|
1021
1374
|
<section class="component" id="terminal-capture" data-layer="Identity" aria-labelledby="capture-title">
|
|
1022
|
-
<header><h3 id="capture-title">Terminal capture</h3><span class="badge">Identity</span><a href="components.md#terminal-capture">Spec</a></header>
|
|
1375
|
+
<header><h3 id="capture-title">Terminal capture</h3><span class="badge">Identity</span><a href="components.md#terminal-capture">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="terminal-capture" aria-label="Copy link to Terminal capture" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1376
|
+
<p class="purpose">A recorded terminal screen with a status line.</p>
|
|
1377
|
+
<dl class="guidance"><dt>Do</dt><dd>Use it to show what a command prints, one tab per capture, with the path and branch in the status line.</dd><dt>Don’t</dt><dd>A capture for a screenshot of a graphical app. Use a figure.</dd></dl>
|
|
1023
1378
|
<div class="capture" data-tabs data-label="Captures">
|
|
1024
1379
|
<!-- The script adds the tab list and the Full size button; without it every capture is listed. -->
|
|
1025
1380
|
<div class="capture-head" hidden><button class="quiet-action full" type="button" data-full-size><svg class="icon" aria-hidden="true"><use href="#i-expand"/></svg>Full size</button></div>
|
|
@@ -1029,48 +1384,74 @@
|
|
|
1029
1384
|
</div>
|
|
1030
1385
|
</section>
|
|
1031
1386
|
|
|
1032
|
-
<!-- Site header -->
|
|
1033
1387
|
<section class="component" id="site-header" data-layer="Identity" aria-labelledby="header-title">
|
|
1034
|
-
<header><h3 id="header-title">Site header</h3><span class="badge">Identity</span><a href="components.md#site-header">Spec</a></header>
|
|
1388
|
+
<header><h3 id="header-title">Site header</h3><span class="badge">Identity</span><a href="components.md#site-header">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="site-header" aria-label="Copy link to Site header" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1389
|
+
<p class="purpose">The ~/name header with project switcher and appearance.</p>
|
|
1390
|
+
<dl class="guidance"><dt>Do</dt><dd>Keep the same header and site links, six at most and in one order, on every page of a personal product site.</dd><dt>Don’t</dt><dd>The site header on an application screen. An application keeps its own navigation.</dd></dl>
|
|
1035
1391
|
<div class="row"><h4>Closed</h4><div class="states">
|
|
1036
1392
|
<div class="state wide"><div class="site-header">
|
|
1037
|
-
<details class="projects"><summary class="quiet-action" aria-label="Project: filip-stack"><span>filip-stack</span><svg class="icon" aria-hidden="true"><use href="#i-chevron-down"/></svg></summary><nav class="navlist" aria-label="Projects"><a href="#site-header">annoterm</a><a href="
|
|
1038
|
-
<div class="site-end"><nav class="site-links" aria-label="Site links"><a href="
|
|
1393
|
+
<details class="projects"><summary class="quiet-action" aria-label="Project: filip-stack"><span>filip-stack</span><svg class="icon" aria-hidden="true"><use href="#i-chevron-down"/></svg></summary><nav class="navlist" aria-label="Projects"><a href="#site-header">annoterm</a><a href="components.html" aria-current="page">filip-stack</a><a href="#site-header">ui</a></nav></details>
|
|
1394
|
+
<div class="site-end"><nav class="navlist strip site-links" aria-label="Site links"><a href="components.html" aria-current="page">Docs</a><a href="#site-header">GitHub</a></nav>
|
|
1039
1395
|
<div class="segmented" role="group" aria-label="Color theme, sample" data-size="lg" data-icon-only><button type="button" aria-pressed="true" aria-label="System" title="System"><svg class="icon" aria-hidden="true" viewBox="0 0 16 16"><rect x="2" y="2.5" width="12" height="8.5" rx="1.5"/><path d="M5.5 14h5M8 11v3"/></svg></button><button type="button" aria-pressed="false" aria-label="Light" title="Light"><svg class="icon" aria-hidden="true" viewBox="0 0 16 16"><circle cx="8" cy="8" r="3"/><path d="M8 1.5v1.5M8 13v1.5M1.5 8H3M13 8h1.5M3.4 3.4l1 1M11.6 11.6l1 1M3.4 12.6l1-1M11.6 4.4l1-1"/></svg></button><button type="button" aria-pressed="false" aria-label="Dark" title="Dark"><svg class="icon" aria-hidden="true" viewBox="0 0 16 16"><path d="M13 9.5A5.5 5.5 0 0 1 6.5 3a5.5 5.5 0 1 0 6.5 6.5z"/></svg></button></div>
|
|
1040
1396
|
</div>
|
|
1041
|
-
</div><span class="caption">Live: the project switcher opens; the picker is a sample</span></div>
|
|
1397
|
+
</div><span class="caption">Live: the project switcher opens, and Docs is the current page; the picker is a sample</span></div>
|
|
1042
1398
|
</div></div>
|
|
1043
1399
|
<div class="row"><h4>Open menu</h4><div class="states">
|
|
1044
|
-
<div class="state" inert><details class="projects is-open" open><summary class="quiet-action" aria-label="Project: filip-stack, open"><span>filip-stack</span><svg class="icon" aria-hidden="true"><use href="#i-chevron-down"/></svg></summary><nav class="navlist" aria-label="Projects, pinned"><a href="#site-header" class="is-hover">annoterm</a><a href="
|
|
1400
|
+
<div class="state" inert><details class="projects is-open" open><summary class="quiet-action" aria-label="Project: filip-stack, open"><span>filip-stack</span><svg class="icon" aria-hidden="true"><use href="#i-chevron-down"/></svg></summary><nav class="navlist" aria-label="Projects, pinned"><a href="#site-header" class="is-hover">annoterm</a><a href="components.html" aria-current="page">filip-stack</a><a href="#site-header">ui</a></nav></details><span class="caption">Menu open, hover on annoterm</span></div>
|
|
1045
1401
|
</div></div>
|
|
1046
1402
|
</section>
|
|
1047
1403
|
|
|
1048
|
-
<!-- Page type and helpers -->
|
|
1049
1404
|
<section class="component" id="page-type-and-helpers" data-layer="Identity" aria-labelledby="page-type-title">
|
|
1050
|
-
<header><h3 id="page-type-title">Page type and helpers</h3><span class="badge">Identity</span><a href="components.md#page-type-and-helpers">Spec</a></header>
|
|
1405
|
+
<header><h3 id="page-type-title">Page type and helpers</h3><span class="badge">Identity</span><a href="components.md#page-type-and-helpers">Spec</a><button class="quiet-action copy-link" type="button" data-copy-link="page-type-and-helpers" aria-label="Copy link to Page type and helpers" title="Copy link"><svg class="icon" aria-hidden="true"><use href="#i-link"/></svg></button></header>
|
|
1406
|
+
<p class="purpose">Mono headings, steps, definitions, facts, and the footer.</p>
|
|
1407
|
+
<dl class="guidance"><dt>Do</dt><dd>Use steps for a sequence the reader follows in order, definitions for terms with short meanings, and facts for short labels and values.</dd><dt>Don’t</dt><dd>The <code>##</code> mark on an application screen, or on h3 and lower.</dd></dl>
|
|
1051
1408
|
<div class="row"><h4>Headings</h4><div class="states">
|
|
1052
1409
|
<div class="state wide"><p class="folio-display">~/annoterm</p><span class="caption">Display title, mono</span></div>
|
|
1053
1410
|
<div class="state wide"><p class="folio-h2">Install</p><span class="caption">Section heading with its <code>##</code> mark</span></div>
|
|
1054
1411
|
</div></div>
|
|
1055
1412
|
<div class="row"><h4>Steps</h4><div class="states">
|
|
1056
|
-
<div class="state wide"><ol class="steps"><li><h4>Install the CLI</h4><p>Homebrew installs the launcher.</p></li><li><h4>Apply host config</h4><p>It copies the guidance and the design language.</p></li></ol></div>
|
|
1413
|
+
<div class="state wide"><ol class="steps"><li><h4>Install the CLI</h4><p>Homebrew installs the launcher.</p></li><li><h4>Apply host config</h4><p>It copies the guidance and the design language.</p></li></ol><span class="caption">Rest: two steps</span></div>
|
|
1057
1414
|
</div></div>
|
|
1058
1415
|
<div class="row"><h4>Facts</h4><div class="states">
|
|
1059
|
-
<div class="state wide"><dl class="facts"><div><dt>Installed to</dt><dd>~/design-language</dd></div><div><dt>Source</dt><dd>host-config/design-language</dd></div></dl></div>
|
|
1416
|
+
<div class="state wide"><dl class="facts"><div><dt>Installed to</dt><dd>~/design-language</dd></div><div><dt>Source</dt><dd>host-config/design-language</dd></div></dl><span class="caption">Rest: two facts</span></div>
|
|
1060
1417
|
</div></div>
|
|
1061
1418
|
<div class="row"><h4>Definitions</h4><div class="states">
|
|
1062
|
-
<div class="state wide"><dl class="definitions"><dt><code>--all</code></dt><dd>Apply every target, including skipped ones.</dd><dt><code>--home</code></dt><dd>Install into another home directory.</dd></dl></div>
|
|
1063
|
-
</div></div>
|
|
1064
|
-
<div class="row"><h4>Skip link</h4><div class="states">
|
|
1065
|
-
<div class="state" inert><a class="skip is-focus" href="#title">Skip to content</a><span class="caption">Focus visible; hidden until focused</span></div>
|
|
1419
|
+
<div class="state wide"><dl class="definitions"><dt><code>--all</code></dt><dd>Apply every target, including skipped ones.</dd><dt><code>--home</code></dt><dd>Install into another home directory.</dd></dl><span class="caption">Rest: two terms</span></div>
|
|
1066
1420
|
</div></div>
|
|
1067
1421
|
<div class="row"><h4>Command list</h4><div class="states">
|
|
1068
|
-
<div class="state wide"><table class="cmdlist"><thead><tr><th scope="col">Command</th><th scope="col">Use it for</th><td></td></tr></thead><tbody><tr><td><code id="cl-status">filip-stack status</code></td><td>Compare host files with the repository.</td><td><button class="quiet-action copy" type="button" data-copy="cl-status" aria-label="Copy filip-stack status"><svg class="icon" aria-hidden="true"><use href="#i-copy"/></svg></button></td></tr><tr><td><code id="cl-apply">filip-stack apply</code></td><td>Install the current host config.</td><td><button class="quiet-action copy" type="button" data-copy="cl-apply" aria-label="Copy filip-stack apply"><svg class="icon" aria-hidden="true"><use href="#i-copy"/></svg></button></td></tr></tbody></table></div>
|
|
1422
|
+
<div class="state wide"><table class="cmdlist"><thead><tr><th scope="col">Command</th><th scope="col">Use it for</th><td></td></tr></thead><tbody><tr><td><code id="cl-status">filip-stack status</code></td><td>Compare host files with the repository.</td><td><button class="quiet-action copy" type="button" data-copy="cl-status" aria-label="Copy filip-stack status"><svg class="icon" aria-hidden="true"><use href="#i-copy"/></svg></button></td></tr><tr><td><code id="cl-apply">filip-stack apply</code></td><td>Install the current host config.</td><td><button class="quiet-action copy" type="button" data-copy="cl-apply" aria-label="Copy filip-stack apply"><svg class="icon" aria-hidden="true"><use href="#i-copy"/></svg></button></td></tr></tbody></table><span class="caption">Rest: two commands</span></div>
|
|
1069
1423
|
</div></div>
|
|
1070
1424
|
<div class="row"><h4>Footer</h4><div class="states">
|
|
1071
|
-
<div class="state wide"><div class="site-footer"><a href="#page-type-and-helpers">Made by Filip</a><nav aria-label="Projects, footer"><a href="#page-type-and-helpers">annoterm</a><a href="#page-type-and-helpers">ui</a></nav></div></div>
|
|
1425
|
+
<div class="state wide"><div class="site-footer"><a href="#page-type-and-helpers">Made by Filip</a><nav aria-label="Projects, footer"><a href="#page-type-and-helpers">annoterm</a><a href="#page-type-and-helpers">ui</a></nav></div><span class="caption">Rest</span></div>
|
|
1072
1426
|
</div></div>
|
|
1073
1427
|
</section>
|
|
1428
|
+
|
|
1429
|
+
<section class="layer-head" id="state-coverage" aria-labelledby="coverage-title">
|
|
1430
|
+
<h2 id="coverage-title">Control states</h2>
|
|
1431
|
+
<p>The interactive states each control’s spec defines. Selected covers checked, on, and current. Components with no interactive states are left out.</p>
|
|
1432
|
+
</section>
|
|
1433
|
+
<div class="coverage-wrap" tabindex="0" role="region" aria-label="Control states table">
|
|
1434
|
+
<table class="coverage">
|
|
1435
|
+
<thead><tr><th scope="col">Component</th><th scope="col">Hover</th><th scope="col">Pressed</th><th scope="col">Selected</th><th scope="col">Focus</th><th scope="col">Disabled</th><th scope="col">Busy</th><th scope="col">Invalid</th></tr></thead>
|
|
1436
|
+
<tbody>
|
|
1437
|
+
<tr data-for="button"><th scope="row"><a href="#button">Button</a></th><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td></tr>
|
|
1438
|
+
<tr data-for="quiet-action"><th scope="row"><a href="#quiet-action">Quiet action</a></th><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td></tr>
|
|
1439
|
+
<tr data-for="checkbox-and-radio"><th scope="row"><a href="#checkbox-and-radio">Checkbox and radio</a></th><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td></tr>
|
|
1440
|
+
<tr data-for="radio-card-group"><th scope="row"><a href="#radio-card-group">Radio card group</a></th><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td></tr>
|
|
1441
|
+
<tr data-for="switch"><th scope="row"><a href="#switch">Switch</a></th><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td></tr>
|
|
1442
|
+
<tr data-for="toggle-button"><th scope="row"><a href="#toggle-button">Toggle button</a></th><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td></tr>
|
|
1443
|
+
<tr data-for="segmented-control"><th scope="row"><a href="#segmented-control">Segmented control</a></th><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td></tr>
|
|
1444
|
+
<tr data-for="text-input-and-textarea"><th scope="row"><a href="#text-input-and-textarea">Text input and textarea</a></th><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td></tr>
|
|
1445
|
+
<tr data-for="select"><th scope="row"><a href="#select">Select</a></th><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td></tr>
|
|
1446
|
+
<tr data-for="field-wrapper"><th scope="row"><a href="#field-wrapper">Field wrapper</a></th><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td></tr>
|
|
1447
|
+
<tr data-for="slider"><th scope="row"><a href="#slider">Slider</a></th><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td></tr>
|
|
1448
|
+
<tr data-for="navigation-list"><th scope="row"><a href="#navigation-list">Navigation list</a></th><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td></tr>
|
|
1449
|
+
<tr data-for="tabs"><th scope="row"><a href="#tabs">Tabs</a></th><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span aria-hidden="true">●</span><span class="sr-only">Yes</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td><td><span class="none" aria-hidden="true">–</span><span class="sr-only">No</span></td></tr>
|
|
1450
|
+
</tbody>
|
|
1451
|
+
</table>
|
|
1452
|
+
</div>
|
|
1453
|
+
|
|
1454
|
+
<nav class="pager" aria-label="Design system pages"><a href="reference.html#foundations" rel="prev"><span class="pager-dir"><svg class="icon" aria-hidden="true"><use href="#i-arrow-left"/></svg>Previous</span><span class="pager-title">Foundations</span></a><a href="reference.html" rel="next"><span class="pager-dir">Next<svg class="icon" aria-hidden="true"><use href="#i-arrow-right"/></svg></span><span class="pager-title">Application example</span></a></nav>
|
|
1074
1455
|
</main>
|
|
1075
1456
|
</div>
|
|
1076
1457
|
</div>
|
|
@@ -1086,7 +1467,11 @@
|
|
|
1086
1467
|
</dialog>
|
|
1087
1468
|
<dialog class="drawer" id="live-drawer" aria-labelledby="live-drawer-title">
|
|
1088
1469
|
<div class="drawer-head"><h4 id="live-drawer-title">Contents</h4><form method="dialog"><button class="quiet-action close" type="submit" aria-label="Close drawer"><svg class="icon" aria-hidden="true"><use href="#i-close"/></svg></button></form></div>
|
|
1089
|
-
<div class="drawer-body"><nav class="navlist" aria-label="Contents"><a href="#button">Button</a><a href="#segmented-control">Segmented control</a><a href="#navigation-list" aria-current="
|
|
1470
|
+
<div class="drawer-body"><nav class="navlist" aria-label="Contents"><a href="#button">Button</a><a href="#segmented-control">Segmented control</a><a href="#navigation-list" aria-current="location">Navigation list</a></nav></div>
|
|
1471
|
+
</dialog>
|
|
1472
|
+
<dialog class="drawer" id="nav-drawer" aria-labelledby="nav-drawer-title">
|
|
1473
|
+
<div class="drawer-head"><h4 id="nav-drawer-title">Menu</h4><form method="dialog"><button class="quiet-action close" type="submit" aria-label="Close menu"><svg class="icon" aria-hidden="true"><use href="#i-close"/></svg></button></form></div>
|
|
1474
|
+
<div class="drawer-body" id="nav-drawer-body"></div>
|
|
1090
1475
|
</dialog>
|
|
1091
1476
|
|
|
1092
1477
|
<script>
|
|
@@ -1132,8 +1517,10 @@
|
|
|
1132
1517
|
return press;
|
|
1133
1518
|
};
|
|
1134
1519
|
|
|
1135
|
-
//
|
|
1136
|
-
|
|
1520
|
+
// Appearance: System removes the attribute so prefers-color-scheme decides. The control needs the
|
|
1521
|
+
// script, so it shows only once the script runs.
|
|
1522
|
+
const themeGroup = document.querySelector('[aria-label="Appearance"]');
|
|
1523
|
+
themeGroup.hidden = false;
|
|
1137
1524
|
const pressTheme = segmented(themeGroup, (b) => {
|
|
1138
1525
|
const choice = b.dataset.themeChoice;
|
|
1139
1526
|
if (choice === 'system') root.removeAttribute('data-theme'); else root.setAttribute('data-theme', choice);
|
|
@@ -1149,7 +1536,23 @@
|
|
|
1149
1536
|
document.querySelectorAll('[data-live-toggle]').forEach((t) => t.addEventListener('click', () => t.setAttribute('aria-pressed', String(t.getAttribute('aria-pressed') !== 'true'))));
|
|
1150
1537
|
|
|
1151
1538
|
// Slider fill follows the value.
|
|
1152
|
-
|
|
1539
|
+
// A live slider moves its range fill and its visible value together, from the keyboard or the pointer.
|
|
1540
|
+
document.querySelectorAll('[data-live-range]').forEach((r) => r.addEventListener('input', () => {
|
|
1541
|
+
r.style.setProperty('--value', `${r.value}%`);
|
|
1542
|
+
const value = document.querySelector(`output[for="${r.id}"]`);
|
|
1543
|
+
if (value) value.value = `${r.value}%`;
|
|
1544
|
+
}));
|
|
1545
|
+
|
|
1546
|
+
// A list that scrolls sideways names its clipped ends in data-clip, so CSS fades only those edges.
|
|
1547
|
+
const trackClip = (list) => {
|
|
1548
|
+
const clip = () => {
|
|
1549
|
+
const hidden = list.scrollWidth - list.clientWidth;
|
|
1550
|
+
const ends = [list.scrollLeft > 1 && 'start', list.scrollLeft < hidden - 1 && 'end'].filter(Boolean).join(' ');
|
|
1551
|
+
if (ends) list.dataset.clip = ends; else delete list.dataset.clip;
|
|
1552
|
+
};
|
|
1553
|
+
list.addEventListener('scroll', clip, { passive: true });
|
|
1554
|
+
new ResizeObserver(clip).observe(list);
|
|
1555
|
+
};
|
|
1153
1556
|
|
|
1154
1557
|
// Tabs: progressive enhancement. Each panel starts visible under its heading; the script builds
|
|
1155
1558
|
// the tab list from the headings, applies tab roles, and hides the headings and other panels.
|
|
@@ -1177,20 +1580,44 @@
|
|
|
1177
1580
|
});
|
|
1178
1581
|
const head = box.querySelector('.capture-head');
|
|
1179
1582
|
if (head) { head.prepend(list); head.hidden = false; } else box.prepend(list);
|
|
1180
|
-
|
|
1181
|
-
const hidden = list.scrollWidth - list.clientWidth;
|
|
1182
|
-
const ends = [list.scrollLeft > 1 && 'start', list.scrollLeft < hidden - 1 && 'end'].filter(Boolean).join(' ');
|
|
1183
|
-
if (ends) list.dataset.clip = ends; else delete list.dataset.clip;
|
|
1184
|
-
};
|
|
1185
|
-
list.addEventListener('scroll', clip, { passive: true });
|
|
1186
|
-
new ResizeObserver(clip).observe(list);
|
|
1583
|
+
trackClip(list);
|
|
1187
1584
|
box.dataset.enhanced = 'true';
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1585
|
+
// A change of tab glides the fill as the segmented thumb does: the new fill starts at the old fill's
|
|
1586
|
+
// edges, read before the selection changes, and CSS animates each edge home. Edges are kept in the
|
|
1587
|
+
// list's scroll space, because a key press can scroll the list. The first selection does not glide.
|
|
1588
|
+
let glide = 0;
|
|
1589
|
+
const x = (px) => px - list.getBoundingClientRect().left + list.scrollLeft;
|
|
1590
|
+
const clearGlide = () => { delete list.dataset.slide; list.style.removeProperty('--slide-left'); list.style.removeProperty('--slide-right'); };
|
|
1591
|
+
const select = (tab) => {
|
|
1592
|
+
const from = tabs.find((t) => t.getAttribute('aria-selected') === 'true');
|
|
1593
|
+
let edges;
|
|
1594
|
+
if (from && from !== tab && !reduced.matches) {
|
|
1595
|
+
// An interrupted glide starts from where its fill is now.
|
|
1596
|
+
const fill = getComputedStyle(from, '::before');
|
|
1597
|
+
const a = from.getBoundingClientRect();
|
|
1598
|
+
edges = [x(a.left + parseFloat(fill.left)), x(a.right - parseFloat(fill.right))];
|
|
1599
|
+
}
|
|
1600
|
+
tabs.forEach((t) => {
|
|
1601
|
+
const on = t === tab;
|
|
1602
|
+
t.setAttribute('aria-selected', String(on));
|
|
1603
|
+
t.tabIndex = on ? 0 : -1;
|
|
1604
|
+
document.getElementById(t.getAttribute('aria-controls')).hidden = !on;
|
|
1605
|
+
});
|
|
1606
|
+
if (!edges) return;
|
|
1607
|
+
clearGlide();
|
|
1608
|
+
const b = tab.getBoundingClientRect();
|
|
1609
|
+
const [left, right] = edges;
|
|
1610
|
+
list.style.setProperty('--slide-left', `${left - x(b.left)}px`);
|
|
1611
|
+
list.style.setProperty('--slide-right', `${x(b.right) - right}px`);
|
|
1612
|
+
const direction = x(b.left) + x(b.right) > left + right ? 'right' : 'left';
|
|
1613
|
+
list.dataset.slide = direction;
|
|
1614
|
+
const id = ++glide;
|
|
1615
|
+
const end = () => { if (id === glide) clearGlide(); };
|
|
1616
|
+
requestAnimationFrame(() => {
|
|
1617
|
+
const trailing = list.getAnimations({ subtree: true }).find((a) => a.animationName === (direction === 'right' ? 'glide-left' : 'glide-right'));
|
|
1618
|
+
if (trailing) trailing.finished.then(end, end); else end();
|
|
1619
|
+
});
|
|
1620
|
+
};
|
|
1194
1621
|
select(tabs[0]);
|
|
1195
1622
|
tabs.forEach((t, i) => {
|
|
1196
1623
|
t.addEventListener('click', () => select(t));
|
|
@@ -1272,12 +1699,235 @@
|
|
|
1272
1699
|
menu.addEventListener('focusout', (e) => { if (!menu.contains(e.relatedTarget)) menu.open = false; });
|
|
1273
1700
|
});
|
|
1274
1701
|
|
|
1275
|
-
//
|
|
1276
|
-
|
|
1277
|
-
const
|
|
1278
|
-
|
|
1702
|
+
// ---------- Catalogue shell: header strip, rail, Find, shortcuts, location, phone drawer ----------
|
|
1703
|
+
// Header strip: start scrolled to the current page, and fade only the edges that hide links.
|
|
1704
|
+
const strip = document.querySelector('.page-head .navlist.strip');
|
|
1705
|
+
const here = strip.querySelector('[aria-current="page"]');
|
|
1706
|
+
if (here && strip.scrollWidth > strip.clientWidth) strip.scrollLeft = here.offsetLeft - (strip.clientWidth - here.offsetWidth) / 2;
|
|
1707
|
+
trackClip(strip);
|
|
1708
|
+
|
|
1709
|
+
// Each skip link moves focus to its target (main, or the rail's list), which takes tabindex="-1" only then.
|
|
1710
|
+
const main = document.getElementById('main');
|
|
1711
|
+
document.querySelectorAll('body > a.skip').forEach((skip) => skip.addEventListener('click', () => {
|
|
1712
|
+
const target = document.getElementById(skip.hash.slice(1));
|
|
1713
|
+
target.tabIndex = -1;
|
|
1714
|
+
target.focus({ preventScroll: true });
|
|
1715
|
+
}));
|
|
1716
|
+
|
|
1717
|
+
const rail = document.getElementById('rail');
|
|
1718
|
+
const railHome = rail.parentElement;
|
|
1719
|
+
const list = rail.querySelector('.rail-list');
|
|
1720
|
+
const links = [...list.querySelectorAll('a[href^="#"]')];
|
|
1721
|
+
const railGroups = [...list.querySelectorAll('.navlist')];
|
|
1722
|
+
const find = document.getElementById('find');
|
|
1723
|
+
const findCount = document.getElementById('find-count');
|
|
1724
|
+
const empty = document.getElementById('find-empty');
|
|
1725
|
+
const bar = document.getElementById('section-bar');
|
|
1726
|
+
const drawer = document.getElementById('nav-drawer');
|
|
1727
|
+
const drawerBody = document.getElementById('nav-drawer-body');
|
|
1728
|
+
const tablet = matchMedia('(max-width: 800px)');
|
|
1729
|
+
// Find and the shortcut switch need the script, so they show only once it runs.
|
|
1730
|
+
rail.querySelector('.rail-find').hidden = false;
|
|
1731
|
+
rail.querySelector('.rail-foot').hidden = false;
|
|
1732
|
+
|
|
1733
|
+
// Scrolls a list so a row sits at its centre. It sets the list's own scrollTop, so the page never moves.
|
|
1734
|
+
const centre = (box, row) => {
|
|
1735
|
+
const a = box.getBoundingClientRect();
|
|
1736
|
+
const b = row.getBoundingClientRect();
|
|
1737
|
+
box.scrollTop += b.top - a.top - a.height / 2 + b.height / 2;
|
|
1738
|
+
};
|
|
1739
|
+
|
|
1740
|
+
// Find filters the rail only, never the page, so deep links and the page order stay stable. Every word
|
|
1741
|
+
// must appear in a row's terms. The count is announced after a pause.
|
|
1742
|
+
// A page that also filters its own content, such as a table of tokens, sets window.findScope before
|
|
1743
|
+
// the reader types: { filter(words) → { count, one, many }, keeps(link) → boolean }. Find then calls
|
|
1744
|
+
// filter on each change, keeps the rail links keeps() names, and announces the page's count and noun.
|
|
1745
|
+
let announce;
|
|
1746
|
+
const filter = () => {
|
|
1747
|
+
const query = find.value.trim().toLowerCase();
|
|
1748
|
+
const words = query.split(/\s+/).filter(Boolean);
|
|
1749
|
+
const scope = window.findScope;
|
|
1750
|
+
const result = scope?.filter(words);
|
|
1751
|
+
let shown = 0;
|
|
1752
|
+
links.forEach((a) => {
|
|
1753
|
+
const match = scope ? scope.keeps(a) : words.every((w) => a.dataset.terms.includes(w));
|
|
1754
|
+
a.hidden = !match;
|
|
1755
|
+
if (match) shown += 1;
|
|
1756
|
+
});
|
|
1757
|
+
railGroups.forEach((g) => { g.hidden = !g.querySelector('a:not([hidden])'); });
|
|
1758
|
+
empty.hidden = shown > 0;
|
|
1759
|
+
empty.querySelector('q').textContent = find.value.trim();
|
|
1760
|
+
const { count, one, many } = result ?? { count: shown, one: 'match', many: 'matches' };
|
|
1761
|
+
clearTimeout(announce);
|
|
1762
|
+
announce = setTimeout(() => {
|
|
1763
|
+
findCount.textContent = query ? (count ? `${count} ${count === 1 ? one : many}` : `No ${many}`) : '';
|
|
1764
|
+
}, 500);
|
|
1765
|
+
};
|
|
1766
|
+
// Goes to a row's destination and focuses it. In the drawer the click closes it, and the drawer moves focus.
|
|
1767
|
+
const go = (link) => {
|
|
1768
|
+
link.click();
|
|
1769
|
+
if (drawer.open) return;
|
|
1770
|
+
const target = document.getElementById(link.hash.slice(1));
|
|
1771
|
+
if (!target.hasAttribute('tabindex')) target.tabIndex = -1;
|
|
1772
|
+
target.focus({ preventScroll: true });
|
|
1773
|
+
};
|
|
1774
|
+
find.addEventListener('input', filter);
|
|
1775
|
+
find.addEventListener('keydown', (e) => {
|
|
1776
|
+
const first = links.find((a) => !a.hidden);
|
|
1777
|
+
if (e.key === 'Escape') {
|
|
1778
|
+
// The first Escape clears the query; the next one leaves the field, or closes the drawer.
|
|
1779
|
+
if (find.value) { e.preventDefault(); find.value = ''; filter(); } else if (!drawer.open) find.blur();
|
|
1780
|
+
} else if (e.key === 'Enter' && first) { e.preventDefault(); go(first); }
|
|
1781
|
+
else if (e.key === 'ArrowDown' && first) { e.preventDefault(); first.focus(); }
|
|
1782
|
+
});
|
|
1783
|
+
document.getElementById('find-clear').addEventListener('click', () => { find.value = ''; filter(); find.focus(); });
|
|
1784
|
+
|
|
1785
|
+
// Single-key shortcut: / focuses Find. WCAG 2.1.4 needs a way to turn it off, so a saved switch does.
|
|
1786
|
+
const shortcutSwitch = document.getElementById('shortcut-switch');
|
|
1787
|
+
const hint = rail.querySelector('.find > .key');
|
|
1788
|
+
let shortcuts = true;
|
|
1789
|
+
try { shortcuts = localStorage.getItem('dl-shortcuts') !== 'off'; } catch (e) { /* Storage is blocked: keep the default. */ }
|
|
1790
|
+
const applyShortcuts = () => {
|
|
1791
|
+
shortcutSwitch.setAttribute('aria-checked', String(shortcuts));
|
|
1792
|
+
hint.hidden = !shortcuts;
|
|
1793
|
+
if (shortcuts) find.setAttribute('aria-keyshortcuts', '/'); else find.removeAttribute('aria-keyshortcuts');
|
|
1794
|
+
};
|
|
1795
|
+
shortcutSwitch.addEventListener('click', () => {
|
|
1796
|
+
shortcuts = !shortcuts;
|
|
1797
|
+
try { localStorage.setItem('dl-shortcuts', shortcuts ? 'on' : 'off'); } catch (e) { /* Storage is blocked: the choice lasts for this page only. */ }
|
|
1798
|
+
applyShortcuts();
|
|
1799
|
+
});
|
|
1800
|
+
applyShortcuts();
|
|
1801
|
+
const editable = (el) => el instanceof Element && el.closest('input, textarea, select, [contenteditable]:not([contenteditable="false"])');
|
|
1802
|
+
|
|
1803
|
+
// A tap opens the drawer with focus on its body, so no ring shows and no keyboard opens. A keyboard
|
|
1804
|
+
// open moves focus to the current row, where the ring shows the reader's place. Find focuses the field.
|
|
1805
|
+
drawerBody.tabIndex = -1;
|
|
1806
|
+
const openDrawer = ({ toFind = false, byPointer = false } = {}) => {
|
|
1807
|
+
if (!drawer.open) drawer.showModal();
|
|
1808
|
+
const current = rail.querySelector('[aria-current="location"]:not([hidden])');
|
|
1809
|
+
if (current) centre(drawerBody, current);
|
|
1810
|
+
if (toFind || !current) find.focus({ preventScroll: true });
|
|
1811
|
+
else if (byPointer) drawerBody.focus({ preventScroll: true });
|
|
1812
|
+
else current.focus({ preventScroll: true });
|
|
1813
|
+
};
|
|
1814
|
+
document.addEventListener('keydown', (e) => {
|
|
1815
|
+
if (!shortcuts || e.key !== '/' || e.metaKey || e.ctrlKey || e.altKey || e.defaultPrevented || editable(e.target)) return;
|
|
1816
|
+
if (document.querySelector('dialog[open]:not(#nav-drawer)')) return;
|
|
1817
|
+
e.preventDefault();
|
|
1818
|
+
if (tablet.matches) openDrawer({ toFind: true }); else find.focus();
|
|
1819
|
+
find.select();
|
|
1820
|
+
});
|
|
1821
|
+
|
|
1822
|
+
// Location: the last tracked section, in page order, whose top has passed the scroll-padding inset; at
|
|
1823
|
+
// the bottom of the page, the last one. After a jump the target stays current until the reader scrolls
|
|
1824
|
+
// away from where it landed. A group heading counts as its group's first row.
|
|
1825
|
+
const tracked = links.map((a) => ({ el: document.getElementById(a.hash.slice(1)), a }))
|
|
1826
|
+
.concat([...main.querySelectorAll(':scope > .layer-head[id^="group-"]')].map((el) => ({ el, a: document.getElementById(`rail-${el.id.slice(6)}`)?.parentElement.querySelector('a') })))
|
|
1827
|
+
.filter((t) => t.el && t.a)
|
|
1828
|
+
.sort((x, y) => (x.el.compareDocumentPosition(y.el) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1));
|
|
1829
|
+
const insetOf = () => Number.parseFloat(getComputedStyle(root).scrollPaddingTop) || 0;
|
|
1830
|
+
let jump;
|
|
1831
|
+
let frame;
|
|
1832
|
+
// The rail scrolls its own list to keep the current row in view, and leaves it alone while the reader is in it.
|
|
1833
|
+
const keepInView = (a) => {
|
|
1834
|
+
if (!a || a.hidden || rail.parentElement !== railHome || rail.contains(document.activeElement) || rail.matches(':hover')) return;
|
|
1835
|
+
const box = list.getBoundingClientRect();
|
|
1836
|
+
const row = a.getBoundingClientRect();
|
|
1837
|
+
if (row.top < box.top || row.bottom > box.bottom) centre(list, a);
|
|
1838
|
+
};
|
|
1839
|
+
const mark = (current) => {
|
|
1840
|
+
links.forEach((a) => { if (a === current) a.setAttribute('aria-current', 'location'); else a.removeAttribute('aria-current'); });
|
|
1841
|
+
keepInView(current);
|
|
1842
|
+
};
|
|
1843
|
+
const update = () => {
|
|
1844
|
+
frame = undefined;
|
|
1845
|
+
if (jump) {
|
|
1846
|
+
const distance = Math.abs(scrollY - jump.landing);
|
|
1847
|
+
if (distance > jump.closest + 2) jump = undefined; else jump.closest = Math.min(jump.closest, distance);
|
|
1848
|
+
}
|
|
1849
|
+
const inset = insetOf();
|
|
1850
|
+
let current = tracked[0];
|
|
1851
|
+
for (const t of tracked) if (t.el.getBoundingClientRect().top <= inset + 1) current = t;
|
|
1852
|
+
if (scrollY > 0 && scrollY + innerHeight >= root.scrollHeight - 2) current = tracked.at(-1);
|
|
1853
|
+
mark((jump?.target ?? current)?.a);
|
|
1854
|
+
};
|
|
1855
|
+
const schedule = () => { frame ??= requestAnimationFrame(update); };
|
|
1856
|
+
// Where a jump to the target lands: its top at the inset, clamped to the page's scroll range.
|
|
1857
|
+
const landingOf = (target) => Math.min(Math.max(scrollY + target.el.getBoundingClientRect().top - insetOf(), 0), Math.max(0, root.scrollHeight - innerHeight));
|
|
1858
|
+
const jumpTo = (id) => {
|
|
1859
|
+
jump = undefined;
|
|
1860
|
+
const target = tracked.find((t) => t.el.id === id);
|
|
1861
|
+
if (target) {
|
|
1862
|
+
const landing = landingOf(target);
|
|
1863
|
+
jump = { target, landing, closest: Math.abs(scrollY - landing) };
|
|
1864
|
+
}
|
|
1865
|
+
schedule();
|
|
1866
|
+
};
|
|
1867
|
+
// A layout change can move the target. While the landing stays within 2px of the stored one, the jump holds
|
|
1868
|
+
// unchanged, so small changes cannot add up (the scroll may still be on its way). When the landing moved and the
|
|
1869
|
+
// page already sits at the new one, as when the page bottom clamps it, the jump measures again. Otherwise the
|
|
1870
|
+
// target moved away, and the jump ends so tracking follows the page.
|
|
1871
|
+
const rebase = () => {
|
|
1872
|
+
if (jump) {
|
|
1873
|
+
const landing = landingOf(jump.target);
|
|
1874
|
+
if (Math.abs(landing - jump.landing) <= 2) return schedule();
|
|
1875
|
+
if (Math.abs(scrollY - landing) <= 2) return jumpTo(jump.target.el.id);
|
|
1876
|
+
}
|
|
1877
|
+
jump = undefined;
|
|
1878
|
+
schedule();
|
|
1879
|
+
};
|
|
1880
|
+
addEventListener('scroll', schedule, { passive: true });
|
|
1881
|
+
addEventListener('resize', rebase);
|
|
1882
|
+
addEventListener('hashchange', () => jumpTo(location.hash.slice(1)));
|
|
1883
|
+
// A second click on the same link changes no hash, so clicks start the jump too.
|
|
1884
|
+
document.addEventListener('click', (e) => {
|
|
1885
|
+
if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;
|
|
1886
|
+
const href = e.target instanceof Element ? e.target.closest('a[href^="#"]')?.getAttribute('href') : undefined;
|
|
1887
|
+
if (href && href.length > 1) jumpTo(href.slice(1));
|
|
1279
1888
|
});
|
|
1280
|
-
|
|
1281
|
-
|
|
1889
|
+
|
|
1890
|
+
// Tablet and phone: one sticky header row holds Find and Menu. The drawer holds Find, the pages, the
|
|
1891
|
+
// appearance control, and the rail's groups, in that order. Desktop puts each piece back.
|
|
1892
|
+
const pageHead = document.querySelector('.page-head');
|
|
1893
|
+
const appearanceRow = document.createElement('div');
|
|
1894
|
+
appearanceRow.className = 'drawer-appearance';
|
|
1895
|
+
appearanceRow.innerHTML = '<span class="group-label" aria-hidden="true">Appearance</span>';
|
|
1896
|
+
const barHome = [bar.parentElement, bar.nextSibling];
|
|
1897
|
+
const place = () => {
|
|
1898
|
+
if (tablet.matches) {
|
|
1899
|
+
pageHead.append(bar);
|
|
1900
|
+
appearanceRow.append(themeGroup);
|
|
1901
|
+
rail.insertBefore(strip, list);
|
|
1902
|
+
rail.insertBefore(appearanceRow, list);
|
|
1903
|
+
drawerBody.append(rail);
|
|
1904
|
+
bar.hidden = false;
|
|
1905
|
+
} else {
|
|
1906
|
+
if (drawer.open) drawer.close();
|
|
1907
|
+
pageHead.append(strip, themeGroup);
|
|
1908
|
+
appearanceRow.remove();
|
|
1909
|
+
barHome[0].insertBefore(bar, barHome[1]);
|
|
1910
|
+
railHome.prepend(rail);
|
|
1911
|
+
bar.hidden = true;
|
|
1912
|
+
}
|
|
1913
|
+
};
|
|
1914
|
+
tablet.addEventListener('change', () => { place(); rebase(); });
|
|
1915
|
+
place();
|
|
1916
|
+
// Moving the rail shifts the page under a deep link, so the target is scrolled back into place and its
|
|
1917
|
+
// landing measured after the move.
|
|
1918
|
+
if (location.hash) {
|
|
1919
|
+
document.getElementById(location.hash.slice(1))?.scrollIntoView();
|
|
1920
|
+
jumpTo(location.hash.slice(1));
|
|
1921
|
+
}
|
|
1922
|
+
update();
|
|
1923
|
+
// detail is 0 for a click made with Enter or Space, and 1 or more for a tap or a mouse click.
|
|
1924
|
+
document.getElementById('section-menu').addEventListener('click', (e) => openDrawer({ byPointer: e.detail > 0 }));
|
|
1925
|
+
document.getElementById('section-find').addEventListener('click', () => openDrawer({ toFind: true }));
|
|
1926
|
+
|
|
1927
|
+
// Copy link: writes the component's URL and announces the result.
|
|
1928
|
+
document.querySelectorAll('[data-copy-link]').forEach((button) => button.addEventListener('click', async () => {
|
|
1929
|
+
const url = new URL(`#${button.dataset.copyLink}`, location.href).href;
|
|
1930
|
+
try { await navigator.clipboard.writeText(url); status.textContent = 'Link copied.'; } catch (e) { status.textContent = 'Copy failed. Use the address bar instead.'; }
|
|
1931
|
+
}));
|
|
1282
1932
|
})();
|
|
1283
1933
|
</script>
|