@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.
Files changed (134) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +133 -2
  3. package/dist/base.css +850 -0
  4. package/dist/components.css +10508 -0
  5. package/dist/docs/components/accordion.md +83 -0
  6. package/dist/docs/components/alert.md +52 -0
  7. package/dist/docs/components/avatar.md +55 -0
  8. package/dist/docs/components/badge.md +64 -0
  9. package/dist/docs/components/breadcrumbs.md +64 -0
  10. package/dist/docs/components/button.md +197 -0
  11. package/dist/docs/components/card.md +103 -0
  12. package/dist/docs/components/checkbox.md +45 -0
  13. package/dist/docs/components/chip.md +30 -0
  14. package/dist/docs/components/cluster.md +33 -0
  15. package/dist/docs/components/code.md +65 -0
  16. package/dist/docs/components/container.md +24 -0
  17. package/dist/docs/components/dialog.md +199 -0
  18. package/dist/docs/components/divider.md +31 -0
  19. package/dist/docs/components/dl.md +24 -0
  20. package/dist/docs/components/effect-utilities.md +82 -0
  21. package/dist/docs/components/empty.md +40 -0
  22. package/dist/docs/components/frame.md +27 -0
  23. package/dist/docs/components/grid.md +31 -0
  24. package/dist/docs/components/hud.md +75 -0
  25. package/dist/docs/components/input-group.md +28 -0
  26. package/dist/docs/components/input.md +52 -0
  27. package/dist/docs/components/kbd.md +42 -0
  28. package/dist/docs/components/label-and-field.md +31 -0
  29. package/dist/docs/components/link.md +41 -0
  30. package/dist/docs/components/list.md +67 -0
  31. package/dist/docs/components/menu.md +85 -0
  32. package/dist/docs/components/meter.md +77 -0
  33. package/dist/docs/components/navbar.md +66 -0
  34. package/dist/docs/components/pagination.md +64 -0
  35. package/dist/docs/components/popover.md +59 -0
  36. package/dist/docs/components/progress.md +32 -0
  37. package/dist/docs/components/prose.md +29 -0
  38. package/dist/docs/components/select.md +51 -0
  39. package/dist/docs/components/sidebar.md +35 -0
  40. package/dist/docs/components/sidenav.md +45 -0
  41. package/dist/docs/components/skeleton.md +36 -0
  42. package/dist/docs/components/slider.md +32 -0
  43. package/dist/docs/components/spinner.md +30 -0
  44. package/dist/docs/components/stack.md +26 -0
  45. package/dist/docs/components/steps.md +49 -0
  46. package/dist/docs/components/switch.md +19 -0
  47. package/dist/docs/components/table.md +83 -0
  48. package/dist/docs/components/tabs.md +207 -0
  49. package/dist/docs/components/textarea.md +13 -0
  50. package/dist/docs/components/toast.md +86 -0
  51. package/dist/docs/components/tooltip.md +39 -0
  52. package/dist/docs/components/typography-classes.md +38 -0
  53. package/dist/docs/families/data-display.md +15 -0
  54. package/dist/docs/families/feedback.md +13 -0
  55. package/dist/docs/families/forms.md +141 -0
  56. package/dist/docs/families/layout-typography.md +17 -0
  57. package/dist/docs/families/navigation.md +13 -0
  58. package/dist/docs/families/overlays.md +13 -0
  59. package/dist/docs/families/surfaces.md +11 -0
  60. package/dist/docs/foundations/accessibility.md +71 -0
  61. package/dist/docs/foundations/color-roles.md +114 -0
  62. package/dist/docs/foundations/effects-motion.md +150 -0
  63. package/dist/docs/foundations/flavors.md +156 -0
  64. package/dist/docs/foundations/icons.md +45 -0
  65. package/dist/docs/foundations/palette.md +180 -0
  66. package/dist/docs/foundations/spacing-elevation.md +168 -0
  67. package/dist/docs/foundations/typography.md +80 -0
  68. package/dist/docs/index.md +233 -0
  69. package/dist/docs/manifest.json +859 -0
  70. package/dist/fonts/inter-OFL.txt +93 -0
  71. package/dist/fonts/inter-latin-ext-wght-italic.woff2 +0 -0
  72. package/dist/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
  73. package/dist/fonts/inter-latin-wght-italic.woff2 +0 -0
  74. package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
  75. package/dist/fonts/martian-mono-OFL.txt +93 -0
  76. package/dist/fonts/martian-mono-latin-ext-wdth-normal.woff2 +0 -0
  77. package/dist/fonts/martian-mono-latin-wdth-normal.woff2 +0 -0
  78. package/dist/fonts/space-grotesk-OFL.txt +93 -0
  79. package/dist/fonts/space-grotesk-latin-ext-wght-normal.woff2 +0 -0
  80. package/dist/fonts/space-grotesk-latin-wght-normal.woff2 +0 -0
  81. package/dist/fonts.css +73 -0
  82. package/dist/nyxwire.css +12183 -0
  83. package/dist/tokens.css +579 -0
  84. package/dist/utilities.css +176 -0
  85. package/nyxwire.d.ts +2 -0
  86. package/package.json +66 -3
  87. package/skills/nyxwire/SKILL.md +63 -0
  88. package/src/base.css +158 -0
  89. package/src/components/accordion.css +280 -0
  90. package/src/components/alert.css +176 -0
  91. package/src/components/avatar.css +262 -0
  92. package/src/components/badge.css +193 -0
  93. package/src/components/breadcrumbs.css +209 -0
  94. package/src/components/btn.css +517 -0
  95. package/src/components/card.css +327 -0
  96. package/src/components/checkbox.css +202 -0
  97. package/src/components/chip.css +345 -0
  98. package/src/components/code.css +340 -0
  99. package/src/components/dialog.css +411 -0
  100. package/src/components/divider.css +201 -0
  101. package/src/components/empty.css +216 -0
  102. package/src/components/field.css +161 -0
  103. package/src/components/hud.css +212 -0
  104. package/src/components/index.css +50 -0
  105. package/src/components/input.css +383 -0
  106. package/src/components/kbd.css +197 -0
  107. package/src/components/layout.css +344 -0
  108. package/src/components/link.css +178 -0
  109. package/src/components/list.css +353 -0
  110. package/src/components/menu.css +347 -0
  111. package/src/components/meter.css +238 -0
  112. package/src/components/navbar.css +309 -0
  113. package/src/components/pagination.css +302 -0
  114. package/src/components/popover.css +352 -0
  115. package/src/components/progress.css +241 -0
  116. package/src/components/select.css +121 -0
  117. package/src/components/sidenav.css +326 -0
  118. package/src/components/skeleton.css +193 -0
  119. package/src/components/slider.css +201 -0
  120. package/src/components/spinner.css +200 -0
  121. package/src/components/stat.css +263 -0
  122. package/src/components/steps.css +311 -0
  123. package/src/components/switch.css +183 -0
  124. package/src/components/table.css +290 -0
  125. package/src/components/tabs.css +271 -0
  126. package/src/components/toast.css +413 -0
  127. package/src/components/tooltip.css +288 -0
  128. package/src/fonts.css +92 -0
  129. package/src/index.css +6 -0
  130. package/src/motion.css +177 -0
  131. package/src/semantic.css +85 -0
  132. package/src/tokens.css +276 -0
  133. package/src/typography.css +430 -0
  134. package/src/utilities.css +198 -0
