# Nyxwire > Nyxwire is an indigo neon design system: @nyxwire/palette (colors), @nyxwire/css (plain-CSS nw-* components), @nyxwire/tailwind (a Tailwind CSS 4 theme), @nyxwire/vue (Vue 3 Nw* components built on Reka UI), @nyxwire/astro (an Astro integration) and @nyxwire/starlight (a Starlight theme). Every @nyxwire package ships these docs for its exact version in `node_modules/@nyxwire//dist/docs/`. In a project, `npx @nyxwire/cli agents-md` indexes them in AGENTS.md and `npx @nyxwire/cli mcp` serves them over MCP; https://nyxwire.dissidence.ovh/mcp hosts the same MCP server. Flavors are `abyss`, `nocturne` (the default) and `twilight`, which are dark, and `lumen`, which is light; select them with the `data-flavor` and `data-theme` attributes. # Flavors & theming > Pick a flavor with data attributes, nest scopes, swap the accent, and persist the visitor's choice without a flash. A flavor is a complete palette: twelve neutrals from the deepest background to body text, plus twelve accents. Nyxwire has four, one wire from the deepest dark to daylight. | Flavor | Theme | Character | Use for | | ---------- | ----- | ----------------------------------- | -------------------------- | | `abyss` | dark | Near-black indigo, the deepest base | Dense dashboards, HUDs | | `nocturne` | dark | Deep electric indigo | Websites and docs, default | | `twilight` | dark | Dusky violet-indigo, softest dark | Long reading | | `lumen` | light | Lavender daylight, deeper accents | Light mode | The three dark flavors share the exact same accent values; only their neutrals change. ## Try it _Live example: [Flavors & theming](https://nyxwire.dissidence.ovh/foundations/flavors/)._ This is the Vue `NwFlavorSelect` from `@nyxwire/vue`, driven by `useFlavor`. It shares one runtime with the flavor select in the header: change either and the other follows, and the choice survives a reload. ## Three attributes | Attribute | Values | Effect | | ------------- | ---------------------------------------------------------- | -------------------------------------------------------------------------------- | | `data-flavor` | `abyss`, `nocturne`, `twilight`, `lumen` | Selects the palette for the element and its descendants | | `data-theme` | `dark`, `light` | Set with the flavor; drives the Tailwind `dark:`/`lumen:` variants and Starlight | | `data-accent` | one of the [12 accents](color-roles.md#accents) | Re-points `--nw-primary`, and with it buttons, links, focus and glow | ```html ``` With no `data-flavor` on the root, Nocturne applies, or Lumen when the system prefers a light color scheme. An explicit attribute always wins over that fallback. ## Nested scopes Every semantic token is re-declared on each `[data-flavor]` and `[data-accent]` element, so a nested scope resolves against its own palette: ```html
``` _Live example: [Flavors & theming](https://nyxwire.dissidence.ovh/foundations/flavors/)._ > **Note** > > The Tailwind `dark:` variant matches any dark flavor scope and `light:`/`lumen:` match a Lumen > scope, on the element or any ancestor, so inside a light scope on a dark page both match. Prefer > semantic utilities such as `bg-canvas` and `text-fg`, which follow the nearest scope, over theme > variants. ## Accents `data-accent` swaps the primary intent for one subtree. Everything derived from it follows: solid buttons, links, focus rings and glow. The generated palette CSS re-resolves the accent inside nested flavor scopes against that flavor's own value, so an accent set on an ancestor carries into a Lumen scope and picks up Lumen's deeper hex. ```html ``` An inner `data-accent` beats an outer one. The generated selectors cover an accent scope inside an accent scope inside a flavor scope; nest accent scopes deeper than that and the nearest accent stops being re-resolved, so avoid going past two. ## Persisting the choice The visitor's flavor is stored in `localStorage` under `nyxwire-flavor` as `auto`, `abyss`, `nocturne`, `twilight` or `lumen`, and the accent under `nyxwire-accent`. `auto` follows `prefers-color-scheme`: a light system gets the configured light flavor (Lumen), anything else the configured dark flavor. Every package reads and writes the same keys, so a choice made on the docs carries over to an Astro site or a Vue app on the same origin. ### The page runtime The Astro integration, the Astro `FlavorScript` component and the Starlight plugin all install the same runtime as `window.nyxwire`. It sets `data-flavor`, `data-theme`, `data-accent`, `data-nw-flavor-preference` and `color-scheme` on ``, and updates ``: ```js window.nyxwire.getFlavor() // stored preference, including 'auto' window.nyxwire.resolve() // concrete flavor in use, e.g. 'nocturne' window.nyxwire.setFlavor('twilight') // persists, applies, dispatches the event window.nyxwire.getAccent() // stored accent, or null for the palette default window.nyxwire.setAccent('matrix') // persists, applies window.nyxwire.setAccent(null) // removes data-accent, back to indigo document.addEventListener('nyxwire:flavor', ({ detail }) => { console.log(detail.flavor, detail.resolved, detail.theme, detail.accent) // 'twilight' 'twilight' 'dark' 'matrix' }) ``` `nyxwire:flavor` fires on initialization, on every `setFlavor` and `setAccent` call and, while the preference is `auto`, when the system color scheme changes. `setFlavor` and `setAccent` throw a `TypeError` for unknown values. When storage is blocked, the choice still applies for the current page. ### Vue: `useFlavor` ```vue ``` Every call inside one Vue app shares a single state; the first call supplies the app's options. On a page with `window.nyxwire`, `useFlavor` delegates to the runtime and mirrors its events, which is how the island above stays in sync with the header. Without a runtime, it runs standalone: it persists under the same key, follows the system preference while `auto`, and sets `data-flavor`, `data-theme` and `color-scheme` on `` or on a `target` element. The first call can pass options: ```ts useFlavor({ defaults: { dark: 'abyss', light: 'lumen' }, // flavors used by 'auto' defaultFlavor: 'auto', // when nothing is stored storageKey: 'nyxwire-flavor', target: () => document.querySelector('#hud'), // null applies nothing storage: window.localStorage, // or null to keep the choice in memory matchMedia: (query) => window.matchMedia(query), runtime: window.nyxwire, // or null to force standalone mode }) ``` It is SSR-safe: nothing touches `window` or `document` until a component mounts. ## No flash of the wrong flavor The runtime is a small inline script in `` that runs before the first paint, so the stored flavor is already on `` when the page draws. The Astro integration injects it into every page; on standalone Astro pages, put `FlavorScript` in the head slot of `Layout`. Without JavaScript, the CSS fallback still applies: Nocturne, or Lumen for a light system preference. # @nyxwire/palette 0.1.1 Nyxwire's indigo neon palette: four flavors of 24 colors as hex, RGB, HSL and OKLCH, in JavaScript, JSON and CSS. ## Install Install the package: ```sh pnpm add @nyxwire/palette ``` ## Conventions - The names are the API: 24 colors per flavor, twelve neutrals (`crust` to `text`) and twelve accents (`indigo` to `steel`). Values are tuned per flavor; hex is canonical. - Flavors are `abyss`, `nocturne` (the default) and `twilight`, which are dark, and `lumen`, which is light. - Components color by semantic role (`primary`, `danger`, ...) through `semanticRoles`, not by raw color: see [foundations/color-roles.md](foundations/color-roles.md). - No color library is needed at runtime. CSS custom properties are `--nw-`, with `--nw--rgb` channels for alpha. ## Use the values #### JavaScript ```ts import { flavors, flavorEntries, semanticRoles } from '@nyxwire/palette' import type { ColorName, FlavorName } from '@nyxwire/palette' const nocturne = flavors.nocturne nocturne.colors.indigo.hex // '#848fff' nocturne.colors.indigo.oklch // { l, c, h } nocturne.colors[semanticRoles.primary].rgb // { r: 132, g: 143, b: 255 } for (const flavor of flavorEntries) console.log(flavor.id, flavor.dark, flavor.onAccent) ``` Each color carries `name`, `label`, `order`, `accent`, `hex`, `rgb`, `hsl` and `oklch`. Each flavor carries `id`, `name`, `order`, `dark`, `colors` and `onAccent`, the palette color used for text on solid accent fills. The package also exports `colorNames`, `neutralNames`, `accentNames`, `flavorNames`, `flavorMeta`, `defaultFlavor`, `semanticRoles`, `syntaxRoles` and the `FlavorName`, `DarkFlavorName`, `ColorName`, `NeutralName`, `AccentName`, `Flavor` and `ColorFormat` types. No color library is needed at runtime. #### JSON ```js import palette from '@nyxwire/palette/palette.json' with { type: 'json' } palette.flavors.lumen.colors.base.hex // '#eae6ff' ``` The JSON holds the same data as the JavaScript exports, role maps included. #### CSS ```css @import '@nyxwire/palette/css'; body { background: var(--nw-base); color: var(--nw-text); } ``` `palette.css` declares `--nw-` for all 24 colors in `@layer theme`, for Nocturne on `:root` (with a light-scheme fallback to Lumen) and for every `[data-flavor]` value, plus `--nw--rgb` channels, `--nw-on-accent`, `--nw-flavor-dark` (`1` or `0`) and `color-scheme`. Use the RGB channels for alpha without `color-mix`: `rgb(var(--nw-indigo-rgb) / 50%)`. `[data-accent]` scopes set `--nw-accent`; the default is `var(--nw-indigo)`. To pin one flavor on `:root`, import its file instead: ```css @import '@nyxwire/palette/css/abyss.css'; ``` For components, prefer the semantic tokens from `@nyxwire/css` ([Color roles](foundations/color-roles.md)) over raw palette variables. ## Files Every file below documents @nyxwire/palette 0.1.1. Read the ones you need before writing code. - [foundations/accessibility.md](foundations/accessibility.md): The palette's contrast gate with live results, focus rings, keyboard support, reduced motion and forced-colors fallbacks. - [foundations/color-roles.md](foundations/color-roles.md): Semantic color tokens, what each accent means, and the syntax highlighting roles, generated from @nyxwire/palette. - [foundations/effects-motion.md](foundations/effects-motion.md): Cut corners, the wire edge, neon glow, scanlines, the circuit grid, glitch, glass, and motion tokens that respect reduced motion. - [foundations/flavors.md](foundations/flavors.md): Pick a flavor with data attributes, nest scopes, swap the accent, and persist the visitor's choice without a flash. - [foundations/icons.md](foundations/icons.md): Lucide icons through @lucide/vue, sized by the component around them and hidden from assistive technology unless they carry meaning. - [foundations/palette.md](foundations/palette.md): Every Nyxwire color in all four flavors, generated from @nyxwire/palette with hex, RGB, OKLCH and contrast against the flavor's base. - [foundations/spacing-elevation.md](foundations/spacing-elevation.md): The 0.25rem spacing grid, radius and cut scale, control heights, surface ramp, shadows and z-index layers. - [foundations/typography.md](foundations/typography.md): Three bundled variable fonts, the type scale, heading roles and the typography classes. # @nyxwire/css 0.1.1 Nyxwire's CSS: tokens, fonts, typography and nw-* components for any HTML page, in four flavors. `@nyxwire/css` styles plain HTML with `nw-*` classes: no JavaScript, no build step, any framework. The Vue components in `@nyxwire/vue` follow the same visual spec, so a page can mix both. ## Install 1. Install the CSS package. ```sh pnpm add @nyxwire/css ``` 2. Import the full bundle: tokens, fonts, base styles, components and utilities. ```css @import '@nyxwire/css'; ``` To take only some layers, declare the layer order first, then import the entry points you need: ```css @layer theme, base, components, utilities; @import '@nyxwire/css/tokens.css'; @import '@nyxwire/css/fonts.css'; @import '@nyxwire/css/components.css'; ``` 3. Set a flavor on the document and use the `nw-*` classes. ```html ``` Without `data-flavor`, Nocturne applies, and a system that prefers light gets Lumen. To persist a visitor's choice, use the Astro `FlavorScript` or Vue's `useFlavor`. ## Import ```css /* Everything: tokens, fonts, base styles, components, utilities */ @import '@nyxwire/css'; ``` ```css /* Or pick entry points, after declaring the layer order */ @layer theme, base, components, utilities; @import '@nyxwire/css/tokens.css'; @import '@nyxwire/css/fonts.css'; @import '@nyxwire/css/base.css'; @import '@nyxwire/css/components.css'; @import '@nyxwire/css/utilities.css'; ``` Components live in `@layer components` and the motif helpers in `@layer utilities`, the layer names Tailwind uses, so a Tailwind utility overrides a component style without `!important`. The type roles and `nw-prose` sit in `@layer base`, below every component. The unbundled sources ship under `@nyxwire/css/src/*`, and the bundled fonts under `@nyxwire/css/fonts/*`. ## Class model A component has one base class plus modifiers that each set one axis: ```html ``` - **Intent** (`-primary`, `-secondary`, `-tertiary`, `-neutral`, `-info`, `-success`, `-warning`, `-danger`) picks the color. Primary is the active accent (indigo unless `data-accent` swaps it), secondary is synth, tertiary is ice. - **Variant** (`-solid`, `-soft`, `-outline`, `-ghost`, and `-link` on buttons) picks how the color is applied. Not every component has every variant; each page lists them. - **Size** (`-xs`, `-sm`, `-md`, `-lg`, plus `-xl` where a component needs it) sets height, padding and type. - **Motif** (`-cut`, `-wire`, `-glow`, `-scanlines` where offered) adds a Nyxwire signature: chamfered corners, the indigo-to-synth wire edge, a neon bloom or the scanline overlay. Every motif is opt-in. A bare base class is complete: `class="nw-btn"` is a solid, primary, medium button. State comes from attributes and pseudo-classes, never from state classes: `:disabled`, `[aria-disabled="true"]`, `[aria-busy="true"]` for loading, `[aria-invalid="true"]` and `:user-invalid` for errors, `[aria-pressed]`, `[aria-selected]`, `[aria-current]`, `[aria-expanded]`, and the `data-state` values that Reka UI and Radix render. Private custom properties start with `--_` and may change between releases; the public knobs, such as `--nw-progress`, `--nw-meter`, `--nw-cut` and `--nw-glow-color`, are documented on each page. ## Flavors and accents Every component reads the semantic roles (`--nw-canvas`, `--nw-panel`, `--nw-fg`, `--nw-primary`, ...), so a `data-flavor` attribute on any ancestor re-themes it: `nocturne` (default), `twilight`, `abyss` and the light `lumen`. A `data-accent` attribute swaps the primary accent for one of the twelve accents, and both attributes nest. The stage below scopes the lumen flavor. ```html
``` ## Badges and accents Badges take every intent; to use any of the twelve accents, put `data-accent` on the badge or on a parent and keep the primary intent. ```html
Solid Soft Outline Online Rerouting 3
indigo iris flux synth alarm flare volt matrix circuit ice arc steel
``` ## Cards ```html

