@filipgutica/design-system 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/language/DESIGN.md +5 -4
- package/language/components.html +50 -23
- package/language/components.md +14 -9
- package/language/decisions.md +2 -1
- package/language/docs.html +3 -3
- package/language/reference.html +40 -19
- package/package.json +1 -1
package/language/DESIGN.md
CHANGED
|
@@ -117,13 +117,14 @@ Controls use quiet depth and familiar shapes: borderless surfaces with one tight
|
|
|
117
117
|
| Role | Use for | Fill | Border | Radius | Shadow |
|
|
118
118
|
| --- | --- | --- | --- | --- | --- |
|
|
119
119
|
| Page | The canvas and example stages | `--color-bg` | None | None | None |
|
|
120
|
-
| Well |
|
|
120
|
+
| Well | Screenshots, figures, and inset previews other than example stages | `--color-surface` | `--color-border-subtle` | `--radius-panel` | None |
|
|
121
|
+
| Code block | Source code: a frame that holds the header, with the source in an inset panel | Frame: `--color-surface-raised`; panel: `--color-code` | Frame: `--color-border-subtle`; panel: transparent 1px | Frame: `--radius-panel`; panel: `calc(var(--radius-panel) - var(--space-1))` | Frame: `--shadow-surface`; panel: none |
|
|
121
122
|
| Panel | Cards, forms, charts, and detail views | `--color-surface-raised` | Transparent 1px | `--radius-panel` | `--shadow-surface` |
|
|
122
123
|
| Field | Inputs, selects, textareas, and search fields | `--color-field-bg`; disabled: `--color-well` | `--color-field-edge` | `--radius-field` | `--shadow-field`; disabled: none |
|
|
123
124
|
| Track | Segmented and switch tracks, and selected radio cards | `--color-well` | Transparent 1px | Segmented tracks: `--radius-control`; switch tracks: `--radius-pill`; radio cards: `--radius-panel` | `--shadow-sink` |
|
|
124
125
|
| Floating layer | Menus, popovers, pickers, and dialogs | `--color-surface-raised` | Transparent 1px; the shadow's ring draws the edge | `--radius-panel` | `--shadow-dialog` |
|
|
125
126
|
|
|
126
|
-
- Borders stay 1px and transparent on buttons, quiet actions, tracks, panels, and radio cards, so forced colors can draw them. Fields keep `--color-field-edge`. `--color-border` keeps unchecked checkbox and radio edges visible. The toggle card is a named exception: a visible `--color-border-subtle` edge and no rest raise. Invalid fields show a `--color-error` edge, except in forced colors, where the system edge wins. Figures, example frames, and dividers use `--color-border-subtle`.
|
|
127
|
+
- Borders stay 1px and transparent on buttons, quiet actions, tracks, panels, and radio cards, so forced colors can draw them. Fields keep `--color-field-edge`. `--color-border` keeps unchecked checkbox and radio edges visible. The toggle card is a named exception: a visible `--color-border-subtle` edge and no rest raise. Invalid fields show a `--color-error` edge, except in forced colors, where the system edge wins. Figures, example frames, code block frames, and dividers use `--color-border-subtle`.
|
|
127
128
|
- Shape follows role. A pill acts, or sets a value in place; a rectangle is a place, or holds content. Pick a new component's radius from its role in this table, not from the component it looks like.
|
|
128
129
|
|
|
129
130
|
| Role | Shape | Token | Members |
|
|
@@ -135,7 +136,7 @@ Controls use quiet depth and familiar shapes: borderless surfaces with one tight
|
|
|
135
136
|
| Holds other things | 16px | `--radius-panel` | Wells, plates, panels, cards, radio cards, alerts, code blocks, example frames, and floating layers |
|
|
136
137
|
|
|
137
138
|
- A pill never holds text that can wrap. A control whose label can wrap, such as a toggle card or a radio card, is a rectangle.
|
|
138
|
-
- Nested rectangles are concentric: a rectangle that sits closer to a rounded container's edge than the container's radius takes that radius minus the gap. Option rows in a select picker
|
|
139
|
+
- Nested rectangles are concentric: a rectangle that sits closer to a rounded container's edge than the container's radius takes that radius minus the gap. Option rows in a select picker, the rows of a floating menu, such as the project menu, and a code block's source panel, each `--space-1` inside a 16px container, take `calc(var(--radius-panel) - var(--space-1))`, 12px. A shape with more room than that, such as a field in a dialog, keeps the radius of its role.
|
|
139
140
|
- Round marks (radios, slider thumbs, badge dots, and the busy spinner) take `50%`, a fill inside a shape inherits its corners, and an edge that meets another shape takes `0`. A page writes no other literal radius.
|
|
140
141
|
- Avoid nesting panels. Cards are for a few parallel self-contained options that a reader compares. Running prose belongs in open sections. Product screenshots need one frame, not a frame around a frame.
|
|
141
142
|
- [Depth](#depth) gives each role its shadow. Stable hover states keep normal content quiet.
|
|
@@ -165,7 +166,7 @@ Each depth tier has one token. [`tokens.css`](tokens.css) holds every shadow val
|
|
|
165
166
|
- Callouts carry a real caveat, not decorative emphasis.
|
|
166
167
|
- Lists and properties: align short labels, values, and metadata. Use definition lists for terms and short meanings; use tables for actual comparisons.
|
|
167
168
|
- Figures: number them when the prose refers to any of them, and then number them all. Place a figure beside the paragraph that explains it, once the terms it uses have been introduced.
|
|
168
|
-
- Source code sits in a theme-matched
|
|
169
|
+
- Source code sits in a theme-matched panel with syntax colours, inset in the code block's frame; multiline samples may have a small descriptive header and Copy action. Put useful setup context above a command; omit repeated language labels.
|
|
169
170
|
- Examples: show a live component on a stage above its code, in one frame, with Copy in the code's corner. The stage sits on the page background. See [code block with a live example](components.md#with-a-live-example).
|
|
170
171
|
- A screenshot opens at full size when clicked; use a native accessible trigger and restore its focus on close.
|
|
171
172
|
|
package/language/components.html
CHANGED
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
never a text glyph such as ×: a font draws a glyph's ink off its box centre.
|
|
68
68
|
:where keeps the base below each component's own size and layout. */
|
|
69
69
|
:where(.quiet-action) { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: var(--radius-control); background: transparent; font: inherit; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out); }
|
|
70
|
-
.quiet-action.is-hover:where(:not(:disabled)) { color: var(--color-text); background: color-mix(in srgb, currentColor
|
|
71
|
-
@media (hover: hover) { .quiet-action:hover:where(:not(:disabled)) { color: var(--color-text); background: color-mix(in srgb, currentColor
|
|
72
|
-
.quiet-action:is(:active, .is-active):where(:not(:disabled)) { background: color-mix(in srgb, currentColor
|
|
70
|
+
.quiet-action.is-hover:where(:not(:disabled)) { color: var(--color-text); background: color-mix(in srgb, currentColor 6%, transparent); }
|
|
71
|
+
@media (hover: hover) { .quiet-action:hover:where(:not(:disabled)) { color: var(--color-text); background: color-mix(in srgb, currentColor 6%, transparent); } }
|
|
72
|
+
.quiet-action:is(:active, .is-active):where(:not(:disabled)) { background: color-mix(in srgb, currentColor 12%, transparent); }
|
|
73
73
|
.quiet-action:disabled { opacity: 0.58; cursor: not-allowed; }
|
|
74
74
|
|
|
75
75
|
/* Fields: input, textarea, select */
|
|
@@ -455,28 +455,33 @@
|
|
|
455
455
|
.rows [role="option"][aria-selected="true"] { background: var(--color-nav-current); box-shadow: var(--shadow-nav-current); color: var(--color-nav-current-text); font-weight: var(--weight-medium); }
|
|
456
456
|
@media (forced-colors: active) { .rows [role="option"][aria-selected="true"] { border-inline-start: 2px solid Highlight; } }
|
|
457
457
|
|
|
458
|
-
/* Code block: a source
|
|
459
|
-
.code { width: 100%; max-width: var(--measure); min-width: 0; overflow: hidden; border: 1px solid
|
|
460
|
-
|
|
458
|
+
/* Code block: a frame that holds the header, with the source in an inset panel */
|
|
459
|
+
.code { width: 100%; max-width: var(--measure); min-width: 0; overflow: hidden; padding: var(--space-1); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-panel); background: var(--color-surface-raised); color: var(--color-code-text); box-shadow: var(--shadow-surface); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
|
|
460
|
+
/* The header sits on the frame, so the frame drops its top padding under one. */
|
|
461
|
+
.code:has(> .code-head) { padding-top: 0; }
|
|
462
|
+
.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); font-size: var(--text-xs); }
|
|
461
463
|
.code-head b { font-weight: var(--weight-semibold); }
|
|
462
464
|
.code-head .lang { color: var(--color-muted); }
|
|
463
465
|
/* Copy is a quiet action; this sets its size and place. */
|
|
464
466
|
.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; }
|
|
465
|
-
/* The code block has its own palette, so
|
|
466
|
-
.code .copy
|
|
467
|
-
|
|
467
|
+
/* Copy is muted at rest. The code block has its own palette, so on hover and while the tick shows it takes the block's text colour. */
|
|
468
|
+
.code .copy { color: var(--color-muted); }
|
|
469
|
+
.code .copy[data-copied] { color: var(--color-code-text); }
|
|
470
|
+
.code .copy.is-hover:where(:not(:disabled)) { color: var(--color-code-text); }
|
|
471
|
+
@media (hover: hover) { .code .copy:hover:where(:not(:disabled)) { color: var(--color-code-text); } }
|
|
468
472
|
/* Inset: the code block clips its content. */
|
|
469
473
|
.code pre:is(:focus-visible, .is-focus) { outline: var(--focus-width) solid var(--color-focus); outline-offset: calc(var(--focus-width) * -1); }
|
|
470
474
|
.code .copy.quiet-action:is(:focus-visible, .is-focus) { outline-offset: calc(var(--focus-width) * -1); }
|
|
471
|
-
|
|
475
|
+
/* The source is an inset panel. It sits --space-1 inside the frame, so its corners are concentric with the frame's. */
|
|
476
|
+
.code pre { margin: 0; padding: var(--space-4); overflow: auto; max-height: 32rem; border: 1px solid transparent; border-radius: calc(var(--radius-panel) - var(--space-1)); background: var(--color-code); font-size: var(--text-code); line-height: 1.65; tab-size: 2; }
|
|
472
477
|
/* Each line is a baseline-aligned row, so a prompt or line number sits on the text's baseline. */
|
|
473
478
|
.code .line { display: flex; align-items: baseline; min-height: 1.65em; }
|
|
474
479
|
.code .line > span { white-space: pre; }
|
|
475
480
|
.code .ln { min-width: 2.5em; padding-right: 1em; flex: none; text-align: right; color: var(--color-muted); user-select: none; }
|
|
476
481
|
.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); }
|
|
477
|
-
|
|
478
|
-
.code.compact
|
|
479
|
-
.code.compact
|
|
482
|
+
/* The panel fills the row beside Copy, so it sits --space-1 from the frame and from Copy on every side, and centres its line. */
|
|
483
|
+
.code.compact { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-1); }
|
|
484
|
+
.code.compact pre { align-content: center; padding: var(--space-2) var(--space-3); }
|
|
480
485
|
|
|
481
486
|
/* Code block with a live example: a live stage over its source, in one frame. */
|
|
482
487
|
.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); }
|
|
@@ -485,16 +490,17 @@
|
|
|
485
490
|
.example-stage > * { min-width: 0; }
|
|
486
491
|
/* The frame draws the edge, so the source is flat and full width, with one hairline above it.
|
|
487
492
|
Copy comes first in DOM order and is placed in the source's top right corner. */
|
|
488
|
-
.example > .code { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; max-width: none; border-width: 1px 0 0; border-
|
|
489
|
-
.example > .code > pre { grid-row: 1; grid-column: 1; }
|
|
493
|
+
.example > .code { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; max-width: none; padding: 0; border-width: 1px 0 0; border-radius: 0; background: var(--color-code); box-shadow: none; }
|
|
494
|
+
.example > .code > pre { grid-row: 1; grid-column: 1; border: 0; border-radius: 0; }
|
|
490
495
|
.example > .code > .copy { grid-row: 1; grid-column: 2; margin: var(--space-1); }
|
|
491
496
|
|
|
492
497
|
/* ================= Identity: terminal folio ================= */
|
|
493
498
|
|
|
494
|
-
/* Command plate: dark in both themes and tinted with the project hue. */
|
|
495
|
-
/* The plate is dark in both themes, so its focus ring takes the dark-theme accent, which reaches 3:1 on it
|
|
496
|
-
|
|
497
|
-
.code.command
|
|
499
|
+
/* Command plate: dark in both themes and tinted with the project hue. Its source panel is the plate darkened, so it reads as a panel on it. */
|
|
500
|
+
/* The plate is dark in both themes, so its focus ring takes the dark-theme accent, which reaches 3:1 on it,
|
|
501
|
+
and muted text, such as Copy at rest, takes the caption colour. */
|
|
502
|
+
.code.command { --color-code: color-mix(in srgb, var(--color-command-bg) 55%, var(--color-terminal)); --color-code-text: var(--color-terminal-text); --color-muted: var(--color-terminal-caption-text); --color-focus: var(--color-project-dark); border-color: var(--color-command-border); background: var(--color-command-bg); color: var(--color-terminal-text); }
|
|
503
|
+
.code.command .code-head { color: var(--color-terminal-caption-text); }
|
|
498
504
|
.code.command .code-head .lang { color: var(--color-terminal-caption-text); }
|
|
499
505
|
/* The prompt is drawn by CSS, so copied and spoken text omit it. */
|
|
500
506
|
.code.command .line::before { content: "$ " / ""; flex: none; white-space: pre; color: var(--color-project-dark); user-select: none; }
|
|
@@ -544,7 +550,7 @@
|
|
|
544
550
|
/* The ~/ mark is decorative: the empty alternative text keeps it out of the name. */
|
|
545
551
|
.projects > summary::before { content: "~/" / ""; color: var(--color-project); }
|
|
546
552
|
/* The open menu keeps the hover tint. :where keeps it below the quiet action's press. */
|
|
547
|
-
:where(.projects[open]) > summary { background: color-mix(in srgb, currentColor
|
|
553
|
+
:where(.projects[open]) > summary { background: color-mix(in srgb, currentColor 6%, transparent); }
|
|
548
554
|
.projects .icon { transition: transform var(--duration-fast) var(--ease-out); }
|
|
549
555
|
.projects[open] .icon { transform: rotate(180deg); }
|
|
550
556
|
.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); }
|
|
@@ -798,6 +804,7 @@
|
|
|
798
804
|
<symbol id="i-help" viewBox="0 0 16 16"><circle cx="8" cy="8" r="5.5"/><path d="M6.6 6.4a1.5 1.5 0 1 1 2 1.4c-.4.2-.6.5-.6.9M8 10.8v.2"/></symbol>
|
|
799
805
|
<symbol id="i-alert" viewBox="0 0 16 16"><circle cx="8" cy="8" r="5.5"/><path d="M8 5v3.5M8 10.8v.2"/></symbol>
|
|
800
806
|
<symbol id="i-check" viewBox="0 0 16 16"><circle cx="8" cy="8" r="5.5"/><path d="M5.8 8.2l1.5 1.5 2.9-3"/></symbol>
|
|
807
|
+
<symbol id="i-tick" viewBox="0 0 16 16"><path d="M3.5 8.5l3 3 6-7"/></symbol>
|
|
801
808
|
<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>
|
|
802
809
|
<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>
|
|
803
810
|
<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>
|
|
@@ -1675,9 +1682,26 @@
|
|
|
1675
1682
|
return [...lines].map((line) => [...line.childNodes].filter((n) => !(n instanceof Element && n.classList.contains('ln'))).map((n) => n.textContent).join('')).join('\n');
|
|
1676
1683
|
};
|
|
1677
1684
|
const status = document.getElementById('copy-status');
|
|
1685
|
+
// A successful copy swaps the button's icon for a tick for 1.5s, and marks the button data-copied for the
|
|
1686
|
+
// colour. A repeat click restarts the wait, and a failure puts the icon back at once. The label and
|
|
1687
|
+
// accessible name do not change.
|
|
1688
|
+
const ticks = new WeakMap();
|
|
1689
|
+
const showCopied = (button, ok) => {
|
|
1690
|
+
const use = button.querySelector('.icon use');
|
|
1691
|
+
use.dataset.icon ??= use.getAttribute('href');
|
|
1692
|
+
const restore = () => { use.setAttribute('href', use.dataset.icon); delete button.dataset.copied; };
|
|
1693
|
+
clearTimeout(ticks.get(button));
|
|
1694
|
+
if (!ok) { restore(); return; }
|
|
1695
|
+
use.setAttribute('href', '#i-tick');
|
|
1696
|
+
button.dataset.copied = '';
|
|
1697
|
+
ticks.set(button, setTimeout(restore, 1500));
|
|
1698
|
+
};
|
|
1678
1699
|
document.querySelectorAll('[data-copy]').forEach((button) => button.addEventListener('click', async () => {
|
|
1679
1700
|
const text = copyText(document.getElementById(button.dataset.copy));
|
|
1680
|
-
|
|
1701
|
+
let ok = true;
|
|
1702
|
+
try { await navigator.clipboard.writeText(text); } catch (e) { ok = false; }
|
|
1703
|
+
status.textContent = ok ? 'Copied.' : 'Copy failed. Select the text instead.';
|
|
1704
|
+
showCopied(button, ok);
|
|
1681
1705
|
}));
|
|
1682
1706
|
|
|
1683
1707
|
// Live dialog and drawer: native modal dialogs return focus to the trigger on close.
|
|
@@ -1948,10 +1972,13 @@
|
|
|
1948
1972
|
document.getElementById('section-menu').addEventListener('click', (e) => openDrawer({ byPointer: e.detail > 0 }));
|
|
1949
1973
|
document.getElementById('section-find').addEventListener('click', () => openDrawer({ toFind: true }));
|
|
1950
1974
|
|
|
1951
|
-
// Copy link: writes the component's URL
|
|
1975
|
+
// Copy link: writes the component's URL, announces the result, and shows a tick as Copy does.
|
|
1952
1976
|
document.querySelectorAll('[data-copy-link]').forEach((button) => button.addEventListener('click', async () => {
|
|
1953
1977
|
const url = new URL(`#${button.dataset.copyLink}`, location.href).href;
|
|
1954
|
-
|
|
1978
|
+
let ok = true;
|
|
1979
|
+
try { await navigator.clipboard.writeText(url); } catch (e) { ok = false; }
|
|
1980
|
+
status.textContent = ok ? 'Link copied.' : 'Copy failed. Use the address bar instead.';
|
|
1981
|
+
showCopied(button, ok);
|
|
1955
1982
|
}));
|
|
1956
1983
|
})();
|
|
1957
1984
|
</script>
|
package/language/components.md
CHANGED
|
@@ -71,7 +71,7 @@ Layer: Core. ui: `UiButton`.
|
|
|
71
71
|
Layer: Core. ui: the `fg-quiet-action` class.
|
|
72
72
|
|
|
73
73
|
- **Anatomy.** A native `<button>`, or the `<summary>` of a menu. Transparent fill, a transparent 1px border, `--radius-control`, and `--color-muted`. The project trigger overrides the corner with `--radius-field`, because it opens a menu and does not act (see [Site header](#site-header)). The content is centred in the box. An icon-only action holds an SVG icon, never a text glyph such as ×, because a font draws a glyph's ink off the centre of its box. Give the shared recipe zero specificity (`:where()`), so each component sets the action's size, place, and resting colour.
|
|
74
|
-
- **States.** Hover turns the text `--color-text` and fills `currentColor` at
|
|
74
|
+
- **States.** Hover turns the text `--color-text` and fills `currentColor` at 6% over transparent, only where the pointer can hover (`@media (hover: hover)`). Pressed fills `currentColor` at 12%, with no sink. Focus-visible is the focus ring, inset where the parent clips. An open menu keeps its trigger at the 6% hover tint, below the press. The code block's Copy is `--color-muted` at rest and takes the block's text colour (`--color-code-text`) on hover and while its tick shows. A disabled quiet action follows the shared [disabled](#rules-for-every-control) rule.
|
|
75
75
|
- **Do.** Use it for an action inside a component: Copy in a code block or command list, close in a dialog or drawer, Full size on a capture, and the project trigger.
|
|
76
76
|
- **Don't.** An action that stands on its own in the page, such as Save or Next. That is a button.
|
|
77
77
|
- **Keyboard and screen reader.** Native button behavior. An icon-only action needs `aria-label`.
|
|
@@ -406,15 +406,20 @@ Layer: Core. ui: none yet.
|
|
|
406
406
|
|
|
407
407
|
Layer: Core. ui: `UiCodeBlock`.
|
|
408
408
|
|
|
409
|
-
- **Anatomy.** A
|
|
409
|
+
- **Anatomy.** A frame that holds an optional header and the source panel.
|
|
410
|
+
- **Frame.** `--color-surface-raised`, a 1px `--color-border-subtle` border, `--radius-panel`, and `--shadow-surface`. Its padding is `0 var(--space-1) var(--space-1)` under a header, and `var(--space-1)` on every side without one.
|
|
411
|
+
- **Header.** At least 40px and `--text-xs`, on the frame with no fill and no rule below. It holds the title in semibold, the language in muted text, and a Copy button.
|
|
412
|
+
- **Source panel.** The `<pre>`: `--color-code`, a transparent 1px border, and `calc(var(--radius-panel) - var(--space-1))` corners (12px), so its curve is concentric with the frame's. It has `--space-4` padding, scrolls in both directions, is at most 32rem tall, and sets `--font-mono` at `--text-code` with a line height of 1.65. Line numbers are muted and right-aligned. Syntax uses the `--color-syntax-*` tokens.
|
|
413
|
+
- **Compact.** The panel and the Copy button share one row, with no header, and a `--space-1` column gap. The panel fills the row's height, so it sits `--space-1` from the frame and from Copy on every side, and centres its line.
|
|
410
414
|
- **Phone text.** Set `text-size-adjust: 100%` (and `-webkit-text-size-adjust`) on the block, and align each line's items to the baseline, so iOS Safari does not enlarge one line.
|
|
411
|
-
- **Copy.** Copies the code text only: no line numbers or prompts, and one line per row joined with newlines. A [quiet action](#quiet-action) at least 44×44 with an accessible name. Announce the result in a polite live region; in the compact variant the success message is visually hidden.
|
|
412
|
-
- **
|
|
415
|
+
- **Copy.** Copies the code text only: no line numbers or prompts, and one line per row joined with newlines. A [quiet action](#quiet-action) at least 44×44 with an accessible name. It is `--color-muted` at rest (7.09:1 on the frame in light, 6.63:1 in dark), and `--color-code-text` on hover and while the tick shows, which the script marks with `data-copied`. Announce the result in a polite live region; in the compact variant the success message is visually hidden.
|
|
416
|
+
- **Copy feedback.** This applies to every copy action: the code block's Copy, a token's Copy, and Copy link. On success, the icon turns into a plain tick (`#i-tick`) for 1.5s and then turns back. A second click within the 1.5s restarts the wait. The visible label, such as Copy, and the accessible name do not change, and no "Copied" text appears. The polite live region announces "Copied." or the failure. On failure, the icon does not change and the failure shows as before: a token's Copy shows "Copy failed" in place of its icon. Under reduced motion nothing changes, because the swap has no animation.
|
|
417
|
+
- **States.** Rest, and focus-visible on Copy and on the `<pre>` when it scrolls. Copy takes the quiet action states, shows the tick after a copy, and announces "Copied." or a failure.
|
|
413
418
|
- **Do.** 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.
|
|
414
419
|
- **Don't.** The same language label on every block of a page. Put useful setup context above the block instead.
|
|
415
|
-
- **Keyboard and screen reader.** The `<pre>` is focusable when it scrolls. Its focus ring and the Copy button's ring are inset, because the block clips its content.
|
|
420
|
+
- **Keyboard and screen reader.** The `<pre>` is focusable when it scrolls. Its focus ring and the Copy button's ring are inset, because the block clips its content. The `<pre>` ring follows the panel's 12px corners.
|
|
416
421
|
- **Motion.** None: the block is static, and Copy changes as a quiet action does.
|
|
417
|
-
- **Forced colors.** The shadow drops and the transparent border
|
|
422
|
+
- **Forced colors.** The shadow drops, and the frame's border and the panel's transparent border draw as system edges. Syntax colours take the system text colour, so code reads as plain text.
|
|
418
423
|
|
|
419
424
|
### With a live example
|
|
420
425
|
|
|
@@ -423,7 +428,7 @@ ui: `UiExample`.
|
|
|
423
428
|
- **Anatomy.** One frame: a `<figure>` with a 1px `--color-border-subtle` edge, `--radius-panel`, no shadow, and its content clipped to the corners. The stage comes first and holds the live preview, centred, at least 8rem tall, with `--space-8` padding. The code block follows directly below the stage, after one `--color-border-subtle` hairline. There is no header row and no language label. An optional caption follows the frame, as a [figure](#figure) caption does.
|
|
424
429
|
- **Tokens.** Frame edge `--color-border-subtle` and corners `--radius-panel`. Stage `--color-bg`. Hairline `--color-border-subtle`.
|
|
425
430
|
- **Stage.** The stage sits on the page background, not in a well or a panel. This is a named exception to the container [depth](DESIGN.md#depth) tier: a preview shows each component on the surface it sits on in a page; see [decisions](decisions.md).
|
|
426
|
-
- **Source.** Inside the frame the code block has no radius, border, or shadow of its own, and it spans the frame's full width, not `--measure`.
|
|
431
|
+
- **Source.** Inside the frame the code block has no radius, border, padding, or shadow of its own, and it spans the frame's full width, not `--measure`. It takes `--color-code`, and its panel is flush with no corners, so the source fills the frame below the hairline.
|
|
427
432
|
- **Copy.** Icon-only and named "Copy code", in the source's top right corner. It comes before the `<pre>` in DOM order, so the reader reaches it before the code.
|
|
428
433
|
- **States.** The frame has no states. Components on the stage show their own states.
|
|
429
434
|
- **Keyboard and screen reader.** Tab order is the stage's controls, then Copy, then the `<pre>`. Name the `<pre>` for its role, for example "Example source", when it scrolls. Focus rings on Copy and the `<pre>` are inset, because the frame clips its content.
|
|
@@ -435,14 +440,14 @@ ui: `UiExample`.
|
|
|
435
440
|
|
|
436
441
|
Layer: Identity. ui: `UiCodeBlock` with a shell language or the compact variant.
|
|
437
442
|
|
|
438
|
-
- **Anatomy.** A code block for a shell command, drawn as a dark plate in both themes: `--color-command-bg` with a `--color-command-border` edge (transparent in light). Text, syntax, and the caption all use `--color-terminal-text` or `--color-terminal-caption-text`. Each line starts with a `$ ` prompt in `--color-project-dark`, drawn with `content: "$ " / ""` and `user-select: none`, so copied and spoken text omit it. The plate sets `--color-focus: var(--color-project-dark)`, the dark-theme accent, so every ring on it, Copy's included, reads at 3:1 or more on the dark plate in both page themes.
|
|
443
|
+
- **Anatomy.** A code block for a shell command, drawn as a dark plate in both themes: the frame is `--color-command-bg` with a `--color-command-border` edge (transparent in light). The source panel is the plate darkened, `color-mix(in srgb, var(--color-command-bg) 55%, var(--color-terminal))`, set as the plate's `--color-code`, so it reads as a panel on the plate. Text, syntax, and the caption all use `--color-terminal-text` or `--color-terminal-caption-text`. Each line starts with a `$ ` prompt in `--color-project-dark`, drawn with `content: "$ " / ""` and `user-select: none`, so copied and spoken text omit it. The plate sets `--color-muted: var(--color-terminal-caption-text)`, so Copy at rest takes the caption colour, and `--color-focus: var(--color-project-dark)`, the dark-theme accent, so every ring on it, Copy's included, reads at 3:1 or more on the dark plate in both page themes.
|
|
439
444
|
- **States.** As for the code block.
|
|
440
445
|
- **Do.** Use it for a shell command the reader runs, one command per line.
|
|
441
446
|
- **Don't.** A `$` typed into the command. CSS draws the prompt; a typed one is copied with the command.
|
|
442
447
|
- **Keyboard and screen reader.** As for the code block.
|
|
443
448
|
- **Motion.** None: as for the code block.
|
|
444
449
|
- **Forced colors.** The dark plate drops to the system background, with system text and edge, and the prompt takes the system text colour.
|
|
445
|
-
- **Contrast.**
|
|
450
|
+
- **Contrast.** Text at least 4.5:1 and the prompt at least 3:1 on the source panel, and the header text at least 4.5:1 on `--color-command-bg`, for each project hue.
|
|
446
451
|
|
|
447
452
|
## Terminal capture
|
|
448
453
|
|
package/language/decisions.md
CHANGED
|
@@ -10,7 +10,8 @@ Each entry records a choice this language made, the options it rejected, and why
|
|
|
10
10
|
| Danger button | Core | A raised `--color-error-surface` button with danger-tinted text, mixed toward `--color-text` as status badges are. Hover and press deepen the tint, and press sinks it. The label must read at 4.5:1 on all three fills; where the mix misses, it falls back to `--color-text`, black, or white. | A flat button with `--color-text` and a hover border read as a pink secondary button, and pressing it showed nothing. | label contrast on all three fills: `tests/catalogue/catalogue.spec.ts` "contrast: every enabled danger button label reaches 4.5:1"; fills, raise, and sink: no test yet |
|
|
11
11
|
| Pressed button | Core | Every variant but text sinks 1px, takes `--shadow-sink`, and changes its fill. Press is a button state: other controls show their latched state, and quiet actions tint without sinking. | The sink shadow alone was too faint to show a click, especially on secondary and ghost. | rule present: `tests/design-foundations.test.mjs` "every state rule the guard requires exists in the catalogue"; 1px move, sink, and fill: no test yet |
|
|
12
12
|
| Busy button | Core | Busy also disables the button, so it takes no hover or press. | A busy button that still hovered and pressed looked ready for a second click. | No test yet |
|
|
13
|
-
| Quiet actions | Core | One recipe for Copy, Full size, dialog and drawer close, and the project trigger: transparent, `currentColor` at
|
|
13
|
+
| Quiet actions | Core | One recipe for Copy, Full size, dialog and drawer close, and the project trigger: transparent, `currentColor` at 6% on hover and 12% pressed (see Quiet action fill), no sink, and the control ring. The project trigger keeps the tint but takes the field corner (see One-line non-action controls). | Each had its own hover (`--color-row-hover`, a colour change only, or a 12% tint), so the same kind of action behaved differently. | rule present: `tests/design-foundations.test.mjs` "every state rule the guard requires exists in the catalogue"; tint recipe: `tests/catalogue/catalogue.spec.ts` "a hovering pointer adds a 6% fill, and a press 12%" |
|
|
14
|
+
| Quiet action fill | Core | `currentColor` at 6% under a hovering pointer and 12% pressed, a faint overlay after Astryx's ghost button overlay (the idea only; no code copied). The user approved it from rendered demos. | 12% hover and 18% pressed, the previous values, replaced by the fainter overlay the user chose. No fill on hover, with only the icon brightening: it hides the hit target, so the reader cannot see what a click will reach. | hover and press alpha: `tests/catalogue/catalogue.spec.ts` "a hovering pointer adds a 6% fill, and a press 12%"; no fill after a tap: "a tap leaves no fill behind" |
|
|
14
15
|
| One source per control | Core | Each control comes from the owning library's component or class, including a link styled as a button. | Local copies built from the same tokens drifted: a docs button had no raise and only faded when pressed. | copied rules unchanged: `tests/design-foundations.test.mjs` "example pages copy the catalogue rules for the shared controls and components they use unchanged" |
|
|
15
16
|
| Section mark | Identity | The `##` mark goes only on the page-level section headings (h2) of documentation, CLI tool, article, and product pages, which are mono with a `--color-border-subtle` rule above. Application and inline-visualization section headings are plain `--font-ui` semibold at `--text-xl` or smaller, with no mark and no rule. h3 and lower never take it. | The mark on every section heading: on a dense screen, such as a metrics dashboard with six sections, it repeated down the page and competed with the data. The mark on h2 and h3: deeper levels repeat more often. A per-page opt-out class: every application page would need to remember it. Dropping the mark: reading pages lose the folio identity that ties them to the `~/name` header. Mono application section headings without the mark: the mono face alone still reads as a document heading among compact sans rows. | No test yet |
|
|
16
17
|
| Command plate | Identity | A dark plate tinted with the project hue (`--color-command-bg`). Terminal captures keep the neutral plate. | The near-black plate looked too severe. | text and prompt contrast: `tests/catalogue/catalogue.spec.ts` "contrast: the command plate text reaches 4.5:1", "contrast: the command plate prompt reaches 3:1"; plate tint: no test yet |
|
package/language/docs.html
CHANGED
|
@@ -44,9 +44,9 @@ p { max-width: var(--measure); color: var(--color-muted); font-size: var(--text-
|
|
|
44
44
|
.command pre { min-width: 0; flex: 1; margin: 0; overflow-x: auto; font-size: var(--text-sm); }
|
|
45
45
|
/* Copy is a quiet action: components.html#quiet-action, unchanged. The page adds its size and colour only. */
|
|
46
46
|
:where(.quiet-action) { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: var(--radius-control); background: transparent; font: inherit; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out); }
|
|
47
|
-
.quiet-action.is-hover:where(:not(:disabled)) { color: var(--color-text); background: color-mix(in srgb, currentColor
|
|
48
|
-
@media (hover: hover) { .quiet-action:hover:where(:not(:disabled)) { color: var(--color-text); background: color-mix(in srgb, currentColor
|
|
49
|
-
.quiet-action:is(:active, .is-active):where(:not(:disabled)) { background: color-mix(in srgb, currentColor
|
|
47
|
+
.quiet-action.is-hover:where(:not(:disabled)) { color: var(--color-text); background: color-mix(in srgb, currentColor 6%, transparent); }
|
|
48
|
+
@media (hover: hover) { .quiet-action:hover:where(:not(:disabled)) { color: var(--color-text); background: color-mix(in srgb, currentColor 6%, transparent); } }
|
|
49
|
+
.quiet-action:is(:active, .is-active):where(:not(:disabled)) { background: color-mix(in srgb, currentColor 12%, transparent); }
|
|
50
50
|
.quiet-action:disabled { opacity: 0.58; cursor: not-allowed; }
|
|
51
51
|
.command button { flex: none; min-width: var(--control-lg); min-height: var(--control-lg); color: var(--color-terminal-caption-text); }
|
|
52
52
|
.meta, #copy-status { color: var(--color-muted); font-size: var(--text-sm); }
|
package/language/reference.html
CHANGED
|
@@ -80,9 +80,9 @@
|
|
|
80
80
|
.btn:not(.text):is(:active, [aria-pressed="true"], .is-active):not(:disabled) { --depth: var(--shadow-sink); transform: translateY(1px); }
|
|
81
81
|
.btn:disabled { --depth: none; opacity: 0.58; cursor: not-allowed; }
|
|
82
82
|
:where(.quiet-action) { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: var(--radius-control); background: transparent; font: inherit; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out); }
|
|
83
|
-
.quiet-action.is-hover:where(:not(:disabled)) { color: var(--color-text); background: color-mix(in srgb, currentColor
|
|
84
|
-
@media (hover: hover) { .quiet-action:hover:where(:not(:disabled)) { color: var(--color-text); background: color-mix(in srgb, currentColor
|
|
85
|
-
.quiet-action:is(:active, .is-active):where(:not(:disabled)) { background: color-mix(in srgb, currentColor
|
|
83
|
+
.quiet-action.is-hover:where(:not(:disabled)) { color: var(--color-text); background: color-mix(in srgb, currentColor 6%, transparent); }
|
|
84
|
+
@media (hover: hover) { .quiet-action:hover:where(:not(:disabled)) { color: var(--color-text); background: color-mix(in srgb, currentColor 6%, transparent); } }
|
|
85
|
+
.quiet-action:is(:active, .is-active):where(:not(:disabled)) { background: color-mix(in srgb, currentColor 12%, transparent); }
|
|
86
86
|
.quiet-action:disabled { opacity: 0.58; cursor: not-allowed; }
|
|
87
87
|
/* .is-focus pins the focus state in the Focus and motion specimens. */
|
|
88
88
|
.is-focus { outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset); }
|
|
@@ -245,6 +245,8 @@
|
|
|
245
245
|
.detail h2 { font-size: var(--text-md); }
|
|
246
246
|
/* A code block inside a panel becomes a flush section, not a nested box. */
|
|
247
247
|
.detail > .code { padding: 0; border: 0; border-radius: 0; border-top: 1px solid var(--color-border-subtle); box-shadow: none; }
|
|
248
|
+
/* Its source spans the section, under one hairline, as a live example's does. */
|
|
249
|
+
.detail > .code > pre { border-width: 1px 0 0; border-color: var(--color-border-subtle); border-radius: 0; }
|
|
248
250
|
|
|
249
251
|
/* Properties */
|
|
250
252
|
.props { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-2) var(--space-4); font-size: var(--text-sm); margin: 0; }
|
|
@@ -267,32 +269,38 @@
|
|
|
267
269
|
}
|
|
268
270
|
|
|
269
271
|
/* Code block: components.html#code-block, unchanged. */
|
|
270
|
-
.code { width: 100%; max-width: var(--measure); min-width: 0; overflow: hidden; border: 1px solid
|
|
271
|
-
|
|
272
|
+
.code { width: 100%; max-width: var(--measure); min-width: 0; overflow: hidden; padding: var(--space-1); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-panel); background: var(--color-surface-raised); color: var(--color-code-text); box-shadow: var(--shadow-surface); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
|
|
273
|
+
/* The header sits on the frame, so the frame drops its top padding under one. */
|
|
274
|
+
.code:has(> .code-head) { padding-top: 0; }
|
|
275
|
+
.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); font-size: var(--text-xs); }
|
|
272
276
|
.code-head b { font-weight: var(--weight-semibold); }
|
|
273
277
|
.code-head .lang { color: var(--color-muted); }
|
|
274
278
|
/* Copy is a quiet action; this sets its size and place. */
|
|
275
279
|
.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; }
|
|
276
|
-
/* The code block has its own palette, so
|
|
277
|
-
.code .copy
|
|
278
|
-
|
|
280
|
+
/* Copy is muted at rest. The code block has its own palette, so on hover and while the tick shows it takes the block's text colour. */
|
|
281
|
+
.code .copy { color: var(--color-muted); }
|
|
282
|
+
.code .copy[data-copied] { color: var(--color-code-text); }
|
|
283
|
+
.code .copy.is-hover:where(:not(:disabled)) { color: var(--color-code-text); }
|
|
284
|
+
@media (hover: hover) { .code .copy:hover:where(:not(:disabled)) { color: var(--color-code-text); } }
|
|
279
285
|
/* Inset: the code block clips its content. */
|
|
280
286
|
.code pre:is(:focus-visible, .is-focus) { outline: var(--focus-width) solid var(--color-focus); outline-offset: calc(var(--focus-width) * -1); }
|
|
281
287
|
.code .copy.quiet-action:is(:focus-visible, .is-focus) { outline-offset: calc(var(--focus-width) * -1); }
|
|
282
|
-
|
|
288
|
+
/* The source is an inset panel. It sits --space-1 inside the frame, so its corners are concentric with the frame's. */
|
|
289
|
+
.code pre { margin: 0; padding: var(--space-4); overflow: auto; max-height: 32rem; border: 1px solid transparent; border-radius: calc(var(--radius-panel) - var(--space-1)); background: var(--color-code); font-size: var(--text-code); line-height: 1.65; tab-size: 2; }
|
|
283
290
|
/* Each line is a baseline-aligned row, so a prompt or line number sits on the text's baseline. */
|
|
284
291
|
.code .line { display: flex; align-items: baseline; min-height: 1.65em; }
|
|
285
292
|
.code .line > span { white-space: pre; }
|
|
286
293
|
.code .ln { min-width: 2.5em; padding-right: 1em; flex: none; text-align: right; color: var(--color-muted); user-select: none; }
|
|
287
294
|
.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); }
|
|
288
|
-
|
|
289
|
-
.code.compact
|
|
290
|
-
.code.compact
|
|
295
|
+
/* The panel fills the row beside Copy, so it sits --space-1 from the frame and from Copy on every side, and centres its line. */
|
|
296
|
+
.code.compact { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-1); }
|
|
297
|
+
.code.compact pre { align-content: center; padding: var(--space-2) var(--space-3); }
|
|
291
298
|
|
|
292
299
|
/* Command plate: components.html#command-plate, unchanged. */
|
|
293
|
-
/* The plate is dark in both themes, so its focus ring takes the dark-theme accent, which reaches 3:1 on it
|
|
294
|
-
|
|
295
|
-
.code.command
|
|
300
|
+
/* The plate is dark in both themes, so its focus ring takes the dark-theme accent, which reaches 3:1 on it,
|
|
301
|
+
and muted text, such as Copy at rest, takes the caption colour. */
|
|
302
|
+
.code.command { --color-code: color-mix(in srgb, var(--color-command-bg) 55%, var(--color-terminal)); --color-code-text: var(--color-terminal-text); --color-muted: var(--color-terminal-caption-text); --color-focus: var(--color-project-dark); border-color: var(--color-command-border); background: var(--color-command-bg); color: var(--color-terminal-text); }
|
|
303
|
+
.code.command .code-head { color: var(--color-terminal-caption-text); }
|
|
296
304
|
.code.command .code-head .lang { color: var(--color-terminal-caption-text); }
|
|
297
305
|
/* The prompt is drawn by CSS, so copied and spoken text omit it. */
|
|
298
306
|
.code.command .line::before { content: "$ " / ""; flex: none; white-space: pre; color: var(--color-project-dark); user-select: none; }
|
|
@@ -436,6 +444,7 @@
|
|
|
436
444
|
<symbol id="i-circle" viewBox="0 0 16 16"><circle cx="8" cy="8" r="5.5"/></symbol>
|
|
437
445
|
<symbol id="i-alert" viewBox="0 0 16 16"><circle cx="8" cy="8" r="5.5"/><path d="M8 5v3.5M8 10.8v.2"/></symbol>
|
|
438
446
|
<symbol id="i-check" viewBox="0 0 16 16"><circle cx="8" cy="8" r="5.5"/><path d="M5.8 8.2l1.5 1.5 2.9-3"/></symbol>
|
|
447
|
+
<symbol id="i-tick" viewBox="0 0 16 16"><path d="M3.5 8.5l3 3 6-7"/></symbol>
|
|
439
448
|
<symbol id="i-dash" viewBox="0 0 16 16"><circle cx="8" cy="8" r="5.5" stroke-dasharray="2 2"/></symbol>
|
|
440
449
|
<symbol id="i-help" viewBox="0 0 16 16"><circle cx="8" cy="8" r="5.5"/><path d="M6.6 6.4a1.5 1.5 0 1 1 2 1.4c-.4.2-.6.5-.6.9M8 10.8v.2"/></symbol>
|
|
441
450
|
<symbol id="i-search" viewBox="0 0 16 16"><circle cx="7" cy="7" r="4.5"/><path d="M10.5 10.5 14 14"/></symbol>
|
|
@@ -499,6 +508,7 @@
|
|
|
499
508
|
</div>
|
|
500
509
|
</div>
|
|
501
510
|
<aside class="panel detail" id="detail" aria-live="polite"></aside>
|
|
511
|
+
<p class="sr-only" role="status" id="copy-status"></p>
|
|
502
512
|
</div>
|
|
503
513
|
|
|
504
514
|
<div class="doc">
|
|
@@ -775,6 +785,7 @@
|
|
|
775
785
|
MONITORS.forEach((m, i) => { m.data = series(m, 11 + i * 7); });
|
|
776
786
|
|
|
777
787
|
const icon = (id) => `<svg class="icon" aria-hidden="true"><use href="#${id}"/></svg>`;
|
|
788
|
+
const copyStatus = document.getElementById('copy-status');
|
|
778
789
|
const esc = (s) => String(s).replace(/&/g, '&').replace(/</g, '<').replace(/"/g, '"');
|
|
779
790
|
|
|
780
791
|
const pathFor = (data, w, h, max, pad = 0) => {
|
|
@@ -891,10 +902,20 @@
|
|
|
891
902
|
</div>
|
|
892
903
|
<div class="cluster"><button class="btn secondary" type="button" data-size="sm">Open in explorer</button><button class="btn ghost" type="button" data-size="sm">Mute</button></div>`;
|
|
893
904
|
const copy = detail.querySelector('.copy');
|
|
894
|
-
copy.
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
905
|
+
// A copy shows a tick for 1.5s and announces the result. Each completed copy restarts the wait, so copies
|
|
906
|
+
// still in flight do not stack timers; a failure puts the copy icon back at once.
|
|
907
|
+
const use = copy.querySelector('use');
|
|
908
|
+
const restore = () => { use.setAttribute('href', '#i-copy'); delete copy.dataset.copied; };
|
|
909
|
+
let wait;
|
|
910
|
+
copy.addEventListener('click', async () => {
|
|
911
|
+
let ok = true;
|
|
912
|
+
try { await navigator.clipboard.writeText(code); } catch (e) { ok = false; }
|
|
913
|
+
clearTimeout(wait);
|
|
914
|
+
copyStatus.textContent = ok ? 'Copied.' : 'Copy failed. Select the query instead.';
|
|
915
|
+
if (!ok) { restore(); return; }
|
|
916
|
+
use.setAttribute('href', '#i-tick');
|
|
917
|
+
copy.dataset.copied = '';
|
|
918
|
+
wait = setTimeout(restore, 1500);
|
|
898
919
|
});
|
|
899
920
|
};
|
|
900
921
|
|