@nyxwire/tailwind 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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Florian Maunier
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,196 @@
1
- # Temporary Holding Version
1
+ # @nyxwire/tailwind
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ CSS-first Nyxwire theme for Tailwind CSS 4.3, plus a typed `cn()` merger using tailwind-merge 3.7. The package entry imports the Nyxwire tokens, locally bundled fonts and base styles; it does not import the `@nyxwire/css` component classes.
4
+
5
+ ## Setup
6
+
7
+ Install `@nyxwire/css`, `@nyxwire/tailwind` and `tailwindcss`, then use the Tailwind Vite plugin or CLI. Put Tailwind first in the consumer stylesheet:
8
+
9
+ ```css
10
+ @import 'tailwindcss';
11
+ @import '@nyxwire/tailwind';
12
+ ```
13
+
14
+ Set the flavor and accent on the document, or on any nested scope:
15
+
16
+ ```html
17
+ <html lang="en" data-flavor="nocturne" data-accent="indigo">
18
+ <body class="bg-canvas font-sans text-fg">
19
+ <button class="h-11 rounded-md bg-primary px-5 font-semibold text-on-primary glow-sm">
20
+ Connect
21
+ </button>
22
+ </body>
23
+ </html>
24
+ ```
25
+
26
+ All mappings use `@theme inline`, so utilities reference `var(--nw-*)` directly. Flavor and accent changes, including nested scopes, need no recompilation. Opacity modifiers work too: `bg-primary/20` emits `color-mix(in oklab, var(--nw-primary) 20%, transparent)` with a fallback.
27
+
28
+ If the application already imports `@nyxwire/css` (including its base and fonts), import only the mappings:
29
+
30
+ ```css
31
+ @import 'tailwindcss';
32
+ @import '@nyxwire/tailwind/theme.css';
33
+ ```
34
+
35
+ The animation utilities use the `nw-*` keyframes in `@nyxwire/css/base.css`; the theme-only form therefore expects that base to be present. In custom CSS, use `var(--nw-primary)` rather than `var(--color-primary)` when a value must follow nested flavor scopes.
36
+
37
+ ### Font files with the Tailwind CLI
38
+
39
+ Vite and other bundlers rewrite the relative font URLs in `@nyxwire/css/fonts.css`. The standalone CLI leaves `url("./fonts/...")` unchanged, so copy the font directory beside the emitted stylesheet. This package's `demo/copy-fonts.ts` resolves the files through the `@nyxwire/css/fonts.css` export and copies them to `demo/fonts/`.
40
+
41
+ ## Colors
42
+
43
+ Semantic keys work with every Tailwind color utility (`bg-*`, `text-*`, `border-*`, `ring-*`, `fill-*`, `stroke-*`, `outline-*`, `decoration-*`, `caret-*` and opacity modifiers).
44
+
45
+ | Role | Complete keys |
46
+ | ----------------- | ---------------------------------------------------------------------------------- |
47
+ | Surfaces | `canvas`, `canvas-subtle`, `canvas-sunken`, `panel`, `panel-hover`, `panel-active` |
48
+ | Text | `fg`, `fg-muted`, `fg-subtle`, `fg-faint`, `fg-disabled` |
49
+ | Lines | `line`, `line-strong`, `line-bright` |
50
+ | Intents | `primary`, `secondary`, `tertiary`, `info`, `success`, `warning`, `danger` |
51
+ | Intent companions | `on-<intent>` and `<intent>-soft` for every intent above |
52
+ | Interaction | `ring`, `link`, `selection`, `shadow-ink`, `backdrop`, `glass` |
53
+
54
+ The 24 raw palette colors use the `nw-` prefix:
55
+
56
+ - Neutrals: `nw-crust`, `nw-mantle`, `nw-base`, `nw-surface0`, `nw-surface1`, `nw-surface2`, `nw-overlay0`, `nw-overlay1`, `nw-overlay2`, `nw-subtext0`, `nw-subtext1`, `nw-text`.
57
+ - Accents: `nw-indigo`, `nw-iris`, `nw-flux`, `nw-synth`, `nw-alarm`, `nw-flare`, `nw-volt`, `nw-matrix`, `nw-circuit`, `nw-ice`, `nw-arc`, `nw-steel`.
58
+
59
+ For example, `bg-nw-surface0` emits `background-color: var(--nw-surface0)`. The prefix is required: an unprefixed raw `--color-base` makes Tailwind interpret `text-base` as a color instead of the font-size utility.
60
+
61
+ ## Other theme values
62
+
63
+ | Utilities | Nyxwire source |
64
+ | ------------------------------------------------------------------------------------ | ------------------------------------------------------- |
65
+ | `font-display`, `font-sans`, `font-mono` | `--nw-font-display`, `--nw-font-sans`, `--nw-font-mono` |
66
+ | `text-2xs` through `text-7xl` | `--nw-text-2xs` through `--nw-text-7xl` |
67
+ | `leading-none`, `leading-tight`, `leading-snug`, `leading-normal`, `leading-relaxed` | corresponding `--nw-leading-*` |
68
+ | `tracking-tighter` through `tracking-widest` | corresponding `--nw-tracking-*` |
69
+ | `rounded-xs` through `rounded-2xl`, `rounded-full` | corresponding `--nw-radius-*` |
70
+ | `shadow-sm`, `shadow-md`, `shadow-lg` | corresponding `--nw-shadow-*` |
71
+ | `shadow-glow-sm`, `shadow-glow-md`, `shadow-glow-lg`, `shadow-glow-wire` | corresponding `--nw-glow-*` |
72
+ | `text-shadow-glow` | `--nw-glow-text` |
73
+ | `blur-sm`, `blur-md`, `blur-lg` and backdrop forms | corresponding `--nw-blur-*` |
74
+ | `ease-standard`, `ease-out`, `ease-in`, `ease-in-out`, `ease-back` | corresponding `--nw-ease-*` |
75
+
76
+ The Tailwind spacing multiplier is `var(--nw-space-1)`, so `p-4`, `gap-1.5` and the rest of the spacing utilities follow the Nyxwire 0.25rem grid. Default transition duration and easing use `--nw-duration-fast` and `--nw-ease-standard`. Text sizes from `xl` upward also bring the Nyxwire snug/tight leading; smaller sizes inherit their context's leading.
77
+
78
+ Control heights, cut geometry, ring geometry, z-index and other tokens without a same-named Tailwind scale remain available with arbitrary values, for example `h-(--nw-control-md)`, `z-(--nw-z-modal)` and `[--nw-cut:1rem]`.
79
+
80
+ Tailwind's default colors and the parts of its scales that Nyxwire does not override remain available. To remove default colors, put this reset after `@import 'tailwindcss'` and before the Nyxwire import:
81
+
82
+ ```css
83
+ @theme {
84
+ --color-*: initial;
85
+ }
86
+ ```
87
+
88
+ ## Variants
89
+
90
+ | Variant | Matching scope |
91
+ | -------------------------------------------- | ----------------------------------------------------------- |
92
+ | `abyss:`, `nocturne:`, `twilight:`, `lumen:` | the corresponding `data-flavor` element and its descendants |
93
+ | `dark:` | any of the three dark flavors |
94
+ | `light:` | `data-flavor="lumen"` |
95
+
96
+ These are attribute variants: set `data-flavor` explicitly. Like Tailwind's ancestor-based dark variant, an outer scope still matches inside a nested opposite scope; use the specific flavor utilities at that nested boundary when both could apply.
97
+
98
+ ## Motif utilities
99
+
100
+ | Utility | Effect |
101
+ | ----------------------------------- | -------------------------------------------------------------------------------- |
102
+ | `cut` | Chamfered top-right and bottom-left corners, with a 1px edge drawn by `::before` |
103
+ | `wire` | 1px primary-to-secondary gradient edge |
104
+ | `wire-glow` | Wire-colored bloom; becomes a drop-shadow on `cut` |
105
+ | `bg-wire` | Primary-to-secondary gradient from `--nw-gradient-wire` |
106
+ | `text-wire` | Same gradient clipped to the text; solid system text in forced colors |
107
+ | `glass` | Translucent `--nw-glass` surface with `--nw-blur-md` backdrop blur |
108
+ | `glow-sm`, `glow-md`, `glow-lg` | Neon box shadow; becomes a drop-shadow on `cut` |
109
+ | `glow-<color>`, `text-glow-<color>` | Set the shared `--nw-glow-color` from a theme color |
110
+ | `text-glow` | Text shadow from `--nw-glow-text` |
111
+ | `scanlines` | Pointer-transparent scanline overlay using `::after` |
112
+ | `grid-bg` | Circuit grid and nodes from `--nw-grid-size` and `--nw-grid-line` |
113
+ | `glitch` | One glitch burst on hover/focus, disabled for reduced motion |
114
+
115
+ Color utilities select the glow color rather than drawing a shadow by themselves. Pair `glow-sm` with `glow-danger` for a box glow, or `text-glow` with `text-glow-nw-flux` for a text glow. Both color prefixes accept all semantic keys, prefixed palette keys and Tailwind's retained defaults. Short raw aliases also work (`glow-flux`, `text-glow-flux`) without defining ordinary color utilities like `bg-flux`. Box and text glows on the same element share a color; use nested elements for separate colors.
116
+
117
+ Use `bg-wire` for a fill rather than an edge. `bg-wire`, `text-wire`, `grid-bg`, `cut` and `wire` paint the background; use separate elements to layer them. `glass` tints and blurs an existing backdrop, so its appearance depends on what's behind it. Check contrast against the rendered surface, particularly when using `text-wire` with a custom accent.
118
+
119
+ Paint cut and wire surfaces through their inputs rather than ordinary background and border utilities:
120
+
121
+ ```html
122
+ <button class="cut wire glow-md p-5 text-on-primary [--nw-cut:12px] [--nw-fill:var(--nw-primary)]">
123
+ Deploy
124
+ </button>
125
+ ```
126
+
127
+ `--nw-fill` defaults to `--nw-panel`; `--nw-edge` defaults to `--nw-line`. A non-cut wire needs an opaque fill. `cut` reserves `::before` and `scanlines` reserves `::after`. Do not combine `grid-bg` with `cut` or `wire` on one element because all three paint `background`. The cut compounds target the literal `cut` class, so apply `cut` unconditionally when combining it with glow or wire. Reduced-motion and forced-colors fallbacks are included.
128
+
129
+ ## Animations
130
+
131
+ Every shared Nyxwire keyframe is available through `animate-*`:
132
+
133
+ - `animate-spin`, `animate-pulse`, `animate-glow-pulse` and `animate-shimmer` loop. Shimmer expects a background sized to `200%` width, for example `bg-wire bg-size-[200%_100%]`.
134
+ - `animate-glitch` runs a single stepped burst.
135
+ - `animate-fade-in`, `animate-fade-out`, `animate-zoom-in` and `animate-zoom-out` use Nyxwire entrance/exit timing.
136
+ - `animate-slide-in-from-{top,bottom,left,right}` and `animate-slide-out-to-{top,bottom,left,right}` also take `--nw-slide-distance` (default `0.5rem`).
137
+
138
+ The imported base collapses decorative animations, including variant forms, to one near-instant iteration under `prefers-reduced-motion: reduce`. Use `nw-motion-essential` only if motion is needed to convey the state.
139
+
140
+ ## Class merging
141
+
142
+ ```ts
143
+ import { cn, twMergeConfig } from '@nyxwire/tailwind/merge'
144
+
145
+ cn('glow-sm glow-primary', 'glow-lg') // 'glow-primary glow-lg'
146
+ cn('glow-sm glow-primary text-glow', 'text-glow-nw-flux') // 'glow-sm text-glow text-glow-nw-flux'
147
+ cn('bg-none bg-wire glass') // 'bg-wire glass'
148
+ cn('text-sm text-fg') // 'text-sm text-fg'
149
+ cn('bg-canvas', { 'bg-panel': true }, [false, 'p-4']) // 'bg-panel p-4'
150
+ cn('rounded-lg border bg-panel cut') // 'cut'
151
+ ```
152
+
153
+ `cn()` accepts strings, numbers/bigints, booleans, null/undefined, nested readonly arrays and objects with truthy values. It uses no clsx dependency. Glow sizes share the box-shadow group and `text-glow` belongs to text-shadow; the two glow color prefixes share a separate group, so the last color wins. `bg-wire` belongs to background-image, and it can coexist with a background color. `glass` replaces preceding background colors and backdrop blurs. `text-wire` replaces preceding text colors, background images, and background clips. A later override of one constituent keeps the remaining parts of either composite intact. Nyxwire text sizes, colors and radii merge with Tailwind's standard groups; custom easings and animations extend their theme scales. Cut, wire and grid deduplicate and remove classes whose paint they replace.
154
+
155
+ Reuse the configuration with another merger:
156
+
157
+ ```ts
158
+ import { extendTailwindMerge } from 'tailwind-merge'
159
+ import { twMergeConfig } from '@nyxwire/tailwind/merge'
160
+
161
+ const merge = extendTailwindMerge(twMergeConfig)
162
+ ```
163
+
164
+ For Tailwind Variants 4, use its configuration entry point:
165
+
166
+ ```ts
167
+ import { createTV } from 'tailwind-variants/config'
168
+ import { twMergeConfig } from '@nyxwire/tailwind/merge'
169
+
170
+ export const tv = createTV({ twMergeConfig })
171
+ ```
172
+
173
+ ## Demo
174
+
175
+ ```sh
176
+ pnpm --filter @nyxwire/tailwind demo
177
+ ```
178
+
179
+ This runs `tailwindcss -i demo/input.css -o demo/output.css`, copies the local fonts and leaves a static relay dashboard in `demo/index.html`. Open that file directly; no server is required. The heading shows wire text; the capacity meter shows wire fill and an entrance animation; the load panel shows glass, and the wordmark shows palette-colored text glow. The flavor radiogroup supports arrow keys, and flavor/accent choices persist in local storage under the same keys as the CSS demo.
180
+
181
+ ## Verification
182
+
183
+ ```sh
184
+ pnpm --filter @nyxwire/tailwind build
185
+ pnpm --filter @nyxwire/tailwind test
186
+ pnpm --filter @nyxwire/tailwind typecheck
187
+ pnpm --filter @nyxwire/tailwind demo
188
+ ```
189
+
190
+ Build emits `dist/merge.js` and `dist/merge.d.ts`. Vitest checks token coverage against the CSS foundation, compiles the real package entry through `@tailwindcss/node`, and tests source and built class merging. The compiler is resolved from the installed CLI's dependency context rather than through pnpm hoisting.
191
+
192
+ This package supplies styling primitives; WCAG 2.2 AA for an application still depends on its chosen color pairs, markup and interactions. Compile tests verify generated CSS, not a rendered application's contrast, focus, target size, keyboard use or reflow.
193
+
194
+ ## For AI agents
195
+
196
+ This package ships Markdown docs for its exact version in `dist/docs/`, so coding agents can read the API instead of guessing it. Run `npx @nyxwire/cli agents-md` in your project to index them in `AGENTS.md`; [AI tools](https://nyxwire.dissidence.ovh/getting-started/ai/) also covers the agent skill, the MCP server and llms.txt.
@@ -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](../utilities.md).
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.