@nyxwire/css 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +133 -2
- package/dist/base.css +850 -0
- package/dist/components.css +10508 -0
- package/dist/docs/components/accordion.md +83 -0
- package/dist/docs/components/alert.md +52 -0
- package/dist/docs/components/avatar.md +55 -0
- package/dist/docs/components/badge.md +64 -0
- package/dist/docs/components/breadcrumbs.md +64 -0
- package/dist/docs/components/button.md +197 -0
- package/dist/docs/components/card.md +103 -0
- package/dist/docs/components/checkbox.md +45 -0
- package/dist/docs/components/chip.md +30 -0
- package/dist/docs/components/cluster.md +33 -0
- package/dist/docs/components/code.md +65 -0
- package/dist/docs/components/container.md +24 -0
- package/dist/docs/components/dialog.md +199 -0
- package/dist/docs/components/divider.md +31 -0
- package/dist/docs/components/dl.md +24 -0
- package/dist/docs/components/effect-utilities.md +82 -0
- package/dist/docs/components/empty.md +40 -0
- package/dist/docs/components/frame.md +27 -0
- package/dist/docs/components/grid.md +31 -0
- package/dist/docs/components/hud.md +75 -0
- package/dist/docs/components/input-group.md +28 -0
- package/dist/docs/components/input.md +52 -0
- package/dist/docs/components/kbd.md +42 -0
- package/dist/docs/components/label-and-field.md +31 -0
- package/dist/docs/components/link.md +41 -0
- package/dist/docs/components/list.md +67 -0
- package/dist/docs/components/menu.md +85 -0
- package/dist/docs/components/meter.md +77 -0
- package/dist/docs/components/navbar.md +66 -0
- package/dist/docs/components/pagination.md +64 -0
- package/dist/docs/components/popover.md +59 -0
- package/dist/docs/components/progress.md +32 -0
- package/dist/docs/components/prose.md +29 -0
- package/dist/docs/components/select.md +51 -0
- package/dist/docs/components/sidebar.md +35 -0
- package/dist/docs/components/sidenav.md +45 -0
- package/dist/docs/components/skeleton.md +36 -0
- package/dist/docs/components/slider.md +32 -0
- package/dist/docs/components/spinner.md +30 -0
- package/dist/docs/components/stack.md +26 -0
- package/dist/docs/components/steps.md +49 -0
- package/dist/docs/components/switch.md +19 -0
- package/dist/docs/components/table.md +83 -0
- package/dist/docs/components/tabs.md +207 -0
- package/dist/docs/components/textarea.md +13 -0
- package/dist/docs/components/toast.md +86 -0
- package/dist/docs/components/tooltip.md +39 -0
- package/dist/docs/components/typography-classes.md +38 -0
- package/dist/docs/families/data-display.md +15 -0
- package/dist/docs/families/feedback.md +13 -0
- package/dist/docs/families/forms.md +141 -0
- package/dist/docs/families/layout-typography.md +17 -0
- package/dist/docs/families/navigation.md +13 -0
- package/dist/docs/families/overlays.md +13 -0
- package/dist/docs/families/surfaces.md +11 -0
- package/dist/docs/foundations/accessibility.md +71 -0
- package/dist/docs/foundations/color-roles.md +114 -0
- package/dist/docs/foundations/effects-motion.md +150 -0
- package/dist/docs/foundations/flavors.md +156 -0
- package/dist/docs/foundations/icons.md +45 -0
- package/dist/docs/foundations/palette.md +180 -0
- package/dist/docs/foundations/spacing-elevation.md +168 -0
- package/dist/docs/foundations/typography.md +80 -0
- package/dist/docs/index.md +233 -0
- package/dist/docs/manifest.json +859 -0
- package/dist/fonts/inter-OFL.txt +93 -0
- package/dist/fonts/inter-latin-ext-wght-italic.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-wght-italic.woff2 +0 -0
- package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/martian-mono-OFL.txt +93 -0
- package/dist/fonts/martian-mono-latin-ext-wdth-normal.woff2 +0 -0
- package/dist/fonts/martian-mono-latin-wdth-normal.woff2 +0 -0
- package/dist/fonts/space-grotesk-OFL.txt +93 -0
- package/dist/fonts/space-grotesk-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/space-grotesk-latin-wght-normal.woff2 +0 -0
- package/dist/fonts.css +73 -0
- package/dist/nyxwire.css +12183 -0
- package/dist/tokens.css +579 -0
- package/dist/utilities.css +176 -0
- package/nyxwire.d.ts +2 -0
- package/package.json +66 -3
- package/skills/nyxwire/SKILL.md +63 -0
- package/src/base.css +158 -0
- package/src/components/accordion.css +280 -0
- package/src/components/alert.css +176 -0
- package/src/components/avatar.css +262 -0
- package/src/components/badge.css +193 -0
- package/src/components/breadcrumbs.css +209 -0
- package/src/components/btn.css +517 -0
- package/src/components/card.css +327 -0
- package/src/components/checkbox.css +202 -0
- package/src/components/chip.css +345 -0
- package/src/components/code.css +340 -0
- package/src/components/dialog.css +411 -0
- package/src/components/divider.css +201 -0
- package/src/components/empty.css +216 -0
- package/src/components/field.css +161 -0
- package/src/components/hud.css +212 -0
- package/src/components/index.css +50 -0
- package/src/components/input.css +383 -0
- package/src/components/kbd.css +197 -0
- package/src/components/layout.css +344 -0
- package/src/components/link.css +178 -0
- package/src/components/list.css +353 -0
- package/src/components/menu.css +347 -0
- package/src/components/meter.css +238 -0
- package/src/components/navbar.css +309 -0
- package/src/components/pagination.css +302 -0
- package/src/components/popover.css +352 -0
- package/src/components/progress.css +241 -0
- package/src/components/select.css +121 -0
- package/src/components/sidenav.css +326 -0
- package/src/components/skeleton.css +193 -0
- package/src/components/slider.css +201 -0
- package/src/components/spinner.css +200 -0
- package/src/components/stat.css +263 -0
- package/src/components/steps.css +311 -0
- package/src/components/switch.css +183 -0
- package/src/components/table.css +290 -0
- package/src/components/tabs.css +271 -0
- package/src/components/toast.css +413 -0
- package/src/components/tooltip.css +288 -0
- package/src/fonts.css +92 -0
- package/src/index.css +6 -0
- package/src/motion.css +177 -0
- package/src/semantic.css +85 -0
- package/src/tokens.css +276 -0
- package/src/typography.css +430 -0
- package/src/utilities.css +198 -0
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,134 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @nyxwire/css
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Nyxwire for plain HTML: flavored design tokens, local variable fonts, a reset, typography, and `nw-*` components. The styles do not require a framework or client-side JavaScript. Use native HTML interactions where available, or bring your own behavior for custom widgets.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
pnpm add @nyxwire/css
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Entry points
|
|
10
|
+
|
|
11
|
+
| Import | Contents |
|
|
12
|
+
| ----------------------------- | -------------------------------------------------------------------------- |
|
|
13
|
+
| `@nyxwire/css` | All styles, with the layer order declared first |
|
|
14
|
+
| `@nyxwire/css/tokens.css` | Four palette scopes, semantic roles, and design scales |
|
|
15
|
+
| `@nyxwire/css/fonts.css` | Local `@font-face` rules for Space Grotesk, Inter, and Martian Mono |
|
|
16
|
+
| `@nyxwire/css/base.css` | Element defaults, typography and prose, focus rings, and shared motion |
|
|
17
|
+
| `@nyxwire/css/components.css` | Layout primitives and the `nw-*` component classes |
|
|
18
|
+
| `@nyxwire/css/utilities.css` | Cut, wire, glow, scanlines, circuit grid, glitch, and visually hidden text |
|
|
19
|
+
| `@nyxwire/css/fonts/*` | Bundled WOFF2 assets |
|
|
20
|
+
| `@nyxwire/css/src/*` | Unbundled CSS sources |
|
|
21
|
+
|
|
22
|
+
```css
|
|
23
|
+
/* Everything */
|
|
24
|
+
@import '@nyxwire/css';
|
|
25
|
+
|
|
26
|
+
/* Or choose entries; start with tokens for variables the other styles use. */
|
|
27
|
+
@layer theme, base, components, utilities;
|
|
28
|
+
@import '@nyxwire/css/tokens.css';
|
|
29
|
+
@import '@nyxwire/css/base.css';
|
|
30
|
+
@import '@nyxwire/css/components.css';
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The shared cascade order is `theme, base, components, utilities`. For example, a utility can override a component without `!important`. The bundled font rules reference relative URLs and do not request fonts from a CDN. In TypeScript, `import '@nyxwire/css'` is typed as a side-effect import.
|
|
34
|
+
|
|
35
|
+
## Flavors and accents
|
|
36
|
+
|
|
37
|
+
```html
|
|
38
|
+
<html lang="en" data-flavor="nocturne" data-theme="dark">
|
|
39
|
+
<section data-flavor="lumen" data-theme="light">
|
|
40
|
+
<div data-accent="synth">A Synth primary accent inside a light island</div>
|
|
41
|
+
</section>
|
|
42
|
+
</html>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
- `data-flavor`: `nocturne`, `abyss`, and `twilight` are dark; `lumen` is light. Without an explicit root flavor, Nyxwire defaults to Nocturne or selects Lumen for a light system preference. Flavor scopes can nest.
|
|
46
|
+
- `data-theme`: set `light` or `dark` alongside `data-flavor` when integrating with a consumer that reads the theme, such as Starlight. CSS palette selection uses `data-flavor`.
|
|
47
|
+
- `data-accent`: choose `indigo`, `iris`, `flux`, `synth`, `alarm`, `flare`, `volt`, `matrix`, `circuit`, `ice`, `arc`, or `steel`. The choice becomes `--nw-primary` and retints the focus ring in that scope. The link token remains Iris.
|
|
48
|
+
|
|
49
|
+
The CSS does not persist preferences. The optional flavor runtime in `@nyxwire/astro` sets the attributes and uses `nyxwire-flavor` as its default storage key.
|
|
50
|
+
|
|
51
|
+
## Tokens
|
|
52
|
+
|
|
53
|
+
| Group | CSS custom properties |
|
|
54
|
+
| ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
55
|
+
| Palette | `--nw-crust`, `--nw-mantle`, `--nw-base`, `--nw-surface0..2`, `--nw-overlay0..2`, `--nw-subtext0..1`, `--nw-text`, the twelve accents, matching `-rgb` channels, `--nw-on-accent` |
|
|
56
|
+
| Surfaces | `--nw-canvas`, `--nw-canvas-subtle`, `--nw-canvas-sunken`, `--nw-panel`, `--nw-panel-hover`, `--nw-panel-active` |
|
|
57
|
+
| Ink | `--nw-fg`, `--nw-fg-muted`, `--nw-fg-subtle`, `--nw-fg-faint`, `--nw-fg-disabled` |
|
|
58
|
+
| Lines | `--nw-line`, `--nw-line-strong`, `--nw-line-bright` |
|
|
59
|
+
| Intents | `--nw-primary`, `--nw-secondary`, `--nw-tertiary`, `--nw-info`, `--nw-success`, `--nw-warning`, `--nw-danger`, with `--nw-on-*` and `--nw-*-soft` counterparts |
|
|
60
|
+
| Interactions | `--nw-ring`, `--nw-ring-width`, `--nw-ring-offset`, `--nw-link`, `--nw-selection`, `--nw-backdrop`, `--nw-glass`, `--nw-soft-ink` |
|
|
61
|
+
| Type | `--nw-font-display`, `--nw-font-sans`, `--nw-font-mono`, `--nw-text-2xs..7xl`, `--nw-leading-*`, `--nw-tracking-*` |
|
|
62
|
+
| Space | `--nw-space-*` (0.25rem grid and fractional steps), `--nw-control-xs/sm/md/lg` |
|
|
63
|
+
| Shape | `--nw-radius-xs..2xl`, `--nw-radius-full`, `--nw-shadow-sm/md/lg`, `--nw-cut` |
|
|
64
|
+
| Effects | `--nw-glow-color`, `--nw-glow-sm/md/lg`, `--nw-glow-text`, `--nw-gradient-wire`, `--nw-scanlines`, `--nw-grid-size`, `--nw-grid-line` |
|
|
65
|
+
| Motion | `--nw-duration-instant..slower`, `--nw-ease-standard/out/in/in-out/back` |
|
|
66
|
+
| Layers | `--nw-z-dropdown`, `--nw-z-sticky`, `--nw-z-overlay`, `--nw-z-modal`, `--nw-z-popover`, `--nw-z-toast`, `--nw-z-tooltip` |
|
|
67
|
+
|
|
68
|
+
Set `--nw-glow-color` on a surface to retint its glow. Glow is quieter in Lumen. Decorative motion respects `prefers-reduced-motion`.
|
|
69
|
+
|
|
70
|
+
## Components
|
|
71
|
+
|
|
72
|
+
Use the base class with its documented modifiers, for example `nw-btn nw-btn-outline nw-btn-info nw-btn-sm`. Parts such as `nw-card-title` and `nw-hud-status` are classes on separate elements. Classes do not add roles, labels, or behavior.
|
|
73
|
+
|
|
74
|
+
| Files | Classes and behavior |
|
|
75
|
+
| --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
76
|
+
| `btn.css` | `nw-btn`, solid/soft/outline/ghost/link, intents and sizes, `nw-btn-icon`, `nw-btn-block`, `nw-btn-group`; `aria-busy="true"` for loading |
|
|
77
|
+
| `field.css`, `input.css`, `select.css` | `nw-field`, `nw-label`, `nw-field-hint`, `nw-field-error`, `nw-choice`, `nw-input` (including `<textarea>`), `nw-select`, `nw-input-group`, `nw-input-addon` |
|
|
78
|
+
| `checkbox.css`, `switch.css`, `slider.css` | `nw-checkbox`, `nw-radio`, `nw-switch` on a checkbox with `role="switch"`, `nw-slider` on a range input |
|
|
79
|
+
| `card.css`, `hud.css` | `nw-card` for general content; `nw-hud` for framed title, status, content, and optional actions |
|
|
80
|
+
| `badge.css`, `chip.css`, `avatar.css` | `nw-badge`, `nw-chip` with `nw-chip-remove`, `nw-avatar` with fallback, status and group parts |
|
|
81
|
+
| `alert.css`, `toast.css` | `nw-alert` with title, description and actions, `nw-toast` and `nw-toast-region` |
|
|
82
|
+
| `table.css`, `stat.css`, `empty.css` | `nw-table` and `nw-table-wrap`, `nw-stat`, `nw-empty` |
|
|
83
|
+
| `progress.css`, `meter.css` | `nw-progress` (native `<progress>`, determinate or indeterminate), `nw-meter` |
|
|
84
|
+
| `spinner.css`, `skeleton.css`, `divider.css` | `nw-spinner`, `nw-skeleton`, `nw-divider` |
|
|
85
|
+
| `link.css`, `list.css`, `kbd.css`, `code.css` | `nw-link`, `nw-list`, `nw-kbd`, and code utilities including `nw-code` and `nw-pre` |
|
|
86
|
+
| `tabs.css`, `accordion.css`, `steps.css` | `nw-tabs` on ARIA tab markup, `nw-accordion` on `<details>`, `nw-steps` |
|
|
87
|
+
| `breadcrumbs.css`, `pagination.css` | `nw-breadcrumbs`, `nw-pagination` |
|
|
88
|
+
| `navbar.css`, `sidenav.css`, `menu.css` | `nw-navbar`, `nw-sidenav`, `nw-menu` and `nw-menu-item` |
|
|
89
|
+
| `dialog.css`, `popover.css`, `tooltip.css` | `nw-dialog` on native `<dialog>`, `nw-drawer`, `nw-popover`, `nw-tooltip` |
|
|
90
|
+
| `layout.css` | `nw-container`, `nw-stack`, `nw-cluster`, `nw-grid`, `nw-sidebar`, `nw-center`, `nw-frame`, `nw-shell`, `nw-spacer` |
|
|
91
|
+
|
|
92
|
+
### HUD panels
|
|
93
|
+
|
|
94
|
+
```html
|
|
95
|
+
<article class="nw-hud nw-hud-cut nw-hud-wire nw-hud-scanlines nw-hud-success">
|
|
96
|
+
<header class="nw-hud-header">
|
|
97
|
+
<h2 class="nw-hud-title">Signal relay</h2>
|
|
98
|
+
<span class="nw-hud-status">Online</span>
|
|
99
|
+
</header>
|
|
100
|
+
<div class="nw-hud-body">Both channels are receiving a signal.</div>
|
|
101
|
+
<footer class="nw-hud-footer">Last checked just now</footer>
|
|
102
|
+
</article>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
- The optional `nw-hud-actions` slot sits at the end of the header. Set a text label in `nw-hud-status`; the marker alone does not communicate a state.
|
|
106
|
+
- `nw-hud-xs/sm/md/lg` change padding. Intents are `primary`, `secondary`, `tertiary`, `neutral`, `info`, `success`, `warning`, and `danger`.
|
|
107
|
+
- `nw-hud-solid` uses the sunken canvas; `nw-hud-cut`, `nw-hud-wire`, and `nw-hud-scanlines` can be combined. `nw-hud-alarm` pulses the status marker, not the text, and stops under reduced motion. Forced colors restore a plain outlined panel.
|
|
108
|
+
- Use `nw-hud-interactive` only on a panel that is itself a native link or button; don't nest interactive elements in it. Native `disabled` disables a button. `aria-disabled="true"` styles the panel but does not prevent navigation or events by itself.
|
|
109
|
+
|
|
110
|
+
### Forms, prose, and layout
|
|
111
|
+
|
|
112
|
+
- Use `nw-input` on native text controls and textareas, and `nw-select` on native selects, including multiple and sized listboxes. Place a checkbox, radio, or switch inside a `<label class="nw-choice">` for a clickable text row. `nw-input-group-xs/sm/md/lg` set shared heights for joined controls; attach the accessible label to the input, not its addon.
|
|
113
|
+
- Typography roles include `nw-display`, `nw-h1` through `nw-h6`, `nw-eyebrow`, `nw-lead`, `nw-mono`, and `nw-text-*`. For rendered Markdown or long-form HTML, wrap content in `nw-prose`. Add `nw-prose-sm` or `nw-prose-lg` for scale, `nw-prose-wide` to remove the 68ch limit, and `nw-prose-scroll` on a wrapper around a wide table.
|
|
114
|
+
- `nw-container` has a 72rem default maximum and responsive 1rem/1.5rem/2rem side gutters. Use `nw-container-xs/sm/md/lg/xl/prose` to choose another measure, `nw-container-fluid` to remove the maximum, `nw-container-flush` to remove the gutters, or `nw-container-start` to align to the inline start. Override the measure with `--nw-container-max` or the gutter with `--nw-container-pad`.
|
|
115
|
+
|
|
116
|
+
Utilities include `nw-cut`, `nw-wire`, `nw-wire-glow`, `nw-glow-sm/md/lg`, `nw-glow-<intent>`, `nw-text-glow`, `nw-scanlines`, `nw-grid-bg`, `nw-glitch`, and `nw-sr-only`. The cut and wire treatments use `--nw-fill`; put the circuit grid on a separate wrapper because these treatments set the background.
|
|
117
|
+
|
|
118
|
+
## Demo pages
|
|
119
|
+
|
|
120
|
+
From the repository root, run `pnpm build:css`, then serve `packages/css/` over HTTP or open the HTML pages from disk. `demo/index.html` shows foundations, `demo/components-a.html` shows actions, forms and HUD panels, `demo/components-b.html` shows navigation and content, and `demo/components-c.html` shows overlays and data. Each page lets you change flavor and accent.
|
|
121
|
+
|
|
122
|
+
## For AI agents
|
|
123
|
+
|
|
124
|
+
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.
|
|
125
|
+
|
|
126
|
+
## Development
|
|
127
|
+
|
|
128
|
+
```sh
|
|
129
|
+
pnpm build:css
|
|
130
|
+
pnpm --filter @nyxwire/css test
|
|
131
|
+
pnpm --filter @nyxwire/css typecheck
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
The build produces six stylesheets and copies the WOFF2 assets into `dist/fonts/`. Lightning CSS targets Chrome 111, Firefox 128, Safari 16.4, and iOS Safari 16.4. The tests inspect compiled stylesheets, so run the build before the test suite.
|