@nyxwire/css 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +133 -2
- package/dist/base.css +850 -0
- package/dist/components.css +10508 -0
- package/dist/docs/components/accordion.md +83 -0
- package/dist/docs/components/alert.md +52 -0
- package/dist/docs/components/avatar.md +55 -0
- package/dist/docs/components/badge.md +64 -0
- package/dist/docs/components/breadcrumbs.md +64 -0
- package/dist/docs/components/button.md +197 -0
- package/dist/docs/components/card.md +103 -0
- package/dist/docs/components/checkbox.md +45 -0
- package/dist/docs/components/chip.md +30 -0
- package/dist/docs/components/cluster.md +33 -0
- package/dist/docs/components/code.md +65 -0
- package/dist/docs/components/container.md +24 -0
- package/dist/docs/components/dialog.md +199 -0
- package/dist/docs/components/divider.md +31 -0
- package/dist/docs/components/dl.md +24 -0
- package/dist/docs/components/effect-utilities.md +82 -0
- package/dist/docs/components/empty.md +40 -0
- package/dist/docs/components/frame.md +27 -0
- package/dist/docs/components/grid.md +31 -0
- package/dist/docs/components/hud.md +75 -0
- package/dist/docs/components/input-group.md +28 -0
- package/dist/docs/components/input.md +52 -0
- package/dist/docs/components/kbd.md +42 -0
- package/dist/docs/components/label-and-field.md +31 -0
- package/dist/docs/components/link.md +41 -0
- package/dist/docs/components/list.md +67 -0
- package/dist/docs/components/menu.md +85 -0
- package/dist/docs/components/meter.md +77 -0
- package/dist/docs/components/navbar.md +66 -0
- package/dist/docs/components/pagination.md +64 -0
- package/dist/docs/components/popover.md +59 -0
- package/dist/docs/components/progress.md +32 -0
- package/dist/docs/components/prose.md +29 -0
- package/dist/docs/components/select.md +51 -0
- package/dist/docs/components/sidebar.md +35 -0
- package/dist/docs/components/sidenav.md +45 -0
- package/dist/docs/components/skeleton.md +36 -0
- package/dist/docs/components/slider.md +32 -0
- package/dist/docs/components/spinner.md +30 -0
- package/dist/docs/components/stack.md +26 -0
- package/dist/docs/components/steps.md +49 -0
- package/dist/docs/components/switch.md +19 -0
- package/dist/docs/components/table.md +83 -0
- package/dist/docs/components/tabs.md +207 -0
- package/dist/docs/components/textarea.md +13 -0
- package/dist/docs/components/toast.md +86 -0
- package/dist/docs/components/tooltip.md +39 -0
- package/dist/docs/components/typography-classes.md +38 -0
- package/dist/docs/families/data-display.md +15 -0
- package/dist/docs/families/feedback.md +13 -0
- package/dist/docs/families/forms.md +141 -0
- package/dist/docs/families/layout-typography.md +17 -0
- package/dist/docs/families/navigation.md +13 -0
- package/dist/docs/families/overlays.md +13 -0
- package/dist/docs/families/surfaces.md +11 -0
- package/dist/docs/foundations/accessibility.md +71 -0
- package/dist/docs/foundations/color-roles.md +114 -0
- package/dist/docs/foundations/effects-motion.md +150 -0
- package/dist/docs/foundations/flavors.md +156 -0
- package/dist/docs/foundations/icons.md +45 -0
- package/dist/docs/foundations/palette.md +180 -0
- package/dist/docs/foundations/spacing-elevation.md +168 -0
- package/dist/docs/foundations/typography.md +80 -0
- package/dist/docs/index.md +233 -0
- package/dist/docs/manifest.json +859 -0
- package/dist/fonts/inter-OFL.txt +93 -0
- package/dist/fonts/inter-latin-ext-wght-italic.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-wght-italic.woff2 +0 -0
- package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/martian-mono-OFL.txt +93 -0
- package/dist/fonts/martian-mono-latin-ext-wdth-normal.woff2 +0 -0
- package/dist/fonts/martian-mono-latin-wdth-normal.woff2 +0 -0
- package/dist/fonts/space-grotesk-OFL.txt +93 -0
- package/dist/fonts/space-grotesk-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/space-grotesk-latin-wght-normal.woff2 +0 -0
- package/dist/fonts.css +73 -0
- package/dist/nyxwire.css +12183 -0
- package/dist/tokens.css +579 -0
- package/dist/utilities.css +176 -0
- package/nyxwire.d.ts +2 -0
- package/package.json +66 -3
- package/skills/nyxwire/SKILL.md +63 -0
- package/src/base.css +158 -0
- package/src/components/accordion.css +280 -0
- package/src/components/alert.css +176 -0
- package/src/components/avatar.css +262 -0
- package/src/components/badge.css +193 -0
- package/src/components/breadcrumbs.css +209 -0
- package/src/components/btn.css +517 -0
- package/src/components/card.css +327 -0
- package/src/components/checkbox.css +202 -0
- package/src/components/chip.css +345 -0
- package/src/components/code.css +340 -0
- package/src/components/dialog.css +411 -0
- package/src/components/divider.css +201 -0
- package/src/components/empty.css +216 -0
- package/src/components/field.css +161 -0
- package/src/components/hud.css +212 -0
- package/src/components/index.css +50 -0
- package/src/components/input.css +383 -0
- package/src/components/kbd.css +197 -0
- package/src/components/layout.css +344 -0
- package/src/components/link.css +178 -0
- package/src/components/list.css +353 -0
- package/src/components/menu.css +347 -0
- package/src/components/meter.css +238 -0
- package/src/components/navbar.css +309 -0
- package/src/components/pagination.css +302 -0
- package/src/components/popover.css +352 -0
- package/src/components/progress.css +241 -0
- package/src/components/select.css +121 -0
- package/src/components/sidenav.css +326 -0
- package/src/components/skeleton.css +193 -0
- package/src/components/slider.css +201 -0
- package/src/components/spinner.css +200 -0
- package/src/components/stat.css +263 -0
- package/src/components/steps.css +311 -0
- package/src/components/switch.css +183 -0
- package/src/components/table.css +290 -0
- package/src/components/tabs.css +271 -0
- package/src/components/toast.css +413 -0
- package/src/components/tooltip.css +288 -0
- package/src/fonts.css +92 -0
- package/src/index.css +6 -0
- package/src/motion.css +177 -0
- package/src/semantic.css +85 -0
- package/src/tokens.css +276 -0
- package/src/typography.css +430 -0
- package/src/utilities.css +198 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# .nw-accordion
|
|
2
|
+
|
|
3
|
+
Part of [Surfaces](../families/surfaces.md).
|
|
4
|
+
|
|
5
|
+
An accordion is a stack of disclosure rows. On native `<details>` the browser does the toggling, keyboard and accessibility with no script. The chevron is drawn by the trigger's `::after` and turns when the row opens; an open title and its icon take the intent ink.
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<div class="nw-accordion">
|
|
9
|
+
<details class="nw-accordion-item" open>
|
|
10
|
+
<summary>What does a relay do? <span class="nw-accordion-meta">2 min</span></summary>
|
|
11
|
+
<div class="nw-accordion-content"><p>A relay forwards traffic between the edge and the core, and reports latency every second.</p></div>
|
|
12
|
+
</details>
|
|
13
|
+
<details class="nw-accordion-item">
|
|
14
|
+
<summary>How is failover decided?</summary>
|
|
15
|
+
<div class="nw-accordion-content"><p>When a relay misses three heartbeats, its traffic moves to the nearest healthy relay.</p></div>
|
|
16
|
+
</details>
|
|
17
|
+
<details class="nw-accordion-item" inert>
|
|
18
|
+
<summary>Billing (disabled with inert)</summary>
|
|
19
|
+
<div class="nw-accordion-content"><p>Not available.</p></div>
|
|
20
|
+
</details>
|
|
21
|
+
</div>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
```html
|
|
25
|
+
<div class="nw-accordion nw-accordion-boxed nw-accordion-secondary">
|
|
26
|
+
<details class="nw-accordion-item" open>
|
|
27
|
+
<summary>Boxed and secondary</summary>
|
|
28
|
+
<div class="nw-accordion-content"><p>Every item sits in its own panel; the open title takes the intent ink.</p></div>
|
|
29
|
+
</details>
|
|
30
|
+
<details class="nw-accordion-item">
|
|
31
|
+
<summary>Second item</summary>
|
|
32
|
+
<div class="nw-accordion-content"><p>Content.</p></div>
|
|
33
|
+
</details>
|
|
34
|
+
</div>
|
|
35
|
+
<div class="nw-accordion nw-accordion-ghost nw-accordion-sm">
|
|
36
|
+
<details class="nw-accordion-item">
|
|
37
|
+
<summary>Ghost and small</summary>
|
|
38
|
+
<div class="nw-accordion-content"><p>No rules and no side padding, for dense sidebars.</p></div>
|
|
39
|
+
</details>
|
|
40
|
+
<details class="nw-accordion-item">
|
|
41
|
+
<summary>Another item</summary>
|
|
42
|
+
<div class="nw-accordion-content"><p>Content.</p></div>
|
|
43
|
+
</details>
|
|
44
|
+
</div>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Library markup (Reka UI, Radix) gets the same look from `nw-accordion-trigger`, `aria-expanded` and `data-state`:
|
|
48
|
+
|
|
49
|
+
```html
|
|
50
|
+
<div class="nw-accordion">
|
|
51
|
+
<div class="nw-accordion-item" data-state="open">
|
|
52
|
+
<h3 style="margin: 0">
|
|
53
|
+
<button type="button" class="nw-accordion-trigger" id="acc-t1" aria-expanded="true" aria-controls="acc-p1">
|
|
54
|
+
<span class="nw-accordion-icon" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="12" cy="12" r="9"/><path d="M12 8v4l3 2"/></svg></span>
|
|
55
|
+
Library markup, open
|
|
56
|
+
</button>
|
|
57
|
+
</h3>
|
|
58
|
+
<div class="nw-accordion-content" id="acc-p1" role="region" aria-labelledby="acc-t1" data-state="open"><p>A headless library sets aria-expanded and data-state; the classes are the same.</p></div>
|
|
59
|
+
</div>
|
|
60
|
+
<div class="nw-accordion-item" data-state="closed">
|
|
61
|
+
<h3 style="margin: 0">
|
|
62
|
+
<button type="button" class="nw-accordion-trigger" aria-expanded="false" disabled>Disabled trigger</button>
|
|
63
|
+
</h3>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
| Class / selector | Effect |
|
|
69
|
+
| --------------------------------------------------------- | ---------------------------------------------------------------------------- |
|
|
70
|
+
| `nw-accordion` | The stack, with hairlines between items. |
|
|
71
|
+
| `nw-accordion-item` | One row: a `<details>`, or a wrapper with `data-state="open"` or `"closed"`. |
|
|
72
|
+
| `summary`, `nw-accordion-trigger` | The trigger row, with the chevron at the end. |
|
|
73
|
+
| `nw-accordion-meta` | Trailing meta text in the trigger, before the chevron. |
|
|
74
|
+
| `nw-accordion-icon` | A leading icon in the trigger; it takes the intent ink when open. |
|
|
75
|
+
| `nw-accordion-content` | The panel. Library panels animate in and out with `data-state`. |
|
|
76
|
+
| `[open]`, `[aria-expanded="true"]`, `[data-state="open"]` | The open row. |
|
|
77
|
+
| `:disabled`, `[aria-disabled="true"]`, `details[inert]` | A disabled row. |
|
|
78
|
+
| `nw-accordion-boxed` | Each item in its own panel. |
|
|
79
|
+
| `nw-accordion-ghost` | No rules and no side padding. |
|
|
80
|
+
| `nw-accordion-sm`, `-md`, `-lg` | Trigger and content sizes. |
|
|
81
|
+
| `nw-accordion-primary` ... `-danger` | Ink of the open title and icon. |
|
|
82
|
+
|
|
83
|
+
To let only one row open at a time, give the `<details>` elements the same `name` attribute; browsers that support it close the others natively.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# .nw-alert
|
|
2
|
+
|
|
3
|
+
Part of [Feedback](../families/feedback.md).
|
|
4
|
+
|
|
5
|
+
An alert is a message with one intent. It is **solid by default**, the loud variant; `soft` suits inline form and panel messages and `outline` a quiet one. There is no side stripe: the intent reads from the fill, the icon and the title. Actions wrap under the content on a narrow screen instead of squeezing the text.
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<div class="nw-alert nw-alert-info" role="status">
|
|
9
|
+
<svg class="nw-alert-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M12 11v5M12 8h.01"/></svg>
|
|
10
|
+
<div class="nw-alert-content">
|
|
11
|
+
<p class="nw-alert-title">Maintenance window</p>
|
|
12
|
+
<p class="nw-alert-description">Relays in eu-north restart at 02:00 UTC. <a href="#nw-alert">Read the plan</a>.</p>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="nw-alert-actions">
|
|
15
|
+
<button type="button" class="nw-btn nw-btn-sm nw-btn-outline">Remind me</button>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="nw-alert nw-alert-soft nw-alert-success" role="status">
|
|
19
|
+
<svg class="nw-alert-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 13l4 4L19 7"/></svg>
|
|
20
|
+
<div class="nw-alert-content">
|
|
21
|
+
<p class="nw-alert-title">Deployed</p>
|
|
22
|
+
<p class="nw-alert-description">Build 412 is live on every relay.</p>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
<div class="nw-alert nw-alert-outline nw-alert-warning nw-alert-sm" role="status">
|
|
26
|
+
<div class="nw-alert-content"><p class="nw-alert-title">Outline, small, no icon</p></div>
|
|
27
|
+
</div>
|
|
28
|
+
<div class="nw-alert nw-alert-danger nw-alert-lg" role="alert">
|
|
29
|
+
<svg class="nw-alert-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M12 3 2 21h20L12 3z"/><path d="M12 10v4M12 17h.01"/></svg>
|
|
30
|
+
<div class="nw-alert-content">
|
|
31
|
+
<p class="nw-alert-title">Uplink lost</p>
|
|
32
|
+
<p class="nw-alert-description">Traffic moved to ams-03. Retrying in 5 seconds.</p>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="nw-alert-actions">
|
|
35
|
+
<button type="button" class="nw-btn nw-btn-sm nw-btn-ghost">Dismiss</button>
|
|
36
|
+
<button type="button" class="nw-btn nw-btn-sm nw-btn-outline">Retry now</button>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
| Class | Effect |
|
|
42
|
+
| ---------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
|
43
|
+
| `nw-alert` | The message box. Solid, primary and medium by default. |
|
|
44
|
+
| `nw-alert-solid`, `-soft`, `-outline` | Full intent fill with the on-accent ink, a tinted wash, or a hairline only. |
|
|
45
|
+
| `nw-alert-primary` ... `-danger` | The intent. |
|
|
46
|
+
| `nw-alert-sm`, `-md`, `-lg` | Padding and type. |
|
|
47
|
+
| `nw-alert-icon` | Leading icon, centered on the first line of the title. Mark it `aria-hidden`. |
|
|
48
|
+
| `nw-alert-content` | The text column. |
|
|
49
|
+
| `nw-alert-title`, `nw-alert-description` | Title and body; links in the description inherit the alert's ink. |
|
|
50
|
+
| `nw-alert-actions` | Action buttons. On a solid alert, ghost, link and outline buttons switch to the on-intent ink to stay readable. |
|
|
51
|
+
|
|
52
|
+
Use `role="alert"` for something that just happened and needs attention now, and `role="status"` for a passive change. A static notice that is on the page from the start needs neither.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# .nw-avatar
|
|
2
|
+
|
|
3
|
+
Part of [Data display](../families/data-display.md).
|
|
4
|
+
|
|
5
|
+
An avatar is a rounded slot for a user: an image, initials in the fallback, or an empty bordered slot. The fallback shows until the image has a source.
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<div class="nw-cluster">
|
|
9
|
+
<span class="nw-avatar"><img class="nw-avatar-img" src="" alt="" /><span class="nw-avatar-fallback">RK</span></span>
|
|
10
|
+
<span class="nw-avatar nw-avatar-square"><span class="nw-avatar-fallback">KV</span></span>
|
|
11
|
+
<span class="nw-avatar nw-avatar-cut"><span class="nw-avatar-fallback">MX</span></span>
|
|
12
|
+
<span class="nw-avatar nw-avatar-solid nw-avatar-secondary"><span class="nw-avatar-fallback">SB</span></span>
|
|
13
|
+
<span class="nw-avatar nw-avatar-outline"></span>
|
|
14
|
+
<span class="nw-avatar nw-avatar-ring"><span class="nw-avatar-fallback">AL</span></span>
|
|
15
|
+
<span class="nw-avatar nw-avatar-glow"><span class="nw-avatar-fallback">NW</span></span>
|
|
16
|
+
<span class="nw-avatar"><span class="nw-avatar-fallback">JO</span><span class="nw-avatar-status nw-avatar-status-online"></span></span>
|
|
17
|
+
<span class="nw-avatar"><span class="nw-avatar-fallback">JO</span><span class="nw-avatar-status nw-avatar-status-away"></span></span>
|
|
18
|
+
<span class="nw-avatar"><span class="nw-avatar-fallback">JO</span><span class="nw-avatar-status nw-avatar-status-busy"></span></span>
|
|
19
|
+
<span class="nw-avatar"><span class="nw-avatar-fallback">JO</span><span class="nw-avatar-status nw-avatar-status-offline"></span></span>
|
|
20
|
+
</div>
|
|
21
|
+
<div class="nw-cluster">
|
|
22
|
+
<span class="nw-avatar nw-avatar-xs"><span class="nw-avatar-fallback">XS</span></span>
|
|
23
|
+
<span class="nw-avatar nw-avatar-sm"><span class="nw-avatar-fallback">SM</span></span>
|
|
24
|
+
<span class="nw-avatar"><span class="nw-avatar-fallback">MD</span></span>
|
|
25
|
+
<span class="nw-avatar nw-avatar-lg"><span class="nw-avatar-fallback">LG</span></span>
|
|
26
|
+
<span class="nw-avatar nw-avatar-xl"><span class="nw-avatar-fallback">XL</span></span>
|
|
27
|
+
<span class="nw-avatar nw-avatar-2xl"><span class="nw-avatar-fallback">2X</span></span>
|
|
28
|
+
</div>
|
|
29
|
+
<div class="nw-cluster">
|
|
30
|
+
<span class="nw-avatar-group">
|
|
31
|
+
<span class="nw-avatar"><span class="nw-avatar-fallback">RK</span></span>
|
|
32
|
+
<span class="nw-avatar"><span class="nw-avatar-fallback">KV</span></span>
|
|
33
|
+
<span class="nw-avatar"><span class="nw-avatar-fallback">MX</span></span>
|
|
34
|
+
<span class="nw-avatar-group-count">+6</span>
|
|
35
|
+
</span>
|
|
36
|
+
<a class="nw-avatar nw-avatar-ring" href="#nw-avatar"><span class="nw-avatar-fallback">GO</span></a>
|
|
37
|
+
</div>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
| Class / selector | Effect |
|
|
41
|
+
| ----------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
|
|
42
|
+
| `nw-avatar` | The slot. Round by default; `img.nw-avatar-img` covers it. |
|
|
43
|
+
| `nw-avatar-img` | The image; the fallback shows until it has a source. |
|
|
44
|
+
| `nw-avatar-fallback` | The initials. |
|
|
45
|
+
| `nw-avatar-square`, `nw-avatar-cut` | Square corners, or chamfered ones (the chamfer clips the image and fallback). |
|
|
46
|
+
| `nw-avatar-solid` | The initials sit on the full intent. |
|
|
47
|
+
| `nw-avatar-outline` | A bordered empty slot, for an "add" affordance. |
|
|
48
|
+
| `nw-avatar-ring`, `nw-avatar-glow` | A gap and a ring in the intent color; and a bloom (a `drop-shadow` when cut). |
|
|
49
|
+
| `nw-avatar-primary` ... `-danger` | The fallback and ring intent. |
|
|
50
|
+
| `nw-avatar-xs`, `-sm`, `-md`, `-lg`, `-xl`, `-2xl` | Sizes. |
|
|
51
|
+
| `nw-avatar-status`, `-online`, `-away`, `-busy`, `-offline` | A status dot pinned to the lower trailing edge with a canvas gap. |
|
|
52
|
+
| `nw-avatar-group`, `nw-avatar-group-count` | Overlapping group; each member is cut out of the next by a canvas ring, the hovered one rises. A trailing count uses the same box. |
|
|
53
|
+
| `a.nw-avatar`, `button.nw-avatar` | An interactive avatar: hover, focus ring. |
|
|
54
|
+
|
|
55
|
+
Give an initials avatar a textual name nearby, or an `aria-label` on the link when the avatar itself is the control: initials are decorative to a screen reader.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# .nw-badge
|
|
2
|
+
|
|
3
|
+
Part of [Feedback](../families/feedback.md).
|
|
4
|
+
|
|
5
|
+
A badge is a short status label, not an action. It is solid by default; soft and outline suit dense lists.
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<div class="nw-cluster">
|
|
9
|
+
<span class="nw-badge">Solid</span>
|
|
10
|
+
<span class="nw-badge nw-badge-soft">Soft</span>
|
|
11
|
+
<span class="nw-badge nw-badge-outline">Outline</span>
|
|
12
|
+
<span class="nw-badge nw-badge-round nw-badge-secondary">Round</span>
|
|
13
|
+
<span class="nw-badge nw-badge-count nw-badge-danger">7</span>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="nw-cluster">
|
|
16
|
+
<span class="nw-badge nw-badge-soft nw-badge-primary">Primary</span>
|
|
17
|
+
<span class="nw-badge nw-badge-soft nw-badge-secondary">Secondary</span>
|
|
18
|
+
<span class="nw-badge nw-badge-soft nw-badge-tertiary">Tertiary</span>
|
|
19
|
+
<span class="nw-badge nw-badge-soft nw-badge-neutral">Neutral</span>
|
|
20
|
+
<span class="nw-badge nw-badge-soft nw-badge-info">Info</span>
|
|
21
|
+
<span class="nw-badge nw-badge-soft nw-badge-success">Success</span>
|
|
22
|
+
<span class="nw-badge nw-badge-soft nw-badge-warning">Warning</span>
|
|
23
|
+
<span class="nw-badge nw-badge-soft nw-badge-danger">Danger</span>
|
|
24
|
+
</div>
|
|
25
|
+
<div class="nw-cluster">
|
|
26
|
+
<span class="nw-badge nw-badge-xs">xs</span>
|
|
27
|
+
<span class="nw-badge nw-badge-sm">sm</span>
|
|
28
|
+
<span class="nw-badge nw-badge-md">md</span>
|
|
29
|
+
<span class="nw-badge nw-badge-lg">lg</span>
|
|
30
|
+
<span class="nw-badge nw-badge-outline nw-badge-success nw-badge-dot">Online</span>
|
|
31
|
+
<span class="nw-badge nw-badge-soft nw-badge-warning nw-badge-dot nw-badge-pulse">Rerouting</span>
|
|
32
|
+
<a class="nw-badge nw-badge-soft nw-badge-info" href="#nw-badge">Link badge</a>
|
|
33
|
+
<button type="button" class="nw-badge nw-badge-outline" disabled>Disabled</button>
|
|
34
|
+
</div>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Accents
|
|
38
|
+
|
|
39
|
+
The badge intents cover the semantic roles. For any of the twelve palette accents, scope `data-accent` on the badge (or on a parent) and keep the primary intent:
|
|
40
|
+
|
|
41
|
+
```html
|
|
42
|
+
<div class="nw-cluster">
|
|
43
|
+
<span class="nw-badge" data-accent="flux">flux</span>
|
|
44
|
+
<span class="nw-badge" data-accent="flare">flare</span>
|
|
45
|
+
<span class="nw-badge" data-accent="circuit">circuit</span>
|
|
46
|
+
<span class="nw-badge nw-badge-soft" data-accent="iris">iris</span>
|
|
47
|
+
<span class="nw-badge nw-badge-soft" data-accent="steel">steel</span>
|
|
48
|
+
<span class="nw-badge nw-badge-outline" data-accent="volt">volt</span>
|
|
49
|
+
</div>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Modifiers
|
|
53
|
+
|
|
54
|
+
| Class / selector | Effect |
|
|
55
|
+
| ------------------------------------- | ----------------------------------------------------------------------------------- |
|
|
56
|
+
| `nw-badge` | The label. Solid, primary and medium by default. |
|
|
57
|
+
| `nw-badge-solid`, `-soft`, `-outline` | Variants. |
|
|
58
|
+
| `nw-badge-primary` ... `-danger` | Intents. |
|
|
59
|
+
| `nw-badge-xs`, `-sm`, `-md`, `-lg` | Sizes. |
|
|
60
|
+
| `nw-badge-round` | Fully rounded pill. |
|
|
61
|
+
| `nw-badge-count` | A single digit or letter: square padding keeps the pill a circle; tabular numerals. |
|
|
62
|
+
| `nw-badge-dot` | A leading status dot. In forced colors the dot gets a real border. |
|
|
63
|
+
| `nw-badge-pulse` | Pulses the dot, only while the status is changing. |
|
|
64
|
+
| `a.nw-badge`, `button.nw-badge` | Interactive badge with hover, focus and disabled states. |
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# .nw-breadcrumbs
|
|
2
|
+
|
|
3
|
+
Part of [Navigation](../families/navigation.md).
|
|
4
|
+
|
|
5
|
+
Breadcrumbs are a `<nav aria-label="Breadcrumb">` around an ordered list. The separator is drawn by CSS between items, a slash in the mono face by default, so the markup stays a plain list. The current page is the item with `aria-current="page"`; it is styled as the end of the trail and need not be a link.
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<div class="nw-stack">
|
|
9
|
+
<nav class="nw-breadcrumbs" aria-label="Breadcrumb">
|
|
10
|
+
<ol>
|
|
11
|
+
<li><a href="#nw-breadcrumbs">Home</a></li>
|
|
12
|
+
<li><a href="#nw-breadcrumbs">Docs</a></li>
|
|
13
|
+
<li><a href="#nw-breadcrumbs">Components</a></li>
|
|
14
|
+
<li aria-current="page">Breadcrumbs</li>
|
|
15
|
+
</ol>
|
|
16
|
+
</nav>
|
|
17
|
+
<nav class="nw-breadcrumbs nw-breadcrumbs-chevron" aria-label="Breadcrumb with chevrons">
|
|
18
|
+
<ol>
|
|
19
|
+
<li><a href="#nw-breadcrumbs">Home</a></li>
|
|
20
|
+
<li><span class="nw-breadcrumbs-ellipsis" aria-label="More">...</span></li>
|
|
21
|
+
<li><a href="#nw-breadcrumbs">Overlays</a></li>
|
|
22
|
+
<li aria-current="page">Chevron separators</li>
|
|
23
|
+
</ol>
|
|
24
|
+
</nav>
|
|
25
|
+
<nav class="nw-breadcrumbs nw-breadcrumbs-dot nw-breadcrumbs-sm" aria-label="Breadcrumb with dots, small">
|
|
26
|
+
<ol>
|
|
27
|
+
<li><a href="#nw-breadcrumbs">Home</a></li>
|
|
28
|
+
<li><a href="#nw-breadcrumbs">Dot separators</a></li>
|
|
29
|
+
<li aria-current="page">Small</li>
|
|
30
|
+
</ol>
|
|
31
|
+
</nav>
|
|
32
|
+
<nav class="nw-breadcrumbs nw-breadcrumbs-lg" aria-label="Breadcrumb with custom separators, large">
|
|
33
|
+
<ol>
|
|
34
|
+
<li><a href="#nw-breadcrumbs">Home</a></li>
|
|
35
|
+
<li class="nw-breadcrumbs-separator" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 6l6 6-6 6"/></svg></li>
|
|
36
|
+
<li><a href="#nw-breadcrumbs">Custom separator</a></li>
|
|
37
|
+
<li class="nw-breadcrumbs-separator" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 6l6 6-6 6"/></svg></li>
|
|
38
|
+
<li aria-current="page">Large</li>
|
|
39
|
+
</ol>
|
|
40
|
+
</nav>
|
|
41
|
+
<nav class="nw-breadcrumbs nw-breadcrumbs-eyebrow nw-breadcrumbs-secondary" aria-label="Breadcrumb as eyebrow">
|
|
42
|
+
<ol>
|
|
43
|
+
<li><a href="#nw-breadcrumbs">Grid</a></li>
|
|
44
|
+
<li><a href="#nw-breadcrumbs">Sector 7</a></li>
|
|
45
|
+
<li aria-current="page">Uplink</li>
|
|
46
|
+
</ol>
|
|
47
|
+
</nav>
|
|
48
|
+
</div>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
| Class / selector | Effect |
|
|
52
|
+
| -------------------------------------- | -------------------------------------------------------------------------------------------------------- |
|
|
53
|
+
| `nw-breadcrumbs` | The nav wrapper; slash separators. |
|
|
54
|
+
| `nw-breadcrumbs-chevron` | Chevron separators, painted through a mask. |
|
|
55
|
+
| `nw-breadcrumbs-arrow` | Arrow separators. |
|
|
56
|
+
| `nw-breadcrumbs-dot` | Dot separators. |
|
|
57
|
+
| `nw-breadcrumbs-separator` | An `<li>` that renders its own separator; the automatic one is turned off. Mark it `aria-hidden="true"`. |
|
|
58
|
+
| `nw-breadcrumbs-icon` | Icon slot inside a link; mark it `aria-hidden`. |
|
|
59
|
+
| `nw-breadcrumbs-ellipsis` | Truncation marker for collapsed levels; give it an `aria-label`. |
|
|
60
|
+
| `nw-breadcrumbs-eyebrow` | Uppercase mono, for use as a page-header eyebrow. |
|
|
61
|
+
| `nw-breadcrumbs-xs` ... `-lg` | Type sizes. |
|
|
62
|
+
| `nw-breadcrumbs-primary` ... `-danger` | The current crumb's ink. |
|
|
63
|
+
| `[aria-current="page"]` | The current item, also when it is the link inside it. |
|
|
64
|
+
| `:focus-visible` | Focus ring on links. |
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
# Buttons
|
|
2
|
+
|
|
3
|
+
> The nw-btn classes for plain HTML - variants, intents, sizes, icon-only, block and grouped buttons, the cut, wire and glow motifs, and the pressed, busy and disabled states.
|
|
4
|
+
|
|
5
|
+
`.nw-btn` is the one button class. Intent, variant, size and motif are separate modifiers that compose, so `nw-btn nw-btn-outline nw-btn-danger nw-btn-sm` is an outlined, small, danger button. With no modifiers you get a **solid, primary, medium** button.
|
|
6
|
+
|
|
7
|
+
Always set `type="button"` on a `<button>` that is not meant to submit a form. The same classes work on an `<a>` for navigation.
|
|
8
|
+
|
|
9
|
+
## Variants
|
|
10
|
+
|
|
11
|
+
```html
|
|
12
|
+
<div class="nw-cluster">
|
|
13
|
+
<button type="button" class="nw-btn nw-btn-solid">Solid</button>
|
|
14
|
+
<button type="button" class="nw-btn nw-btn-soft">Soft</button>
|
|
15
|
+
<button type="button" class="nw-btn nw-btn-outline">Outline</button>
|
|
16
|
+
<button type="button" class="nw-btn nw-btn-ghost">Ghost</button>
|
|
17
|
+
<button type="button" class="nw-btn nw-btn-link">Link</button>
|
|
18
|
+
</div>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
| Class | Effect |
|
|
22
|
+
| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
23
|
+
| `nw-btn` | Base button: layout, type, hairline border, focus ring. Defaults to solid, primary, medium. |
|
|
24
|
+
| `nw-btn-solid` | Filled with the intent color and its on-accent ink (the default). |
|
|
25
|
+
| `nw-btn-soft` | A tinted wash of the intent. The text mixes the intent with the foreground so it stays AA on the tint. |
|
|
26
|
+
| `nw-btn-outline` | Transparent, with a full-strength intent border; the text is the intent color, which keeps 4.5:1 on plain surfaces in every flavor. On hover it takes the soft tint. |
|
|
27
|
+
| `nw-btn-ghost` | No fill or border until hover. Its bloom goes to the text, not a halo. |
|
|
28
|
+
| `nw-btn-link` | Underlined text without padding or fixed height; it glows in its text on hover. |
|
|
29
|
+
|
|
30
|
+
## Intents
|
|
31
|
+
|
|
32
|
+
An intent class sets the color the variant uses.
|
|
33
|
+
|
|
34
|
+
```html
|
|
35
|
+
<div class="nw-cluster">
|
|
36
|
+
<button type="button" class="nw-btn nw-btn-primary">Primary</button>
|
|
37
|
+
<button type="button" class="nw-btn nw-btn-secondary">Secondary</button>
|
|
38
|
+
<button type="button" class="nw-btn nw-btn-tertiary">Tertiary</button>
|
|
39
|
+
<button type="button" class="nw-btn nw-btn-neutral">Neutral</button>
|
|
40
|
+
<button type="button" class="nw-btn nw-btn-info">Info</button>
|
|
41
|
+
<button type="button" class="nw-btn nw-btn-success">Success</button>
|
|
42
|
+
<button type="button" class="nw-btn nw-btn-warning">Warning</button>
|
|
43
|
+
<button type="button" class="nw-btn nw-btn-danger">Danger</button>
|
|
44
|
+
</div>
|
|
45
|
+
<div class="nw-cluster">
|
|
46
|
+
<button type="button" class="nw-btn nw-btn-outline nw-btn-danger">Outline danger</button>
|
|
47
|
+
<button type="button" class="nw-btn nw-btn-soft nw-btn-success">Soft success</button>
|
|
48
|
+
<button type="button" class="nw-btn nw-btn-ghost nw-btn-info">Ghost info</button>
|
|
49
|
+
<button type="button" class="nw-btn nw-btn-soft nw-btn-neutral">Soft neutral</button>
|
|
50
|
+
</div>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
| Class | Color |
|
|
54
|
+
| ------------------ | -------------------------------------------------------------------------------------------------------------------- |
|
|
55
|
+
| `nw-btn-primary` | The active accent: indigo, or the accent named by the nearest `data-accent` (default). |
|
|
56
|
+
| `nw-btn-secondary` | Synth. |
|
|
57
|
+
| `nw-btn-tertiary` | Ice. |
|
|
58
|
+
| `nw-btn-neutral` | The foreground ink. A solid neutral button is a quiet inverted one; its other variants stay readable on any surface. |
|
|
59
|
+
| `nw-btn-info` | Arc. |
|
|
60
|
+
| `nw-btn-success` | Matrix. |
|
|
61
|
+
| `nw-btn-warning` | Volt. |
|
|
62
|
+
| `nw-btn-danger` | Alarm. |
|
|
63
|
+
|
|
64
|
+
## Sizes
|
|
65
|
+
|
|
66
|
+
```html
|
|
67
|
+
<div class="nw-cluster">
|
|
68
|
+
<button type="button" class="nw-btn nw-btn-xs">Extra small</button>
|
|
69
|
+
<button type="button" class="nw-btn nw-btn-sm">Small</button>
|
|
70
|
+
<button type="button" class="nw-btn nw-btn-md">Medium</button>
|
|
71
|
+
<button type="button" class="nw-btn nw-btn-lg">Large</button>
|
|
72
|
+
</div>
|
|
73
|
+
<div class="nw-cluster">
|
|
74
|
+
<button type="button" class="nw-btn nw-btn-outline nw-btn-sm">
|
|
75
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13 2 3 14h9l-1 8 10-12h-9l1-8z"/></svg>
|
|
76
|
+
Boost uplink
|
|
77
|
+
</button>
|
|
78
|
+
<button type="button" class="nw-btn nw-btn-soft">
|
|
79
|
+
Deploy
|
|
80
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14M13 6l6 6-6 6"/></svg>
|
|
81
|
+
</button>
|
|
82
|
+
</div>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
| Class | Height | Horizontal padding | Type | Radius |
|
|
86
|
+
| ----------- | ------- | ------------------ | ----------------- | ------ |
|
|
87
|
+
| `nw-btn-xs` | 1.75rem | 0.625rem | text-xs | sm |
|
|
88
|
+
| `nw-btn-sm` | 2rem | 0.75rem | text-sm | sm |
|
|
89
|
+
| `nw-btn-md` | 2.5rem | 1rem | text-sm (default) | md |
|
|
90
|
+
| `nw-btn-lg` | 3rem | 1.25rem | text-base | lg |
|
|
91
|
+
|
|
92
|
+
A direct child `<svg>` is sized and spaced by the button and inherits the text color; put it before or after the label.
|
|
93
|
+
|
|
94
|
+
## Icon-only, block and grouped
|
|
95
|
+
|
|
96
|
+
`nw-btn-icon` makes the button square (its width equals the size's height). An icon-only button has no text, so it needs an `aria-label`.
|
|
97
|
+
|
|
98
|
+
```html
|
|
99
|
+
<div class="nw-cluster">
|
|
100
|
+
<button type="button" class="nw-btn nw-btn-icon nw-btn-xs" aria-label="Add node"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M5 12h14M12 5v14"/></svg></button>
|
|
101
|
+
<button type="button" class="nw-btn nw-btn-icon nw-btn-sm nw-btn-soft" aria-label="Add node"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M5 12h14M12 5v14"/></svg></button>
|
|
102
|
+
<button type="button" class="nw-btn nw-btn-icon nw-btn-outline" aria-label="Add node"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M5 12h14M12 5v14"/></svg></button>
|
|
103
|
+
<button type="button" class="nw-btn nw-btn-icon nw-btn-lg nw-btn-ghost nw-btn-neutral" aria-label="Close"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M18 6 6 18M6 6l12 12"/></svg></button>
|
|
104
|
+
<button type="button" class="nw-btn nw-btn-icon nw-btn-soft nw-btn-danger" aria-label="Delete node"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 7h16M10 11v6M14 11v6M6 7l1 13h10l1-13M9 7V4h6v3"/></svg></button>
|
|
105
|
+
</div>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
`nw-btn-block` stretches a button to the width of its container. `nw-btn-group` joins adjacent buttons into one segmented control: inner corners square off, borders collapse and joined solid buttons keep a visible seam. Put `role="group"` and an `aria-label` on it; `aria-pressed` marks the held segment.
|
|
109
|
+
|
|
110
|
+
```html
|
|
111
|
+
<div class="nw-stack">
|
|
112
|
+
<button type="button" class="nw-btn nw-btn-block nw-btn-secondary">Block button</button>
|
|
113
|
+
<div class="nw-cluster">
|
|
114
|
+
<div class="nw-btn-group" role="group" aria-label="Range">
|
|
115
|
+
<button type="button" class="nw-btn" aria-pressed="true">Day</button>
|
|
116
|
+
<button type="button" class="nw-btn" aria-pressed="false">Week</button>
|
|
117
|
+
<button type="button" class="nw-btn" aria-pressed="false">Month</button>
|
|
118
|
+
</div>
|
|
119
|
+
<div class="nw-btn-group" role="group" aria-label="Alignment">
|
|
120
|
+
<button type="button" class="nw-btn nw-btn-outline nw-btn-sm">Left</button>
|
|
121
|
+
<button type="button" class="nw-btn nw-btn-outline nw-btn-sm">Center</button>
|
|
122
|
+
<button type="button" class="nw-btn nw-btn-outline nw-btn-sm">Right</button>
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
| Class | Effect |
|
|
129
|
+
| -------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
|
130
|
+
| `nw-btn-icon` | Square, icon-only button. |
|
|
131
|
+
| `nw-btn-block` | Full-width button. |
|
|
132
|
+
| `nw-btn-group` | Container that joins child `.nw-btn` elements; the hovered or focused one rises above its neighbors so its ring shows. |
|
|
133
|
+
|
|
134
|
+
## Cut, wire and glow
|
|
135
|
+
|
|
136
|
+
The Nyxwire motifs are opt-in modifiers. `nw-btn-cut` chamfers the top-right and bottom-left corners by `--nw-cut`; the chamfer is painted, not clipped, so a glow follows it through a `drop-shadow` filter. `nw-btn-wire` draws the indigo-to-synth gradient edge over an opaque fill; on a cut button the wire becomes the chamfered edge. `nw-btn-glow` keeps a medium bloom on at rest instead of only on hover.
|
|
137
|
+
|
|
138
|
+
```html
|
|
139
|
+
<div class="nw-cluster">
|
|
140
|
+
<button type="button" class="nw-btn nw-btn-cut">Cut</button>
|
|
141
|
+
<button type="button" class="nw-btn nw-btn-cut nw-btn-glow">Cut and glow</button>
|
|
142
|
+
<button type="button" class="nw-btn nw-btn-cut nw-btn-outline nw-btn-secondary">Cut outline</button>
|
|
143
|
+
<button type="button" class="nw-btn nw-btn-wire nw-btn-ghost">Wire</button>
|
|
144
|
+
<button type="button" class="nw-btn nw-btn-wire nw-btn-cut nw-btn-soft">Wire and cut</button>
|
|
145
|
+
<button type="button" class="nw-btn nw-btn-glow nw-btn-success">Glow success</button>
|
|
146
|
+
</div>
|
|
147
|
+
<div class="nw-cluster">
|
|
148
|
+
<button type="button" class="nw-btn nw-btn-cut nw-btn-lg" style="--nw-cut: 16px">Custom --nw-cut</button>
|
|
149
|
+
</div>
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
| Class / property | Effect |
|
|
153
|
+
| ---------------- | --------------------------------------------------------------------------------------------------------- |
|
|
154
|
+
| `nw-btn-cut` | Chamfered corners. The cut size scales with the button size (8px up to sm, 10px at md, 12px at lg). |
|
|
155
|
+
| `nw-btn-wire` | Gradient edge from primary to secondary. The state rules that swap the border color cannot erase it. |
|
|
156
|
+
| `nw-btn-glow` | A resting neon bloom in the intent color. On a cut button it is a `drop-shadow` that follows the chamfer. |
|
|
157
|
+
| `--nw-cut` | Set inline to override the chamfer of one button, for example `style="--nw-cut: 16px"`. |
|
|
158
|
+
|
|
159
|
+
## States
|
|
160
|
+
|
|
161
|
+
The CSS keys on these attributes and pseudo-classes; there are no state classes. Every state only swaps the button's paint, so its height, padding and width never change.
|
|
162
|
+
|
|
163
|
+
```html
|
|
164
|
+
<div class="nw-cluster">
|
|
165
|
+
<button type="button" class="nw-btn" disabled>Disabled</button>
|
|
166
|
+
<button type="button" class="nw-btn nw-btn-soft" aria-disabled="true">aria-disabled</button>
|
|
167
|
+
<button type="button" class="nw-btn nw-btn-outline" disabled>Disabled outline</button>
|
|
168
|
+
</div>
|
|
169
|
+
<div class="nw-cluster">
|
|
170
|
+
<button type="button" class="nw-btn" aria-busy="true"><span>Saving</span></button>
|
|
171
|
+
<button type="button" class="nw-btn nw-btn-soft nw-btn-info" aria-busy="true"><span>Loading</span></button>
|
|
172
|
+
<button type="button" class="nw-btn nw-btn-outline nw-btn-success" aria-busy="true"><span>Syncing</span></button>
|
|
173
|
+
</div>
|
|
174
|
+
<div class="nw-cluster">
|
|
175
|
+
<button type="button" class="nw-btn nw-btn-outline" aria-pressed="true">Pressed (aria-pressed)</button>
|
|
176
|
+
<button type="button" class="nw-btn nw-btn-ghost nw-btn-neutral" aria-pressed="false">Not pressed</button>
|
|
177
|
+
<button type="button" class="nw-btn nw-btn-soft" aria-expanded="true">Expanded trigger</button>
|
|
178
|
+
</div>
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
| Selector | Effect |
|
|
182
|
+
| ----------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
183
|
+
| `:hover` | A small bloom plus the variant's hover paint: solid lightens, outline takes the soft tint, ghost the raised panel fill. Not applied to disabled, `aria-disabled` or busy buttons. |
|
|
184
|
+
| `[aria-expanded="true"]`, `[data-state="open"]` | A trigger whose popup is open keeps its hover paint. |
|
|
185
|
+
| `:active` | The pressed fill, and the bloom drops. Under reduced motion the press does not move. |
|
|
186
|
+
| `[aria-pressed="true"]`, `[aria-checked="true"]`, `[aria-selected="true"]`, `[data-state="on"]` | Held on: the pressed fill survives the pointer leaving, for toggle buttons and segmented groups. |
|
|
187
|
+
| `:focus-visible` | The 2px `--nw-ring` focus ring, offset 2px. It is drawn outside the chamfer on a cut button. |
|
|
188
|
+
| `:disabled` | Quiet fill and ink, `not-allowed` cursor, no pointer feedback. |
|
|
189
|
+
| `[aria-disabled="true"]` | The same look for an element that must stay focusable. Block the action yourself; the attribute does not stop clicks. |
|
|
190
|
+
| `[aria-busy="true"]` | Loading: the label keeps its slot but is hidden, a ring spins over it and pointer input is ignored. Wrap the text in a child element such as a `<span>`. |
|
|
191
|
+
|
|
192
|
+
## Accessibility
|
|
193
|
+
|
|
194
|
+
- Use `<button>` for actions and `<a href>` for navigation, even when they look the same.
|
|
195
|
+
- Prefer `aria-busy="true"` to swapping the label for a spinner: the button keeps its width and its accessible name.
|
|
196
|
+
- In forced-colors mode the cut and wire paint fall back to a system-colored box with a real border, and held states use `Highlight`.
|
|
197
|
+
- The Vue `NwButton` shares this spec; see [the Vue components](https://nyxwire.dissidence.ovh/vue/).
|