@nyxwire/palette 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 +143 -2
- package/dist/css/abyss.css +116 -0
- package/dist/css/lumen.css +116 -0
- package/dist/css/nocturne.css +116 -0
- package/dist/css/palette.css +334 -0
- package/dist/css/twilight.css +116 -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 +78 -0
- package/dist/docs/manifest.json +51 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.js +2154 -0
- package/dist/on-accent.d.ts +2 -0
- package/dist/on-accent.js +4 -0
- package/dist/palette.d.ts +138 -0
- package/dist/palette.js +145 -0
- package/dist/palette.json +4622 -0
- package/dist/roles.d.ts +133 -0
- package/dist/roles.js +61 -0
- package/package.json +57 -3
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# Spacing & elevation
|
|
2
|
+
|
|
3
|
+
> The 0.25rem spacing grid, radius and cut scale, control heights, surface ramp, shadows and z-index layers.
|
|
4
|
+
|
|
5
|
+
## Spacing
|
|
6
|
+
|
|
7
|
+
Spacing tokens sit on a 0.25rem grid. Fractional steps use a hyphen: `--nw-space-0-5` is 0.125rem, `--nw-space-1-5` is 0.375rem and `--nw-space-2-5` is 0.625rem.
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<div class="nw-docs-ruler">
|
|
11
|
+
<code>--nw-space-1</code>
|
|
12
|
+
<i style="--size: var(--nw-space-1)"></i>
|
|
13
|
+
<span>0.25rem</span>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="nw-docs-ruler">
|
|
16
|
+
<code>--nw-space-2</code>
|
|
17
|
+
<i style="--size: var(--nw-space-2)"></i>
|
|
18
|
+
<span>0.5rem</span>
|
|
19
|
+
</div>
|
|
20
|
+
<div class="nw-docs-ruler">
|
|
21
|
+
<code>--nw-space-3</code>
|
|
22
|
+
<i style="--size: var(--nw-space-3)"></i>
|
|
23
|
+
<span>0.75rem</span>
|
|
24
|
+
</div>
|
|
25
|
+
<div class="nw-docs-ruler">
|
|
26
|
+
<code>--nw-space-4</code>
|
|
27
|
+
<i style="--size: var(--nw-space-4)"></i>
|
|
28
|
+
<span>1rem</span>
|
|
29
|
+
</div>
|
|
30
|
+
<div class="nw-docs-ruler">
|
|
31
|
+
<code>--nw-space-5</code>
|
|
32
|
+
<i style="--size: var(--nw-space-5)"></i>
|
|
33
|
+
<span>1.25rem</span>
|
|
34
|
+
</div>
|
|
35
|
+
<div class="nw-docs-ruler">
|
|
36
|
+
<code>--nw-space-6</code>
|
|
37
|
+
<i style="--size: var(--nw-space-6)"></i>
|
|
38
|
+
<span>1.5rem</span>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="nw-docs-ruler">
|
|
41
|
+
<code>--nw-space-8</code>
|
|
42
|
+
<i style="--size: var(--nw-space-8)"></i>
|
|
43
|
+
<span>2rem</span>
|
|
44
|
+
</div>
|
|
45
|
+
<div class="nw-docs-ruler">
|
|
46
|
+
<code>--nw-space-10</code>
|
|
47
|
+
<i style="--size: var(--nw-space-10)"></i>
|
|
48
|
+
<span>2.5rem</span>
|
|
49
|
+
</div>
|
|
50
|
+
<div class="nw-docs-ruler">
|
|
51
|
+
<code>--nw-space-12</code>
|
|
52
|
+
<i style="--size: var(--nw-space-12)"></i>
|
|
53
|
+
<span>3rem</span>
|
|
54
|
+
</div>
|
|
55
|
+
<div class="nw-docs-ruler">
|
|
56
|
+
<code>--nw-space-16</code>
|
|
57
|
+
<i style="--size: var(--nw-space-16)"></i>
|
|
58
|
+
<span>4rem</span>
|
|
59
|
+
</div>
|
|
60
|
+
<div class="nw-docs-ruler">
|
|
61
|
+
<code>--nw-space-20</code>
|
|
62
|
+
<i style="--size: var(--nw-space-20)"></i>
|
|
63
|
+
<span>5rem</span>
|
|
64
|
+
</div>
|
|
65
|
+
<div class="nw-docs-ruler">
|
|
66
|
+
<code>--nw-space-24</code>
|
|
67
|
+
<i style="--size: var(--nw-space-24)"></i>
|
|
68
|
+
<span>6rem</span>
|
|
69
|
+
</div>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
The full set is `0`, `px` (1px), `0-5`, `1`, `1-5`, `2`, `2-5`, `3`, `4`, `5`, `6`, `8`, `10`, `12`, `16`, `20` and `24`. The Tailwind theme binds Tailwind's spacing to this grid (`--spacing: var(--nw-space-1)`), so `p-4` equals `--nw-space-4` and arbitrary values stay on the grid.
|
|
73
|
+
|
|
74
|
+
## Radius and cut
|
|
75
|
+
|
|
76
|
+
Two corner languages coexist: radii for ordinary surfaces, and the cut chamfer for signature surfaces. Buttons and inputs use `md`, cards and dialogs `lg`; the cut chamfers the top-right and bottom-left corner only.
|
|
77
|
+
|
|
78
|
+
```html
|
|
79
|
+
<div class="nw-docs-tile" style="border-radius: var(--nw-radius-xs)">
|
|
80
|
+
xs <code>2px</code>
|
|
81
|
+
</div>
|
|
82
|
+
<div class="nw-docs-tile" style="border-radius: var(--nw-radius-sm)">
|
|
83
|
+
sm <code>4px</code>
|
|
84
|
+
</div>
|
|
85
|
+
<div class="nw-docs-tile" style="border-radius: var(--nw-radius-md)">
|
|
86
|
+
md <code>8px</code>
|
|
87
|
+
</div>
|
|
88
|
+
<div class="nw-docs-tile" style="border-radius: var(--nw-radius-lg)">
|
|
89
|
+
lg <code>12px</code>
|
|
90
|
+
</div>
|
|
91
|
+
<div class="nw-docs-tile" style="border-radius: var(--nw-radius-xl)">
|
|
92
|
+
xl <code>16px</code>
|
|
93
|
+
</div>
|
|
94
|
+
<div class="nw-docs-tile" style="border-radius: var(--nw-radius-2xl)">
|
|
95
|
+
2xl <code>24px</code>
|
|
96
|
+
</div>
|
|
97
|
+
<div class="nw-docs-tile nw-cut">
|
|
98
|
+
cut <code>--nw-cut 10px</code>
|
|
99
|
+
</div>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Tokens: `--nw-radius-xs` to `--nw-radius-2xl` and `--nw-radius-full` (9999px). Tailwind: `rounded-xs` to `rounded-2xl` map to the tokens; `rounded-full` is Tailwind's own. The cut is `.nw-cut` (or the Tailwind `cut` utility), sized by `--nw-cut` (10px); opt-in component variants `.nw-btn-cut`, `.nw-card-cut` and `.nw-hud-cut` chamfer those surfaces. See [Effects & motion](effects-motion.md#cut-corners) for how the cut paints and glows.
|
|
103
|
+
|
|
104
|
+
## Control heights
|
|
105
|
+
|
|
106
|
+
| Token | Value | Tailwind |
|
|
107
|
+
| ----------------- | ------- | ----------------- |
|
|
108
|
+
| `--nw-control-xs` | 1.75rem | `h-7` equivalents |
|
|
109
|
+
| `--nw-control-sm` | 2rem | `h-8` |
|
|
110
|
+
| `--nw-control-md` | 2.5rem | `h-10` |
|
|
111
|
+
| `--nw-control-lg` | 3rem | `h-12` |
|
|
112
|
+
|
|
113
|
+
Controls default to `md`; pick the size for the interaction, not the label length, and prefer `md` or larger on touch layouts. Every height clears the 24px WCAG 2.2 minimum target.
|
|
114
|
+
|
|
115
|
+
## Surfaces
|
|
116
|
+
|
|
117
|
+
Depth comes first from tone. Each step raises the surface one level; hover and active states move one more.
|
|
118
|
+
|
|
119
|
+
```html
|
|
120
|
+
<div class="nw-docs-tile" style="background-color: var(--nw-canvas-sunken)">
|
|
121
|
+
canvas-sunken <code>crust</code>
|
|
122
|
+
</div>
|
|
123
|
+
<div class="nw-docs-tile" style="background-color: var(--nw-canvas-subtle)">
|
|
124
|
+
canvas-subtle <code>mantle</code>
|
|
125
|
+
</div>
|
|
126
|
+
<div class="nw-docs-tile" style="background-color: var(--nw-canvas)">
|
|
127
|
+
canvas <code>base</code>
|
|
128
|
+
</div>
|
|
129
|
+
<div class="nw-docs-tile" style="background-color: var(--nw-panel)">
|
|
130
|
+
panel <code>surface0</code>
|
|
131
|
+
</div>
|
|
132
|
+
<div class="nw-docs-tile" style="background-color: var(--nw-panel-hover)">
|
|
133
|
+
panel-hover <code>surface1</code>
|
|
134
|
+
</div>
|
|
135
|
+
<div class="nw-docs-tile" style="background-color: var(--nw-panel-active)">
|
|
136
|
+
panel-active <code>surface2</code>
|
|
137
|
+
</div>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Shadows
|
|
141
|
+
|
|
142
|
+
Shadows add separation for floating layers, tinted by `--nw-shadow-ink`: near-black on the dark flavors, the text ink at a lower strength on Lumen.
|
|
143
|
+
|
|
144
|
+
```html
|
|
145
|
+
<div class="nw-docs-tile" style="box-shadow: var(--nw-shadow-sm)">
|
|
146
|
+
shadow-sm <code>--nw-shadow-sm</code>
|
|
147
|
+
</div>
|
|
148
|
+
<div class="nw-docs-tile" style="box-shadow: var(--nw-shadow-md)">
|
|
149
|
+
shadow-md <code>--nw-shadow-md</code>
|
|
150
|
+
</div>
|
|
151
|
+
<div class="nw-docs-tile" style="box-shadow: var(--nw-shadow-lg)">
|
|
152
|
+
shadow-lg <code>--nw-shadow-lg</code>
|
|
153
|
+
</div>
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Cards use `sm`, toasts and HUD panels `md` or `lg`, menus, popovers and dialogs `lg`. Tailwind: `shadow-sm`, `shadow-md`, `shadow-lg`, plus `shadow-glow-sm`, `shadow-glow-md`, `shadow-glow-lg` and `shadow-glow-wire` for the neon effects. The neon glow is an effect, not elevation: see [Effects & motion](effects-motion.md#glow).
|
|
157
|
+
|
|
158
|
+
## Layers
|
|
159
|
+
|
|
160
|
+
| Token | Value | For |
|
|
161
|
+
| ----------------- | ----- | --------------------------- |
|
|
162
|
+
| `--nw-z-dropdown` | 1000 | Dropdowns and select lists |
|
|
163
|
+
| `--nw-z-sticky` | 1100 | Sticky headers and toolbars |
|
|
164
|
+
| `--nw-z-overlay` | 1300 | Backdrops |
|
|
165
|
+
| `--nw-z-modal` | 1400 | Dialogs and drawers |
|
|
166
|
+
| `--nw-z-popover` | 1500 | Popovers and menus |
|
|
167
|
+
| `--nw-z-toast` | 1600 | Toasts |
|
|
168
|
+
| `--nw-z-tooltip` | 1700 | Tooltips |
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Typography
|
|
2
|
+
|
|
3
|
+
> Three bundled variable fonts, the type scale, heading roles and the typography classes.
|
|
4
|
+
|
|
5
|
+
## Fonts
|
|
6
|
+
|
|
7
|
+
| Role | Family | Token | Tailwind | Use |
|
|
8
|
+
| ------- | ---------------------- | ------------------- | -------------- | -------------------------------------------- |
|
|
9
|
+
| Display | Space Grotesk Variable | `--nw-font-display` | `font-display` | Headings h1 to h6, display text, stat values |
|
|
10
|
+
| Sans | Inter Variable | `--nw-font-sans` | `font-sans` | Body text, controls, lead |
|
|
11
|
+
| Mono | Martian Mono Variable | `--nw-font-mono` | `font-mono` | Code, values, eyebrows, table headers |
|
|
12
|
+
|
|
13
|
+
All three are open-licensed (OFL) variable fonts shipped as local `woff2` files, Latin and Latin Extended subsets, with `font-display: swap`. They load from `@nyxwire/css/fonts.css`, which the full CSS bundle, `@nyxwire/tailwind` and the Starlight plugin import. No request leaves your origin.
|
|
14
|
+
|
|
15
|
+
Space Grotesk leans technical and slightly wide, which is why it carries headings and numbers; Inter carries everything you read at length; Martian Mono is a wide monospace with tall x-height, tuned for short labels and code.
|
|
16
|
+
|
|
17
|
+
## Specimen
|
|
18
|
+
|
|
19
|
+
```html
|
|
20
|
+
<p class="nw-display">Signal on the wire</p>
|
|
21
|
+
<p class="nw-h1">Indigo tubes and quiet panels</p>
|
|
22
|
+
<p class="nw-h2">Cut corners, readable in every flavor</p>
|
|
23
|
+
<p class="nw-h3">Panels, cards and HUD frames</p>
|
|
24
|
+
<p class="nw-h4">Section headings in the display face</p>
|
|
25
|
+
<p class="nw-h5">Section label in the body face</p>
|
|
26
|
+
<p class="nw-h6">h6 keeps the display face here</p>
|
|
27
|
+
<p class="nw-eyebrow">Mono uppercase eyebrow</p>
|
|
28
|
+
<p class="nw-lead">Lead text opens a section at 1.25rem with normal leading and muted ink.</p>
|
|
29
|
+
<p>
|
|
30
|
+
Body copy is Inter at 1rem with 1.55 line height. It carries <strong>strong text</strong>,
|
|
31
|
+
<em>emphasis</em> and <code>inline code</code> without changing rhythm.
|
|
32
|
+
</p>
|
|
33
|
+
<p class="nw-mono">channel.alerts · latency 12ms · 0123456789 != =></p>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Heading roles
|
|
37
|
+
|
|
38
|
+
Element defaults in `@nyxwire/css` base styles, mirrored by classes so any tag can take a role:
|
|
39
|
+
|
|
40
|
+
| Role | Class | Font | Size | Weight | Notes |
|
|
41
|
+
| ------- | ------------- | ------- | --------------------------------- | ------ | ----------------------------------------- |
|
|
42
|
+
| Display | `.nw-display` | display | `clamp(3rem, 2rem + 5vw, 4.5rem)` | 700 | leading 1, tracking −0.03em |
|
|
43
|
+
| h1 | `.nw-h1` | display | 2.25rem (`--nw-text-4xl`) | 700 | leading 1.15, tracking −0.03em |
|
|
44
|
+
| h2 | `.nw-h2` | display | 1.875rem (`--nw-text-3xl`) | 700 | leading 1.15, tracking −0.015em |
|
|
45
|
+
| h3 | `.nw-h3` | display | 1.5rem (`--nw-text-2xl`) | 600 | leading 1.3, tracking −0.015em |
|
|
46
|
+
| h4 | `.nw-h4` | display | 1.25rem (`--nw-text-xl`) | 600 | leading 1.3, tracking −0.015em |
|
|
47
|
+
| h5 | `.nw-h5` | display | 1.125rem (`--nw-text-lg`) | 600 | leading 1.3, tracking −0.015em |
|
|
48
|
+
| h6 | `.nw-h6` | display | 1rem (`--nw-text-base`) | 600 | leading 1.3, tracking −0.015em |
|
|
49
|
+
| Eyebrow | `.nw-eyebrow` | mono | 0.6875rem (`--nw-text-2xs`) | 500 | uppercase, tracking 0.18em, `primary` ink |
|
|
50
|
+
| Lead | `.nw-lead` | sans | 1.25rem (`--nw-text-xl`) | 400 | leading 1.55, `fg-muted` |
|
|
51
|
+
|
|
52
|
+
Headings balance their lines (`text-wrap: balance`) and paragraphs avoid orphans (`text-wrap: pretty`). Helpers: `.nw-mono` (mono font), `.nw-text-muted`, `.nw-text-subtle`, `.nw-text-faint`, `.nw-text-disabled` and `.nw-text-<intent>` for colored text. For long-form HTML, wrap it in `.nw-prose` (`.nw-prose-sm`, `.nw-prose-lg`, `.nw-prose-wide`), which styles lists, quotes, code, tables and rules at a 68ch measure.
|
|
53
|
+
|
|
54
|
+
## Scale
|
|
55
|
+
|
|
56
|
+
| Token | Size | Tailwind |
|
|
57
|
+
| ---------------- | --------- | ----------- |
|
|
58
|
+
| `--nw-text-2xs` | 0.6875rem | `text-2xs` |
|
|
59
|
+
| `--nw-text-xs` | 0.75rem | `text-xs` |
|
|
60
|
+
| `--nw-text-sm` | 0.875rem | `text-sm` |
|
|
61
|
+
| `--nw-text-base` | 1rem | `text-base` |
|
|
62
|
+
| `--nw-text-lg` | 1.125rem | `text-lg` |
|
|
63
|
+
| `--nw-text-xl` | 1.25rem | `text-xl` |
|
|
64
|
+
| `--nw-text-2xl` | 1.5rem | `text-2xl` |
|
|
65
|
+
| `--nw-text-3xl` | 1.875rem | `text-3xl` |
|
|
66
|
+
| `--nw-text-4xl` | 2.25rem | `text-4xl` |
|
|
67
|
+
| `--nw-text-5xl` | 3rem | `text-5xl` |
|
|
68
|
+
| `--nw-text-6xl` | 3.75rem | `text-6xl` |
|
|
69
|
+
| `--nw-text-7xl` | 4.5rem | `text-7xl` |
|
|
70
|
+
|
|
71
|
+
The Tailwind theme re-binds Tailwind's own size names to these tokens, with leading from `snug` up. `text-base`, `text-sm` and smaller keep Tailwind's default line heights; `text-xl` and up pair with the tighter leading tokens.
|
|
72
|
+
|
|
73
|
+
| Leading | Value | Tracking | Value |
|
|
74
|
+
| ---------------------- | ----- | ----------------------- | -------- |
|
|
75
|
+
| `--nw-leading-none` | 1 | `--nw-tracking-tighter` | −0.03em |
|
|
76
|
+
| `--nw-leading-tight` | 1.15 | `--nw-tracking-tight` | −0.015em |
|
|
77
|
+
| `--nw-leading-snug` | 1.3 | `--nw-tracking-normal` | 0 |
|
|
78
|
+
| `--nw-leading-normal` | 1.55 | `--nw-tracking-wide` | 0.04em |
|
|
79
|
+
| `--nw-leading-relaxed` | 1.7 | `--nw-tracking-wider` | 0.08em |
|
|
80
|
+
| | | `--nw-tracking-widest` | 0.18em |
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# @nyxwire/palette 0.1.0
|
|
2
|
+
|
|
3
|
+
Nyxwire's indigo neon palette: four flavors of 24 colors as hex, RGB, HSL and OKLCH, in JavaScript, JSON and CSS.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
Install the package:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
pnpm add @nyxwire/palette
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Conventions
|
|
14
|
+
|
|
15
|
+
- 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.
|
|
16
|
+
- Flavors are `abyss`, `nocturne` (the default) and `twilight`, which are dark, and `lumen`, which is light.
|
|
17
|
+
- Components color by semantic role (`primary`, `danger`, ...) through `semanticRoles`, not by raw color: see [foundations/color-roles.md](foundations/color-roles.md).
|
|
18
|
+
- No color library is needed at runtime. CSS custom properties are `--nw-<color>`, with `--nw-<color>-rgb` channels for alpha.
|
|
19
|
+
|
|
20
|
+
## Use the values
|
|
21
|
+
|
|
22
|
+
#### JavaScript
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { flavors, flavorEntries, semanticRoles } from '@nyxwire/palette'
|
|
26
|
+
import type { ColorName, FlavorName } from '@nyxwire/palette'
|
|
27
|
+
|
|
28
|
+
const nocturne = flavors.nocturne
|
|
29
|
+
nocturne.colors.indigo.hex // '#848fff'
|
|
30
|
+
nocturne.colors.indigo.oklch // { l, c, h }
|
|
31
|
+
nocturne.colors[semanticRoles.primary].rgb // { r: 132, g: 143, b: 255 }
|
|
32
|
+
|
|
33
|
+
for (const flavor of flavorEntries) console.log(flavor.id, flavor.dark, flavor.onAccent)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
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.
|
|
37
|
+
|
|
38
|
+
#### JSON
|
|
39
|
+
|
|
40
|
+
```js
|
|
41
|
+
import palette from '@nyxwire/palette/palette.json' with { type: 'json' }
|
|
42
|
+
|
|
43
|
+
palette.flavors.lumen.colors.base.hex // '#eae6ff'
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
The JSON holds the same data as the JavaScript exports, role maps included.
|
|
47
|
+
|
|
48
|
+
#### CSS
|
|
49
|
+
|
|
50
|
+
```css
|
|
51
|
+
@import '@nyxwire/palette/css';
|
|
52
|
+
|
|
53
|
+
body {
|
|
54
|
+
background: var(--nw-base);
|
|
55
|
+
color: var(--nw-text);
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
`palette.css` declares `--nw-<color>` 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-<color>-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:
|
|
60
|
+
|
|
61
|
+
```css
|
|
62
|
+
@import '@nyxwire/palette/css/abyss.css';
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
For components, prefer the semantic tokens from `@nyxwire/css` ([Color roles](foundations/color-roles.md)) over raw palette variables.
|
|
66
|
+
|
|
67
|
+
## Files
|
|
68
|
+
|
|
69
|
+
Every file below documents @nyxwire/palette 0.1.0. Read the ones you need before writing code.
|
|
70
|
+
|
|
71
|
+
- [foundations/accessibility.md](foundations/accessibility.md): The palette's contrast gate with live results, focus rings, keyboard support, reduced motion and forced-colors fallbacks.
|
|
72
|
+
- [foundations/color-roles.md](foundations/color-roles.md): Semantic color tokens, what each accent means, and the syntax highlighting roles, generated from @nyxwire/palette.
|
|
73
|
+
- [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.
|
|
74
|
+
- [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.
|
|
75
|
+
- [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.
|
|
76
|
+
- [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.
|
|
77
|
+
- [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.
|
|
78
|
+
- [foundations/typography.md](foundations/typography.md): Three bundled variable fonts, the type scale, heading roles and the typography classes.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nyxwire/palette",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"files": [
|
|
5
|
+
{
|
|
6
|
+
"path": "foundations/accessibility.md",
|
|
7
|
+
"title": "Accessibility",
|
|
8
|
+
"description": "The palette's contrast gate with live results, focus rings, keyboard support, reduced motion and forced-colors fallbacks."
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"path": "foundations/color-roles.md",
|
|
12
|
+
"title": "Color roles",
|
|
13
|
+
"description": "Semantic color tokens, what each accent means, and the syntax highlighting roles, generated from @nyxwire/palette."
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"path": "foundations/effects-motion.md",
|
|
17
|
+
"title": "Effects & motion",
|
|
18
|
+
"description": "Cut corners, the wire edge, neon glow, scanlines, the circuit grid, glitch, glass, and motion tokens that respect reduced motion."
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"path": "foundations/flavors.md",
|
|
22
|
+
"title": "Flavors & theming",
|
|
23
|
+
"description": "Pick a flavor with data attributes, nest scopes, swap the accent, and persist the visitor's choice without a flash."
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"path": "foundations/icons.md",
|
|
27
|
+
"title": "Icons",
|
|
28
|
+
"description": "Lucide icons through @lucide/vue, sized by the component around them and hidden from assistive technology unless they carry meaning."
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"path": "foundations/palette.md",
|
|
32
|
+
"title": "Palette",
|
|
33
|
+
"description": "Every Nyxwire color in all four flavors, generated from @nyxwire/palette with hex, RGB, OKLCH and contrast against the flavor's base."
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"path": "foundations/spacing-elevation.md",
|
|
37
|
+
"title": "Spacing & elevation",
|
|
38
|
+
"description": "The 0.25rem spacing grid, radius and cut scale, control heights, surface ramp, shadows and z-index layers."
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"path": "foundations/typography.md",
|
|
42
|
+
"title": "Typography",
|
|
43
|
+
"description": "Three bundled variable fonts, the type scale, heading roles and the typography classes."
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"path": "index.md",
|
|
47
|
+
"title": "@nyxwire/palette 0.1.0",
|
|
48
|
+
"description": "Setup, conventions and the list of every doc file."
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ColorName, FlavorName } from './palette.ts';
|
|
2
|
+
export * from './palette.ts';
|
|
3
|
+
export * from './roles.ts';
|
|
4
|
+
export type ColorFormat = {
|
|
5
|
+
readonly name: ColorName;
|
|
6
|
+
readonly label: string;
|
|
7
|
+
readonly order: number;
|
|
8
|
+
readonly accent: boolean;
|
|
9
|
+
readonly hex: string;
|
|
10
|
+
readonly rgb: {
|
|
11
|
+
readonly r: number;
|
|
12
|
+
readonly g: number;
|
|
13
|
+
readonly b: number;
|
|
14
|
+
};
|
|
15
|
+
readonly hsl: {
|
|
16
|
+
readonly h: number;
|
|
17
|
+
readonly s: number;
|
|
18
|
+
readonly l: number;
|
|
19
|
+
};
|
|
20
|
+
readonly oklch: {
|
|
21
|
+
readonly l: number;
|
|
22
|
+
readonly c: number;
|
|
23
|
+
readonly h: number;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export type Flavor = {
|
|
27
|
+
readonly id: FlavorName;
|
|
28
|
+
readonly name: string;
|
|
29
|
+
readonly order: number;
|
|
30
|
+
readonly dark: boolean;
|
|
31
|
+
readonly onAccent: ColorName;
|
|
32
|
+
readonly colors: Readonly<Record<ColorName, ColorFormat>>;
|
|
33
|
+
};
|
|
34
|
+
export declare const flavors: {
|
|
35
|
+
readonly abyss: Flavor;
|
|
36
|
+
readonly nocturne: Flavor;
|
|
37
|
+
readonly twilight: Flavor;
|
|
38
|
+
readonly lumen: Flavor;
|
|
39
|
+
};
|
|
40
|
+
export declare const flavorEntries: readonly Flavor[];
|