Relay hel-01

Helsinki edge node, 12 ms from the core.

Traffic is balanced across three uplinks. The next maintenance window opens at 02:00 UTC.

Interactive, cut and wired

The whole card is the link. Hover raises the fill; the chamfer and the gradient edge are opt-in.

``` ## Component groups | Group | Classes | | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [Typography](components/typography-classes.md) | `nw-display`, `nw-h1` to `nw-h6`, `nw-lead`, `nw-eyebrow`, `nw-mono`, `nw-prose`, `nw-text-*` | | [Actions](components/button.md) | `nw-btn`, `nw-btn-group`, `nw-btn-icon`, `nw-btn-block`, `nw-btn-cut`, `nw-btn-wire`, `nw-btn-glow` | | [Forms](families/forms.md) | `nw-field`, `nw-label`, `nw-input`, `nw-select`, `nw-input-group`, `nw-checkbox`, `nw-radio`, `nw-switch`, `nw-slider`, `nw-chip` | | [Surfaces](families/surfaces.md) and [Overlays](families/overlays.md) | `nw-card`, `nw-hud`, `nw-accordion`, `nw-dialog`, `nw-popover`, `nw-menu`, `nw-tooltip`, `nw-toast` | | [Feedback](families/feedback.md) | `nw-alert`, `nw-badge`, `nw-progress`, `nw-meter`, `nw-stat`, `nw-spinner`, `nw-skeleton`, `nw-empty` | | [Navigation](families/navigation.md) | `nw-tabs`, `nw-breadcrumbs`, `nw-pagination`, `nw-link`, `nw-navbar`, `nw-sidenav`, `nw-steps` | | [Data display](families/data-display.md) | `nw-table`, `nw-list`, `nw-dl`, `nw-kbd`, `nw-hotkey`, `nw-code`, `nw-pre`, `nw-avatar`, `nw-divider` | | [Layout](families/layout-typography.md) | `nw-container`, `nw-stack`, `nw-cluster`, `nw-grid`, `nw-sidebar`, `nw-center`, `nw-frame`, `nw-spacer`, `nw-shell`, and the motif utilities such as `nw-cut` | Interactive pieces use the platform: `nw-accordion` styles `
`, `nw-dialog` styles `` and its `::backdrop`, `nw-popover` and `nw-menu` style elements with the `popover` attribute, `nw-progress` and `nw-meter` style the native elements, and `nw-slider` styles ``. Each of them also accepts the `data-state` markup a headless library renders, which is how the Vue components reuse the spec. Where HTML has no behavior of its own (tab selection, a navbar toggle, a toast queue), the CSS documents the attribute contract and leaves the script to you; the demos use [one small delegated script](components/tabs.md#tab-behavior-script). ## Files Every file below documents @nyxwire/css 0.1.1. Read the ones you need before writing code. - [components/accordion.md](components/accordion.md): An accordion is a stack of disclosure rows. - [components/alert.md](components/alert.md): An alert is a message with one intent. - [components/avatar.md](components/avatar.md): An avatar is a rounded slot for a user: an image, initials in the fallback, or an empty bordered slot. - [components/badge.md](components/badge.md): A badge is a short status label, not an action. - [components/breadcrumbs.md](components/breadcrumbs.md): Breadcrumbs are a `