@@ -0,0 +1,38 @@
1
+ # Typography classes
2
+
3
+ Part of [Layout and typography](../families/layout-typography.md).
4
+
5
+ Every heading level is one rule shared by the element and its class, so any tag can carry any role. The roles sit in the base layer, below every component, so a component's own type wins.
6
+
7
+ ```html
8
+ <div class="nw-stack nw-stack-sm">
9
+ <p class="nw-eyebrow">Typography</p>
10
+ <h2 class="nw-display">Display</h2>
11
+ <h3 class="nw-h1">Heading 1</h3>
12
+ <h3 class="nw-h2">Heading 2</h3>
13
+ <h3 class="nw-h3">Heading 3</h3>
14
+ <p class="nw-lead">A lead paragraph introduces a page in the muted ink.</p>
15
+ <p class="nw-mono">nw-mono is the Martian Mono face for code, keys and labels.</p>
16
+ <p>
17
+ Text levels: <span class="nw-text-muted">muted</span>,
18
+ <span class="nw-text-subtle">subtle</span>, <span class="nw-text-faint">faint</span>,
19
+ <span class="nw-text-disabled">disabled</span>. Intent inks:
20
+ <span class="nw-text-primary">primary</span>, <span class="nw-text-secondary">secondary</span>,
21
+ <span class="nw-text-tertiary">tertiary</span>, <span class="nw-text-info">info</span>,
22
+ <span class="nw-text-success">success</span>, <span class="nw-text-warning">warning</span>,
23
+ <span class="nw-text-danger">danger</span>.
24
+ </p>
25
+ <p>Pinned sizes: <span class="nw-text-xs">xs</span> <span class="nw-text-sm">sm</span> <span class="nw-text-base">base</span> <span class="nw-text-lg">lg</span> <span class="nw-text-2xl">2xl</span></p>
26
+ </div>
27
+ ```
28
+
29
+ | Class | Effect |
30
+ | ------------------------------------------------- | ------------------------------------------------------------ |
31
+ | `nw-display` | The page headline: a fluid clamp, weight 700, tight leading. |
32
+ | `nw-h1` ... `nw-h6` | The six heading levels, on any element. |
33
+ | `nw-lead` | An intro paragraph: xl, relaxed, muted ink. |
34
+ | `nw-eyebrow` | The mono, uppercase, primary-colored kicker above a heading. |
35
+ | `nw-mono` | The Martian Mono face for code, keys and labels. |
36
+ | `nw-text-2xs` ... `nw-text-7xl` | The type scale, as single-purpose utilities. |
37
+ | `nw-text-muted`, `-subtle`, `-faint`, `-disabled` | The four levels below the default foreground. |
38
+ | `nw-text-primary` ... `-danger` | Intent inks for text. |
@@ -0,0 +1,15 @@
1
+ # Data display
2
+
3
+ > Tables, lists, description lists, keycaps and hotkey hints, inline code and code blocks, avatars and dividers.
4
+
5
+ Data display classes make dense information readable: tabular numerals, mono labels, rows with slots, and inline annotations.
6
+
7
+ ## Components
8
+
9
+ - [.nw-table](../components/table.md): A table is dense data rows with hairline rules, mono column labels and tabular numerals.
10
+ - [.nw-list](../components/list.md): A list is rows of content: `<ul class="nw-list">` of `.nw-list-item` rows, or `<li><a class="nw-list-item">` for navigable rows.
11
+ - [.nw-dl](../components/dl.md): A description list pairs terms with details: terms in the mono eyebrow face beside their details.
12
+ - [.nw-kbd and .nw-hotkey](../components/kbd.md): `nw-kbd` is a keycap; a chord is a `.nw-kbd-combo` of keycaps, with the plus generated between them.
13
+ - [.nw-code and .nw-pre](../components/code.md): `nw-code` marks inline code on a sunken well; it follows the size of its text unless pinned with a size class.
14
+ - [.nw-avatar](../components/avatar.md): An avatar is a rounded slot for a user: an image, initials in the fallback, or an empty bordered slot.
15
+ - [.nw-divider](../components/divider.md): A hairline between regions, on `<hr>` or `div role="separator"`.
@@ -0,0 +1,13 @@
1
+ # Feedback
2
+
3
+ > Alerts, badges, progress bars, meters and stats, spinners, skeletons and empty states - the classes that tell the user what state something is in.
4
+
5
+ ## Components
6
+
7
+ - [.nw-alert](../components/alert.md): An alert is a message with one intent.
8
+ - [.nw-badge](../components/badge.md): A badge is a short status label, not an action.
9
+ - [.nw-progress](../components/progress.md): Progress is task completion toward a known total, or an indeterminate busy bar.
10
+ - [.nw-meter and .nw-stat](../components/meter.md): A meter is a scalar value inside a known range, such as load, capacity or signal: not task progress.
11
+ - [.nw-spinner](../components/spinner.md): A spinner shows pending work with no measurable total: a ring by default, dots or bars as variants.
12
+ - [.nw-skeleton](../components/skeleton.md): A skeleton reserves the shape of content that has not arrived yet.
13
+ - [.nw-empty](../components/empty.md): An empty state explains why there is nothing to show and offers the next step.
@@ -0,0 +1,141 @@
1
+ # Forms
2
+
3
+ > Fields, labels, text inputs, textareas, selects, input groups, checkboxes, radios, switches, sliders and chips, with hints, errors and the native states they key on.
4
+
5
+ Every form class styles the native element, so validation, autofill, keyboard input and assistive technology keep working. Wrap each value in a `nw-field` with a `nw-label`, a control and optional hint and error text.
6
+
7
+ ## Components
8
+
9
+ - [Text inputs: .nw-input](../components/input.md): `nw-input` is the shared well for text controls: `<input>` of any text-like type, `textarea.nw-input` and, through the same paint variables, `nw-select`.
10
+ - [Textarea](../components/textarea.md): There is no separate class: `textarea.nw-input` uses the same well with no fixed height and vertical resizing.
11
+ - [Select: .nw-select](../components/select.md): `nw-select` styles a native `<select>`.
12
+ - [Input group: .nw-input-group](../components/input-group.md): `nw-input-group` joins inputs, selects, buttons and `nw-input-addon` text or icons into one control: inner corners square off and borders collapse.
13
+ - [Checkbox and radio: .nw-checkbox, .nw-radio](../components/checkbox.md): Both are drawn on the native `<input>` from tokens, so `:checked`, `:indeterminate`, `:disabled` and `:focus-visible` keep working and the mark survives forced colors.
14
+ - [Switch: .nw-switch](../components/switch.md): A switch is a checkbox with `role="switch"`, for a setting that applies at once.
15
+ - [Slider: .nw-slider](../components/slider.md): `nw-slider` styles `<input type="range">`, so keys, touch and assistive technology keep working.
16
+ - [Chips: .nw-chip](../components/chip.md): A chip is a filter, a selected value or a removable token.
17
+ - [Label and field](../components/label-and-field.md): Label and field, from the Forms page.
18
+
19
+ ## Native behaviors
20
+
21
+ The controls need no script. The demos use one delegated script for the two things HTML does not do on its own: the indeterminate checkbox state, which only exists as a DOM property (`data-indeterminate` in the demo), and the slider fill (`--_slider-value`, mirrored into an `<output for>`).
22
+
23
+ ```js title="native-behaviors.js"
24
+ // Native behaviors for the plain-HTML component demos. The nw-* classes need none of this; it only
25
+ // wires the platform features and the documented state attributes the markup relies on.
26
+ export function bindNativeBehaviors() {
27
+ document.addEventListener('click', (event) => {
28
+ const target = event.target
29
+ if (!(target instanceof Element)) return
30
+
31
+ // [data-open="#id"] opens a modal <dialog>; [data-close] closes the dialog it sits in.
32
+ const opener = target.closest('[data-open]')
33
+ if (opener) {
34
+ const dialog = document.querySelector(opener.getAttribute('data-open'))
35
+ if (dialog instanceof HTMLDialogElement && !dialog.open) dialog.showModal()
36
+ return
37
+ }
38
+ const closer = target.closest('[data-close]')
39
+ if (closer) {
40
+ closer.closest('dialog')?.close()
41
+ return
42
+ }
43
+
44
+ // [data-toggle="#id"] flips aria-expanded on the trigger and data-state on the target, the
45
+ // contract of the navbar collapse region and of collapsible sidenav groups.
46
+ const toggle = target.closest('[data-toggle]')
47
+ if (toggle) {
48
+ const region = document.querySelector(toggle.getAttribute('data-toggle'))
49
+ const open = toggle.getAttribute('aria-expanded') !== 'true'
50
+ toggle.setAttribute('aria-expanded', String(open))
51
+ region?.setAttribute('data-state', open ? 'open' : 'closed')
52
+ return
53
+ }
54
+
55
+ // [data-toast="#template"] stamps the template's toast into the region that holds the template;
56
+ // [data-dismiss] plays the toast's exit (data-state="closed") and removes it once it ends.
57
+ const notifier = target.closest('[data-toast]')
58
+ if (notifier) {
59
+ const template = document.querySelector(notifier.getAttribute('data-toast'))
60
+ if (template instanceof HTMLTemplateElement) {
61
+ template.parentElement?.append(template.content.cloneNode(true))
62
+ }
63
+ return
64
+ }
65
+ const toast = target.closest('[data-dismiss]')?.closest('.nw-toast')
66
+ if (toast) {
67
+ toast.setAttribute('data-state', 'closed')
68
+ Promise.all(toast.getAnimations().map((animation) => animation.finished)).then(() =>
69
+ toast.remove(),
70
+ )
71
+ }
72
+ })
73
+
74
+ // Range inputs: WebKit and Blink have no progress pseudo-element, so the fill reads
75
+ // --_slider-value. An <output for="id"> mirrors the value.
76
+ const paintSlider = (slider) => {
77
+ const min = Number(slider.min || 0)
78
+ const max = Number(slider.max || 100)
79
+ const percent = ((Number(slider.value) - min) / (max - min)) * 100
80
+ slider.style.setProperty('--_slider-value', `${percent}%`)
81
+ for (const output of document.querySelectorAll('output')) {
82
+ if (output.htmlFor.contains(slider.id)) output.value = slider.value
83
+ }
84
+ }
85
+ for (const slider of document.querySelectorAll('input.nw-slider')) paintSlider(slider)
86
+ document.addEventListener('input', (event) => {
87
+ if (event.target instanceof HTMLInputElement && event.target.matches('.nw-slider'))
88
+ paintSlider(event.target)
89
+ })
90
+
91
+ // Tab lists: click and arrow keys move selection (roving tabindex), Home and End jump.
92
+ for (const tabs of document.querySelectorAll('[data-tabs]')) {
93
+ const list = tabs.querySelector('[role="tablist"]')
94
+ if (!list) continue
95
+ const vertical = list.getAttribute('aria-orientation') === 'vertical'
96
+ const enabledTabs = () => [...list.querySelectorAll('[role="tab"]:not(:disabled)')]
97
+
98
+ const select = (tab, focus) => {
99
+ for (const item of list.querySelectorAll('[role="tab"]')) {
100
+ const selected = item === tab
101
+ item.setAttribute('aria-selected', String(selected))
102
+ item.tabIndex = selected ? 0 : -1
103
+ const panel = document.getElementById(item.getAttribute('aria-controls'))
104
+ if (panel) panel.hidden = !selected
105
+ }
106
+ if (focus) tab.focus()
107
+ }
108
+
109
+ list.addEventListener('click', (event) => {
110
+ const tab = event.target instanceof Element ? event.target.closest('[role="tab"]') : null
111
+ if (tab && !tab.disabled) select(tab, false)
112
+ })
113
+
114
+ list.addEventListener('keydown', (event) => {
115
+ const all = enabledTabs()
116
+ const index = all.indexOf(document.activeElement)
117
+ if (index < 0) return
118
+ const previousKey = vertical ? 'ArrowUp' : 'ArrowLeft'
119
+ const nextKey = vertical ? 'ArrowDown' : 'ArrowRight'
120
+ let next
121
+ if (event.key === nextKey) next = all[(index + 1) % all.length]
122
+ else if (event.key === previousKey) next = all[(index - 1 + all.length) % all.length]
123
+ else if (event.key === 'Home') next = all[0]
124
+ else if (event.key === 'End') next = all[all.length - 1]
125
+ if (!next) return
126
+ event.preventDefault()
127
+ select(next, true)
128
+ })
129
+ }
130
+
131
+ // The indeterminate state of a checkbox has no attribute; it is a DOM property.
132
+ for (const box of document.querySelectorAll('[data-indeterminate]')) box.indeterminate = true
133
+ }
134
+ ```
135
+
136
+ ## Accessibility
137
+
138
+ - Every control needs a name: a `<label for>`, a wrapping `nw-label`, or `aria-label` when there is no visible text.
139
+ - When a control is invalid, set `aria-invalid="true"` and add the error's id to its `aria-describedby`; the field shows the error and colors the label.
140
+ - `:user-invalid` styles a control only after the user has interacted with it, so required fields do not start red.
141
+ - In forced-colors mode every well, mark and thumb keeps a system-colored border.
@@ -0,0 +1,17 @@
1
+ # Layout and typography
2
+
3
+ > Container, stack, cluster, grid, sidebar, center, frame and shell layout classes, the typography roles, the prose container, and the Nyxwire motif utilities.
4
+
5
+ Layout primitives only place boxes: the gaps and widths come from the space tokens, and each takes a public `--nw-*` input where a measure has to vary per page. The typography roles and the motif utilities finish the page.
6
+
7
+ ## Components
8
+
9
+ - [.nw-container](../components/container.md): A centered column with gutters.
10
+ - [.nw-stack and .nw-spacer](../components/stack.md): `nw-stack` is a column of boxes.
11
+ - [.nw-cluster](../components/cluster.md): `nw-cluster` is a wrapping row of boxes: controls, chips, metadata.
12
+ - [.nw-grid](../components/grid.md): `nw-grid` lays out as many equal columns as fit `--nw-grid-min` (16rem by default); a fixed count folds on narrow screens.
13
+ - [.nw-sidebar and .nw-center](../components/sidebar.md): `nw-sidebar` is a fixed-measure aside beside content that takes the rest, stacking when the content would fall under half the width.
14
+ - [.nw-frame and .nw-shell](../components/frame.md): A frame is a box with a fixed ratio whose media covers it.
15
+ - [Typography classes](../components/typography-classes.md): Every heading level is one rule shared by the element and its class, so any tag can carry any role.
16
+ - [.nw-prose](../components/prose.md): `nw-prose` gives bare elements their rhythm for long-form content: heading levels, list markers in the primary ink, blockquotes with hairlines, code on a well, tables with rules.
17
+ - [Effect utilities](../components/effect-utilities.md): The signature motifs, as standalone utilities.
@@ -0,0 +1,13 @@
1
+ # Navigation
2
+
3
+ > Tabs, breadcrumbs, pagination, links, navbars, sidenavs and steps - the classes for moving through an interface, with the ARIA attributes they key on.
4
+
5
+ ## Components
6
+
7
+ - [.nw-tabs](../components/tabs.md): Tabs follow the WAI-ARIA tabs pattern: a `role="tablist"` of `role="tab"` buttons and one `role="tabpanel"` per tab.
8
+ - [.nw-breadcrumbs](../components/breadcrumbs.md): Breadcrumbs are a `<nav aria-label="Breadcrumb">` around an ordered list.
9
+ - [.nw-pagination](../components/pagination.md): Pagination is a `<nav aria-label="Pagination">` around a list.
10
+ - [.nw-link](../components/link.md): `nw-link` styles an inline link: primary ink, an underline that brightens on hover.
11
+ - [.nw-navbar](../components/navbar.md): The navbar is the top bar of an app shell: a brand, a link row and actions, with a toggle that opens the region under 48rem.
12
+ - [.nw-sidenav](../components/sidenav.md): The sidenav is the vertical navigation of an app shell: sections with labels, links with icons and counts, collapsible groups, a header and a footer.
13
+ - [.nw-steps](../components/steps.md): Steps show where a user is in a sequence.
@@ -0,0 +1,13 @@
1
+ # Overlays
2
+
3
+ > Dialogs and drawers on native dialog, popovers and menus on the Popover API, tooltips and toasts - the floating layer of the system.
4
+
5
+ Overlays float above the page. Nyxwire puts every one of them on a platform feature first: the native `<dialog>`, the Popover API, or a positioned box you drive from a headless library. The classes also accept the `data-state` markup that Reka UI and Radix render, which is how the Vue components reuse the same spec.
6
+
7
+ ## Components
8
+
9
+ - [.nw-dialog](../components/dialog.md): `nw-dialog` styles a native `<dialog>`.
10
+ - [.nw-popover](../components/popover.md): `nw-popover` styles an element with the `popover` attribute.
11
+ - [.nw-menu](../components/menu.md): `nw-menu` is a list of commands.
12
+ - [.nw-tooltip](../components/tooltip.md): There are two tooltips, for two kinds of control.
13
+ - [.nw-toast](../components/toast.md): A toast is a transient message.
@@ -0,0 +1,11 @@
1
+ # Surfaces
2
+
3
+ > Cards, HUD panels and accordions - the containers that group content - with their parts, variants, motifs and states.
4
+
5
+ Surfaces group content. Each one is a single padded box with optional parts, and each takes the Nyxwire motifs as opt-in modifiers: `-cut` for chamfered corners, `-wire` for the gradient edge and `-glow` for a neon bloom.
6
+
7
+ ## Components
8
+
9
+ - [.nw-card](../components/card.md): A card is one padded surface with a grid gap, so content can go straight in without a body wrapper.
10
+ - [.nw-hud](../components/hud.md): The HUD panel is a framed readout: a header with a title, a status and actions, a body and a footer.
11
+ - [.nw-accordion](../components/accordion.md): An accordion is a stack of disclosure rows.
@@ -0,0 +1,71 @@
1
+ # Accessibility
2
+
3
+ > The palette's contrast gate with live results, focus rings, keyboard support, reduced motion and forced-colors fallbacks.
4
+
5
+ Nyxwire guarantees what a palette can guarantee: every color meant for text is readable on the backgrounds it is meant for, in every flavor. The rest (focus, keyboard, motion, layout) is built into the components and is yours to keep when you compose them.
6
+
7
+ ## Contrast gate
8
+
9
+ `pnpm check:contrast` runs the palette gate and exits with an error on any failure, so a color that drops below its threshold cannot be released. The table recomputes the WCAG 2.x rules from the published palette when this site is built. Each cell shows the weakest pair the rule covers.
10
+
11
+ _Live example: [Accessibility](https://nyxwire.dissidence.ovh/foundations/accessibility/)._
12
+
13
+ The gate also checks two things the table cannot show:
14
+
15
+ - **Accent separation.** No two accents inside one flavor may come within ΔE<sub>OK</sub> 0.06, so `volt` never reads as `flare` at a different size and `ice` never collapses into `arc`.
16
+ - **Identity.** Every flavor's `base` stays at least 0.03 ΔE<sub>OK</sub> from sixteen popular dark and light themes (Static Bloom, Catppuccin, Rose Pine, Tokyo Night, Dracula, Nord and friends), with 0.045 as an advisory margin. The gate prints APCA Lc values for text roles as information.
17
+
18
+ What follows from the table:
19
+
20
+ - `text` is 7:1 (AAA) on `crust`, `mantle`, `base` and `surface0`, and 4.5:1 on the raised fills; `subtext1` and `subtext0` are body-safe on the page backgrounds.
21
+ - Every accent is AA on `crust`, `mantle`, `base` and `surface0`, so colored text, links and soft badges stay readable in any accent scope.
22
+ - Soft badges and buttons sit on a 16% tint of their own color, so their text mixes the intent with `fg` per flavor (`--nw-soft-ink`: 100% in Abyss, 90% in Nocturne, 75% in Twilight, 70% in Lumen). That keeps them AA on the same four grounds.
23
+ - `on-accent` text is AA on every solid accent fill, which covers solid buttons and badges.
24
+ - `overlay1` (`line-strong`) meets the 3:1 non-text minimum for input borders and control edges; `overlay0` (`line`) is decorative only, and the circuit grid sits on it by design.
25
+
26
+ > **Caution**
27
+ >
28
+ > These are solid-color guarantees. Text over imagery, colors at reduced opacity, and new color
29
+ > pairs need checking where you use them: put text on a solid, glass or cut panel when the backdrop
30
+ > is loud.
31
+
32
+ ## Focus
33
+
34
+ Every focusable element gets a visible ring on keyboard focus: the base layer styles `:focus-visible` with a 2px outline in `--nw-ring` (the primary intent, so it follows `data-accent`) at a 2px offset, and interactive components add their intent glow on top. Tab through these controls to see it:
35
+
36
+ ```html
37
+ <button type="button" class="nw-btn nw-btn-primary">
38
+ Solid
39
+ </button>
40
+ <button type="button" class="nw-btn nw-btn-outline nw-btn-secondary">
41
+ Outline
42
+ </button>
43
+ <a class="nw-link" href="#focus">
44
+ Link
45
+ </a>
46
+ <input class="nw-input" aria-label="Callsign" placeholder="Callsign" />
47
+ ```
48
+
49
+ Tokens: `--nw-ring`, `--nw-ring-width` (2px) and `--nw-ring-offset` (2px). Do not remove the outline; restyle it through the tokens instead.
50
+
51
+ ## Keyboard
52
+
53
+ - **CSS components** build on native elements (`<button>`, `<a>`, `<details>`, `<dialog>`, `<meter>`, the Popover API), so keyboard behavior comes from the browser.
54
+ - **Vue components** wrap [Reka UI](https://reka-ui.com/) primitives: arrow-key roving focus in toolbars and toggle groups, typeahead in lists, Escape to close the topmost overlay, focus trapped inside dialogs and returned to the trigger on close, and the ARIA roles and states each pattern needs.
55
+ - Icon-only buttons need an accessible name: give them `aria-label`.
56
+
57
+ ## Motion
58
+
59
+ Decorative animation stops under `prefers-reduced-motion: reduce`: durations collapse to 0.01ms, loops run once, and `.nw-motion-essential` opts meaning-bearing motion (a spinner for pending work) back in. See [Effects & motion](effects-motion.md#motion).
60
+
61
+ ## Forced colors
62
+
63
+ Under `forced-colors: active` the motif utilities fall back to system colors: cut and wire surfaces become a plain `Canvas` box with a real border, the scanline overlay and circuit grid are removed, and buttons keep their state through `Highlight`/`HighlightText` rather than color. Disabled controls show as `GrayText`.
64
+
65
+ ## Color is never the only signal
66
+
67
+ Intent colors always travel with words or icons: alerts have titles, badges have text, meters show their value, and form errors are written out under the field with `aria-invalid` set. Keep that pairing when you compose your own components.
68
+
69
+ ## Targets
70
+
71
+ Control heights are 1.75rem (`xs`), 2rem (`sm`), 2.5rem (`md`, the default) and 3rem (`lg`), above the 24px WCAG 2.2 minimum. Inputs are 2.5rem tall. On touch layouts, prefer `md` or larger.
@@ -0,0 +1,114 @@
1
+ # Color roles
2
+
3
+ > Semantic color tokens, what each accent means, and the syntax highlighting roles, generated from @nyxwire/palette.
4
+
5
+ Components never reference a raw palette color. They use semantic roles, which resolve to a palette color in the nearest flavor scope. The same names work as CSS variables (`--nw-canvas`) and as Tailwind color keys (`bg-canvas`, `text-fg-muted`, `border-line-strong`). Raw palette keys carry an `nw-` prefix in Tailwind (`bg-nw-indigo`) so the neutral named `base` cannot collide with `text-base`.
6
+
7
+ ## Semantic tokens
8
+
9
+ Generated from `semanticRoles`. The swatches are the token resolved in each flavor.
10
+
11
+ | CSS variable | Tailwind key | Palette | Abyss | Nocturne | Twilight | Lumen |
12
+ | --- | --- | --- | --- | --- | --- | --- |
13
+ | `--nw-canvas` | `canvas` | `base` | `#080720` | `#14093e` | `#271a4b` | `#eae6ff` |
14
+ | `--nw-canvas-subtle` | `canvas-subtle` | `mantle` | `#050419` | `#0e0533` | `#211540` | `#dedaff` |
15
+ | `--nw-canvas-sunken` | `canvas-sunken` | `crust` | `#030312` | `#0a0329` | `#1b1136` | `#d3cefa` |
16
+ | `--nw-panel` | `panel` | `surface0` | `#12122f` | `#1d154c` | `#312457` | `#ddd9ff` |
17
+ | `--nw-panel-hover` | `panel-hover` | `surface1` | `#1b1c3b` | `#272258` | `#3b2f61` | `#d1cdf8` |
18
+ | `--nw-panel-active` | `panel-active` | `surface2` | `#262747` | `#302d60` | `#453b6a` | `#c6c1ef` |
19
+ | `--nw-fg` | `fg` | `text` | `#f0f1f7` | `#f2f3fa` | `#f5f4fa` | `#1f0e47` |
20
+ | `--nw-fg-muted` | `fg-muted` | `subtext1` | `#d0d2dd` | `#d4d4e3` | `#d9d7e4` | `#3d326b` |
21
+ | `--nw-fg-subtle` | `fg-subtle` | `subtext0` | `#aeb0c1` | `#b2b4ca` | `#bab7cd` | `#524a7e` |
22
+ | `--nw-fg-faint` | `fg-faint` | `overlay2` | `#82849b` | `#8b8cab` | `#9793af` | `#686191` |
23
+ | `--nw-fg-disabled` | `fg-disabled` | `overlay1` | `#646781` | `#6c6d93` | `#7c7799` | `#7c76a4` |
24
+ | `--nw-line` | `line` | `overlay0` | `#3e415f` | `#464673` | `#59517a` | `#b0abd9` |
25
+ | `--nw-line-strong` | `line-strong` | `overlay1` | `#646781` | `#6c6d93` | `#7c7799` | `#7c76a4` |
26
+ | `--nw-line-bright` | `line-bright` | `overlay2` | `#82849b` | `#8b8cab` | `#9793af` | `#686191` |
27
+ | `--nw-primary` | `primary` | `indigo` | `#848fff` | `#848fff` | `#848fff` | `#4940d7` |
28
+ | `--nw-secondary` | `secondary` | `synth` | `#ff47d8` | `#ff47d8` | `#ff47d8` | `#a8008b` |
29
+ | `--nw-tertiary` | `tertiary` | `ice` | `#5eddfe` | `#5eddfe` | `#5eddfe` | `#006081` |
30
+ | `--nw-info` | `info` | `arc` | `#4aa9ff` | `#4aa9ff` | `#4aa9ff` | `#0055b6` |
31
+ | `--nw-success` | `success` | `matrix` | `#4bf677` | `#4bf677` | `#4bf677` | `#00680f` |
32
+ | `--nw-warning` | `warning` | `volt` | `#f8e445` | `#f8e445` | `#f8e445` | `#6e5700` |
33
+ | `--nw-danger` | `danger` | `alarm` | `#ff5d7b` | `#ff5d7b` | `#ff5d7b` | `#b6002c` |
34
+ | `--nw-ring` | `ring` | `indigo` | `#848fff` | `#848fff` | `#848fff` | `#4940d7` |
35
+ | `--nw-link` | `link` | `iris` | `#cdc0ff` | `#cdc0ff` | `#cdc0ff` | `#6746a7` |
36
+
37
+ - **Surfaces**: `canvas` is the page; `canvas-subtle` holds sidebars, navigation and inputs; `canvas-sunken` holds app chrome, HUD backdrops and code. `panel` raises cards, menus and popovers, with `panel-hover` and `panel-active` for interaction.
38
+ - **Text**: `fg` for body text, `fg-muted` for secondary text, `fg-subtle` for placeholders, `fg-faint` for icons and comments, `fg-disabled` for disabled controls.
39
+ - **Lines**: `line` for decorative hairlines and the circuit grid, `line-strong` for component boundaries such as input borders (3:1 or better), `line-bright` for emphasis.
40
+ - **Intents**: `primary` (or the `data-accent` choice), `secondary`, `tertiary`, `info`, `success`, `warning`, `danger`. `ring` follows `primary`; `link` stays `iris` so links keep their color under any accent.
41
+
42
+ ## Derived tokens
43
+
44
+ These are built with `color-mix()` in `@nyxwire/css` and have no palette entry of their own.
45
+
46
+ | CSS variable | Value | Tailwind key |
47
+ | -------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
48
+ | `--nw-on-<intent>` | `--nw-on-accent`: text on a solid intent fill (`crust` on dark flavors, `base` on Lumen) | `on-primary`, `on-secondary`, `on-tertiary`, `on-info`, `on-success`, `on-warning`, `on-danger` |
49
+ | `--nw-<intent>-soft` | intent at 16% over transparent | `primary-soft`, `secondary-soft`, `tertiary-soft`, `info-soft`, `success-soft`, `warning-soft`, `danger-soft` |
50
+ | `--nw-soft-ink` | share of the intent in text on its own soft tint, the rest is `fg`: 100% in Abyss, 90% in Nocturne, 75% in Twilight, 70% in Lumen | none (CSS only) |
51
+ | `--nw-selection` | `primary` at 32% | `selection` |
52
+ | `--nw-backdrop` | `shadow-ink` at up to 72%, behind dialogs | `backdrop` |
53
+ | `--nw-glass` | `canvas` at 78%, for panels over imagery | `glass` |
54
+ | `--nw-shadow-ink` | `crust` on dark flavors, `text` on Lumen; the ink of shadows and scrims | `shadow-ink` |
55
+
56
+ ## Accents
57
+
58
+ Every accent passes 4.5:1 on `crust`, `mantle`, `base` and `surface0` in its flavor, so any of them can be used for text. Meanings stay stable across flavors:
59
+
60
+ | Accent | Roles | CSS variable | Tailwind key | Nocturne | Lumen |
61
+ | --- | --- | --- | --- | --- | --- |
62
+ | indigo | `primary`, `ring` | `--nw-indigo` | `nw-indigo` | `#848fff` | `#4940d7` |
63
+ | iris | `link` | `--nw-iris` | `nw-iris` | `#cdc0ff` | `#6746a7` |
64
+ | flux | | `--nw-flux` | `nw-flux` | `#d071ff` | `#8c16c5` |
65
+ | synth | `secondary` | `--nw-synth` | `nw-synth` | `#ff47d8` | `#a8008b` |
66
+ | alarm | `danger` | `--nw-alarm` | `nw-alarm` | `#ff5d7b` | `#b6002c` |
67
+ | flare | | `--nw-flare` | `nw-flare` | `#ff9845` | `#9d3a00` |
68
+ | volt | `warning` | `--nw-volt` | `nw-volt` | `#f8e445` | `#6e5700` |
69
+ | matrix | `success` | `--nw-matrix` | `nw-matrix` | `#4bf677` | `#00680f` |
70
+ | circuit | | `--nw-circuit` | `nw-circuit` | `#17edd5` | `#006558` |
71
+ | ice | `tertiary` | `--nw-ice` | `nw-ice` | `#5eddfe` | `#006081` |
72
+ | arc | `info` | `--nw-arc` | `nw-arc` | `#4aa9ff` | `#0055b6` |
73
+ | steel | | `--nw-steel` | `nw-steel` | `#b5bdd5` | `#4d5976` |
74
+
75
+ ## Syntax roles
76
+
77
+ Generated from `syntaxRoles` and used by the [Expressive Code themes](https://nyxwire.dissidence.ovh/starlight/setup/) of the Starlight plugin. Code backgrounds are `crust`; dark flavors share the token colors.
78
+
79
+ | Role | Palette | Style | Nocturne | Lumen |
80
+ | --- | --- | --- | --- | --- |
81
+ | `keyword` | `flux` | | `#d071ff` | `#8c16c5` |
82
+ | `storage` | `synth` | | `#ff47d8` | `#a8008b` |
83
+ | `modifier` | `synth` | | `#ff47d8` | `#a8008b` |
84
+ | `string` | `matrix` | | `#4bf677` | `#00680f` |
85
+ | `number` | `flare` | | `#ff9845` | `#9d3a00` |
86
+ | `constant` | `flare` | | `#ff9845` | `#9d3a00` |
87
+ | `boolean` | `alarm` | | `#ff5d7b` | `#b6002c` |
88
+ | `null` | `alarm` | | `#ff5d7b` | `#b6002c` |
89
+ | `function` | `arc` | | `#4aa9ff` | `#0055b6` |
90
+ | `method` | `arc` | | `#4aa9ff` | `#0055b6` |
91
+ | `type` | `volt` | | `#f8e445` | `#6e5700` |
92
+ | `class` | `volt` | | `#f8e445` | `#6e5700` |
93
+ | `interface` | `volt` | | `#f8e445` | `#6e5700` |
94
+ | `enum` | `volt` | | `#f8e445` | `#6e5700` |
95
+ | `namespace` | `volt` | | `#f8e445` | `#6e5700` |
96
+ | `variable` | `text` | | `#f2f3fa` | `#1f0e47` |
97
+ | `parameter` | `iris` | | `#cdc0ff` | `#6746a7` |
98
+ | `property` | `ice` | | `#5eddfe` | `#006081` |
99
+ | `tag` | `synth` | | `#ff47d8` | `#a8008b` |
100
+ | `attribute` | `circuit` | | `#17edd5` | `#006558` |
101
+ | `operator` | `circuit` | | `#17edd5` | `#006558` |
102
+ | `punctuation` | `overlay2` | | `#8b8cab` | `#686191` |
103
+ | `comment` | `overlay2` | italic | `#8b8cab` | `#686191` |
104
+ | `regex` | `circuit` | | `#17edd5` | `#006558` |
105
+ | `escape` | `synth` | | `#ff47d8` | `#a8008b` |
106
+ | `decorator` | `synth` | | `#ff47d8` | `#a8008b` |
107
+ | `markup-heading` | `indigo` | | `#848fff` | `#4940d7` |
108
+ | `markup-link` | `iris` | | `#cdc0ff` | `#6746a7` |
109
+ | `inserted` | `matrix` | | `#4bf677` | `#00680f` |
110
+ | `deleted` | `alarm` | | `#ff5d7b` | `#b6002c` |
111
+ | `changed` | `volt` | | `#f8e445` | `#6e5700` |
112
+ | `editor-bg` | `crust` | | `#0a0329` | `#d3cefa` |
113
+ | `selection` | `indigo` | 30% opacity | `#848fff` | `#4940d7` |
114
+ | `line-highlight` | `surface0` | | `#1d154c` | `#ddd9ff` |
@@ -0,0 +1,150 @@
1
+ # Effects & motion
2
+
3
+ > Cut corners, the wire edge, neon glow, scanlines, the circuit grid, glitch, glass, and motion tokens that respect reduced motion.
4
+
5
+ The effects are the identity: cut corners, a wire edge, neon glow, scanlines, a circuit grid and a hover glitch. Use them as accents on a few elements, not as texture for every surface. The examples use the CSS utility classes; the Tailwind equivalents are on [Utilities & variants](https://nyxwire.dissidence.ovh/tailwind/utilities/).
6
+
7
+ ## Glow
8
+
9
+ Glow is a colored shadow built from `--nw-glow-color`, which defaults to the primary intent. Its strength is `--nw-glow-strength`: 1 on the dark flavors, 0.45 on Lumen, where a full glow would smudge.
10
+
11
+ ```html
12
+ <div class="nw-docs-tile nw-docs-tile-neon nw-glow-sm">
13
+ nw-glow-sm <code>--nw-glow-sm</code>
14
+ </div>
15
+ <div class="nw-docs-tile nw-docs-tile-neon nw-glow-md">
16
+ nw-glow-md <code>--nw-glow-md</code>
17
+ </div>
18
+ <div class="nw-docs-tile nw-docs-tile-neon nw-glow-lg">
19
+ nw-glow-lg <code>--nw-glow-lg</code>
20
+ </div>
21
+ <div class="nw-docs-tile nw-docs-tile-neon nw-glow-md nw-glow-info">nw-glow-info</div>
22
+ <div class="nw-docs-tile nw-docs-tile-neon nw-glow-md nw-glow-success">nw-glow-success</div>
23
+ <div class="nw-docs-tile nw-docs-tile-neon nw-glow-md nw-glow-danger">nw-glow-danger</div>
24
+ ```
25
+
26
+ Pick a color with `.nw-glow-<intent>` (the seven intents), or set `--nw-glow-color` yourself. In Tailwind, `glow-<color>` accepts every palette and semantic color (`glow-matrix`, `glow-info`), and `text-glow` / `text-glow-<color>` put the same bloom on text. The glow tokens are declared on every element, so changing the color on one element rebuilds its own glow. Components already glow on hover and focus in their intent color.
27
+
28
+ ```html
29
+ <p class="nw-h3 nw-text-glow" style="color: var(--nw-primary)">
30
+ Text glow follows the accent
31
+ </p>
32
+ <p class="nw-h3 nw-text-glow" style="color: var(--nw-info)">
33
+ or any color you pick
34
+ </p>
35
+ <p class="nw-display text-wire">Nyxwire</p>
36
+ ```
37
+
38
+ `text-wire` (Tailwind) clips `--nw-gradient-wire` (135°, primary to secondary) to the glyphs; `bg-wire` paints the same gradient as a fill.
39
+
40
+ ## Cut corners
41
+
42
+ `.nw-cut` chamfers the top-right and bottom-left corners, sized by `--nw-cut` (10px). The element paints its own chamfered fill and stays unclipped, and `::before` draws the 1px edge, so a glow still fits in the box: `clip-path` would clip a `box-shadow`, so the cut utilities swap to a `drop-shadow` filter instead.
43
+
44
+ ```html
45
+ <div class="nw-docs-tile nw-cut">
46
+ nw-cut <code>panel fill, line edge</code>
47
+ </div>
48
+ <div
49
+ class="nw-docs-tile nw-cut"
50
+ style="--nw-fill: var(--nw-canvas-sunken); --nw-edge: var(--nw-line-strong)"
51
+ >
52
+ custom <code>--nw-fill / --nw-edge</code>
53
+ </div>
54
+ <div class="nw-docs-tile nw-cut nw-glow-sm">
55
+ cut + glow <code>filter, not box-shadow</code>
56
+ </div>
57
+ <div class="nw-docs-tile nw-cut nw-wire">
58
+ cut + wire <code>gradient edge</code>
59
+ </div>
60
+ ```
61
+
62
+ Paint the fill through `--nw-fill` (a flat color, default panel) and the edge through `--nw-edge` (any paint, default line), not through `background` and `border`. Replaced elements (`img`, `video`, `svg`) have no pseudo-elements, so they are clipped directly and cannot glow; wrap one to give it a glow. Forced-colors mode falls back to a plain system-colored box with a real border.
63
+
64
+ ## Wire edge
65
+
66
+ `.nw-wire` draws a 1px border in `--nw-gradient-wire`, primary toward the top left and secondary opposite, over an opaque `--nw-fill`; `.nw-wire-glow` adds the matching bloom. On a cut surface the wire becomes the edge paint, which also works over a translucent fill. Buttons (`.nw-btn-wire`), cards and HUD panels have wire variants.
67
+
68
+ ```html
69
+ <div class="nw-docs-tile nw-wire">
70
+ nw-wire <code>1px gradient border</code>
71
+ </div>
72
+ <div class="nw-docs-tile nw-wire nw-wire-glow">
73
+ nw-wire-glow <code>bloom follows the wire</code>
74
+ </div>
75
+ ```
76
+
77
+ ## Scanlines, grid and glitch
78
+
79
+ ```html
80
+ <div class="nw-docs-tile nw-scanlines">
81
+ nw-scanlines <code>pointer-transparent overlay</code>
82
+ </div>
83
+ <div class="nw-docs-tile nw-grid-bg" style="background-color: var(--nw-canvas-sunken)">
84
+ nw-grid-bg <code>--nw-grid-size 32px</code>
85
+ </div>
86
+ <a class="nw-link nw-glitch" href="#scanlines-grid-and-glitch">
87
+ nw-glitch <code>hover or focus me</code>
88
+ </a>
89
+ <div class="nw-docs-tile nw-cut nw-scanlines nw-glow-sm">
90
+ All three <code>cut, scanlines, glow</code>
91
+ </div>
92
+ ```
93
+
94
+ | Class | Effect | Tune with |
95
+ | --------------- | ----------------------------------------------------------------------------------------------- | ---------------------------------------------- |
96
+ | `.nw-scanlines` | Horizontal lines from `--nw-scanlines` in a pointer-transparent `::after` | the shadow ink and flavor; lines are 3px apart |
97
+ | `.nw-grid-bg` | Circuit grid: lines every `--nw-grid-size`, a node on every fourth crossing | `--nw-grid-size` (32px), `--nw-grid-line` |
98
+ | `.nw-glitch` | One 480ms chromatic burst when the text, or the link or button around it, is hovered or focused | disabled under reduced motion |
99
+
100
+ Cut and scanlines combine (the overlay is clipped to the chamfer); the grid paints `background`, so it does not combine with cut or wire, which paint `background` too. Glitch splits the text in the secondary and tertiary colors with a step timing function.
101
+
102
+ ## Glass
103
+
104
+ `glass` (a Tailwind utility) is `--nw-glass` (canvas at 78%) with a `--nw-blur-md` backdrop blur, for panels over imagery or busy backdrops. Its legibility depends on the flavor and the scene behind it: put text on a solid or cut panel when the backdrop is loud, and check the pair where you use it.
105
+
106
+ ```html
107
+ <div class="nw-docs-tile glass">
108
+ glass <code>canvas at 78% + blur</code>
109
+ </div>
110
+ <div class="nw-docs-tile nw-cut" style="--nw-fill: var(--nw-glass)">
111
+ cut + glass fill <code>translucent --nw-fill</code>
112
+ </div>
113
+ ```
114
+
115
+ Blur tokens: `--nw-blur-sm` 4px, `--nw-blur-md` 12px, `--nw-blur-lg` 24px.
116
+
117
+ ## Motion
118
+
119
+ Motion answers an interaction or a state change. Durations and easings are tokens:
120
+
121
+ | Duration | Value | Easing | Curve |
122
+ | ----------------------- | ----- | -------------------- | ----------------------------------- |
123
+ | `--nw-duration-instant` | 80ms | `--nw-ease-standard` | `cubic-bezier(0.2, 0, 0, 1)` |
124
+ | `--nw-duration-fast` | 140ms | `--nw-ease-out` | `cubic-bezier(0.16, 1, 0.3, 1)` |
125
+ | `--nw-duration-base` | 220ms | `--nw-ease-in` | `cubic-bezier(0.7, 0, 0.84, 0)` |
126
+ | `--nw-duration-slow` | 360ms | `--nw-ease-in-out` | `cubic-bezier(0.65, 0, 0.35, 1)` |
127
+ | `--nw-duration-slower` | 560ms | `--nw-ease-back` | `cubic-bezier(0.34, 1.56, 0.64, 1)` |
128
+
129
+ Hover and color changes use `fast` with `standard`; entrances use `base` with `out`; exits use `fast` with `in`; a small overshoot (`back`) suits elements that pop in. Keyframes ship as `nw-spin`, `nw-pulse`, `nw-glow-pulse`, `nw-shimmer`, `nw-fade-in`, `nw-fade-out`, `nw-zoom-in`, `nw-zoom-out`, `nw-slide-in-from-{top,bottom,left,right}` and `nw-slide-out-to-{top,bottom,left,right}`; the slides travel `--nw-slide-distance` (0.5rem for a popover, 100% for a drawer). In Tailwind they are `animate-*` utilities of the same names.
130
+
131
+ ```html
132
+ <div
133
+ class="nw-docs-tile nw-docs-tile-neon"
134
+ style="animation: nw-glow-pulse 2s var(--nw-ease-standard) infinite"
135
+ >
136
+ nw-glow-pulse <code>alarms, live states</code>
137
+ </div>
138
+ <div class="nw-docs-tile" style="animation: nw-pulse 2s var(--nw-ease-standard) infinite">
139
+ nw-pulse <code>idle work, skeletons</code>
140
+ </div>
141
+ ```
142
+
143
+ > **Note: Reduced motion**
144
+ >
145
+ > Under `prefers-reduced-motion: reduce`, the duration tokens drop to 0.01ms and every animation and
146
+ > transition jumps to its end state, so `animationend` and `transitionend` still fire. Add
147
+ > `.nw-motion-essential` to an element whose motion carries meaning, such as a spinner for pending
148
+ > work. The switch lives in `@nyxwire/css` base, which the full bundle and the `@nyxwire/tailwind`
149
+ > entry both import; import the Tailwind theme alone and Tailwind animations follow the browser
150
+ > defaults, so bring the base import or your own switch.