@nyxwire/starlight 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 +221 -2
- package/dist/config.d.ts +9 -0
- package/dist/config.js +32 -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 +51 -0
- package/dist/docs/kitchen-sink.md +283 -0
- package/dist/docs/manifest.json +61 -0
- package/dist/docs/setup.md +190 -0
- package/dist/ec-themes.d.ts +443 -0
- package/dist/ec-themes.js +217 -0
- package/dist/expressive-code.d.ts +75 -0
- package/dist/expressive-code.js +101 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +25 -0
- package/dist/options.d.ts +29 -0
- package/dist/options.js +56 -0
- package/dist/runtime.d.ts +16 -0
- package/dist/runtime.js +52 -0
- package/dist/theme-bridge.d.ts +27 -0
- package/dist/theme-bridge.js +73 -0
- package/package.json +67 -3
- package/src/chrome.css +191 -0
- package/src/components/ThemeProvider.astro +15 -0
- package/src/components/ThemeSelect.astro +51 -0
- package/src/components/env.d.ts +5 -0
- package/src/config.ts +53 -0
- package/src/content-components.css +154 -0
- package/src/ec-themes.ts +246 -0
- package/src/expressive-code.ts +115 -0
- package/src/index.ts +32 -0
- package/src/options.ts +80 -0
- package/src/prose.css +108 -0
- package/src/runtime.ts +67 -0
- package/src/theme-bridge.css +130 -0
- package/src/theme-bridge.ts +89 -0
- package/styles.css +299 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# Flavors & theming
|
|
2
|
+
|
|
3
|
+
> Pick a flavor with data attributes, nest scopes, swap the accent, and persist the visitor's choice without a flash.
|
|
4
|
+
|
|
5
|
+
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.
|
|
6
|
+
|
|
7
|
+
| Flavor | Theme | Character | Use for |
|
|
8
|
+
| ---------- | ----- | ----------------------------------- | -------------------------- |
|
|
9
|
+
| `abyss` | dark | Near-black indigo, the deepest base | Dense dashboards, HUDs |
|
|
10
|
+
| `nocturne` | dark | Deep electric indigo | Websites and docs, default |
|
|
11
|
+
| `twilight` | dark | Dusky violet-indigo, softest dark | Long reading |
|
|
12
|
+
| `lumen` | light | Lavender daylight, deeper accents | Light mode |
|
|
13
|
+
|
|
14
|
+
The three dark flavors share the exact same accent values; only their neutrals change.
|
|
15
|
+
|
|
16
|
+
## Try it
|
|
17
|
+
|
|
18
|
+
_Live example: [Flavors & theming](https://nyxwire.dissidence.ovh/foundations/flavors/)._
|
|
19
|
+
|
|
20
|
+
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.
|
|
21
|
+
|
|
22
|
+
## Three attributes
|
|
23
|
+
|
|
24
|
+
| Attribute | Values | Effect |
|
|
25
|
+
| ------------- | ---------------------------------------------------------- | -------------------------------------------------------------------------------- |
|
|
26
|
+
| `data-flavor` | `abyss`, `nocturne`, `twilight`, `lumen` | Selects the palette for the element and its descendants |
|
|
27
|
+
| `data-theme` | `dark`, `light` | Set with the flavor; drives the Tailwind `dark:`/`lumen:` variants and Starlight |
|
|
28
|
+
| `data-accent` | one of the [12 accents](color-roles.md#accents) | Re-points `--nw-primary`, and with it buttons, links, focus and glow |
|
|
29
|
+
|
|
30
|
+
```html
|
|
31
|
+
<html data-flavor="nocturne" data-theme="dark" data-accent="ice"></html>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
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.
|
|
35
|
+
|
|
36
|
+
## Nested scopes
|
|
37
|
+
|
|
38
|
+
Every semantic token is re-declared on each `[data-flavor]` and `[data-accent]` element, so a nested scope resolves against its own palette:
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<section data-flavor="lumen" data-theme="light">
|
|
42
|
+
<button class="nw-btn nw-btn-primary">Lumen</button>
|
|
43
|
+
<div data-flavor="abyss" data-theme="dark" data-accent="matrix">
|
|
44
|
+
<button class="nw-btn nw-btn-primary">Abyss, matrix accent</button>
|
|
45
|
+
</div>
|
|
46
|
+
</section>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
_Live example: [Flavors & theming](https://nyxwire.dissidence.ovh/foundations/flavors/)._
|
|
50
|
+
|
|
51
|
+
> **Note**
|
|
52
|
+
>
|
|
53
|
+
> The Tailwind `dark:` variant matches any dark flavor scope and `light:`/`lumen:` match a Lumen
|
|
54
|
+
> scope, on the element or any ancestor, so inside a light scope on a dark page both match. Prefer
|
|
55
|
+
> semantic utilities such as `bg-canvas` and `text-fg`, which follow the nearest scope, over theme
|
|
56
|
+
> variants.
|
|
57
|
+
|
|
58
|
+
## Accents
|
|
59
|
+
|
|
60
|
+
`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.
|
|
61
|
+
|
|
62
|
+
```html
|
|
63
|
+
<span data-accent="indigo">
|
|
64
|
+
<button type="button" class="nw-btn nw-btn-primary">
|
|
65
|
+
indigo
|
|
66
|
+
</button>
|
|
67
|
+
</span>
|
|
68
|
+
<span data-accent="ice">
|
|
69
|
+
<button type="button" class="nw-btn nw-btn-primary">
|
|
70
|
+
ice
|
|
71
|
+
</button>
|
|
72
|
+
</span>
|
|
73
|
+
<span data-accent="arc">
|
|
74
|
+
<button type="button" class="nw-btn nw-btn-primary">
|
|
75
|
+
arc
|
|
76
|
+
</button>
|
|
77
|
+
</span>
|
|
78
|
+
<span data-accent="matrix">
|
|
79
|
+
<button type="button" class="nw-btn nw-btn-primary">
|
|
80
|
+
matrix
|
|
81
|
+
</button>
|
|
82
|
+
</span>
|
|
83
|
+
<span data-accent="volt">
|
|
84
|
+
<button type="button" class="nw-btn nw-btn-primary">
|
|
85
|
+
volt
|
|
86
|
+
</button>
|
|
87
|
+
</span>
|
|
88
|
+
<span data-accent="steel">
|
|
89
|
+
<button type="button" class="nw-btn nw-btn-primary">
|
|
90
|
+
steel
|
|
91
|
+
</button>
|
|
92
|
+
</span>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
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.
|
|
96
|
+
|
|
97
|
+
## Persisting the choice
|
|
98
|
+
|
|
99
|
+
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.
|
|
100
|
+
|
|
101
|
+
### The page runtime
|
|
102
|
+
|
|
103
|
+
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 `<html>`, and updates `<meta name="theme-color">`:
|
|
104
|
+
|
|
105
|
+
```js
|
|
106
|
+
window.nyxwire.getFlavor() // stored preference, including 'auto'
|
|
107
|
+
window.nyxwire.resolve() // concrete flavor in use, e.g. 'nocturne'
|
|
108
|
+
window.nyxwire.setFlavor('twilight') // persists, applies, dispatches the event
|
|
109
|
+
|
|
110
|
+
window.nyxwire.getAccent() // stored accent, or null for the palette default
|
|
111
|
+
window.nyxwire.setAccent('matrix') // persists, applies
|
|
112
|
+
window.nyxwire.setAccent(null) // removes data-accent, back to indigo
|
|
113
|
+
|
|
114
|
+
document.addEventListener('nyxwire:flavor', ({ detail }) => {
|
|
115
|
+
console.log(detail.flavor, detail.resolved, detail.theme, detail.accent)
|
|
116
|
+
// 'twilight' 'twilight' 'dark' 'matrix'
|
|
117
|
+
})
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
`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.
|
|
121
|
+
|
|
122
|
+
### Vue: `useFlavor`
|
|
123
|
+
|
|
124
|
+
```vue
|
|
125
|
+
<script setup lang="ts">
|
|
126
|
+
import { useFlavor } from '@nyxwire/vue'
|
|
127
|
+
|
|
128
|
+
const { flavor, resolvedFlavor, isDark, flavors, setFlavor } = useFlavor()
|
|
129
|
+
</script>
|
|
130
|
+
|
|
131
|
+
<template>
|
|
132
|
+
<button v-for="item in flavors" :key="item.id" @click="setFlavor(item.id)">
|
|
133
|
+
{{ item.label }}
|
|
134
|
+
</button>
|
|
135
|
+
</template>
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
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 `<html>` or on a `target` element. The first call can pass options:
|
|
139
|
+
|
|
140
|
+
```ts
|
|
141
|
+
useFlavor({
|
|
142
|
+
defaults: { dark: 'abyss', light: 'lumen' }, // flavors used by 'auto'
|
|
143
|
+
defaultFlavor: 'auto', // when nothing is stored
|
|
144
|
+
storageKey: 'nyxwire-flavor',
|
|
145
|
+
target: () => document.querySelector<HTMLElement>('#hud'), // null applies nothing
|
|
146
|
+
storage: window.localStorage, // or null to keep the choice in memory
|
|
147
|
+
matchMedia: (query) => window.matchMedia(query),
|
|
148
|
+
runtime: window.nyxwire, // or null to force standalone mode
|
|
149
|
+
})
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
It is SSR-safe: nothing touches `window` or `document` until a component mounts.
|
|
153
|
+
|
|
154
|
+
## No flash of the wrong flavor
|
|
155
|
+
|
|
156
|
+
The runtime is a small inline script in `<head>` that runs before the first paint, so the stored flavor is already on `<html>` 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.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Icons
|
|
2
|
+
|
|
3
|
+
> Lucide icons through @lucide/vue, sized by the component around them and hidden from assistive technology unless they carry meaning.
|
|
4
|
+
|
|
5
|
+
Nyxwire uses [Lucide](https://lucide.dev/) through `@lucide/vue`, a dependency of `@nyxwire/vue`: one stroked set, 24×24 grid, 2px stroke, ISC licensed. Icons are Vue components bundled with your app, so nothing loads from the network.
|
|
6
|
+
|
|
7
|
+
_Live example: [Icons](https://nyxwire.dissidence.ovh/foundations/icons/)._
|
|
8
|
+
|
|
9
|
+
## Use
|
|
10
|
+
|
|
11
|
+
```vue
|
|
12
|
+
<script setup lang="ts">
|
|
13
|
+
import { Map, MapIcon, Zap } from '@lucide/vue'
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<button class="nw-btn nw-btn-primary"><Zap />Overclock</button>
|
|
18
|
+
<button class="nw-btn nw-btn-ghost nw-btn-neutral nw-btn-icon" aria-label="Open map">
|
|
19
|
+
<MapIcon />
|
|
20
|
+
</button>
|
|
21
|
+
</template>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Every icon is exported under its name and with an `Icon` suffix (`Map` and `MapIcon`); the suffixed form avoids shadowing globals such as `Map`.
|
|
25
|
+
|
|
26
|
+
## Size and color
|
|
27
|
+
|
|
28
|
+
| Prop | Default | Notes |
|
|
29
|
+
| -------------------- | -------------- | --------------------------------------------------- |
|
|
30
|
+
| `size` | `24` | Sets `width` and `height` |
|
|
31
|
+
| `stroke-width` | `2` | In icon units, so it scales with the icon |
|
|
32
|
+
| `non-scaling-stroke` | `false` | Keeps the stroke width constant at any size |
|
|
33
|
+
| `color` | `currentColor` | The stroke; usually leave it and set the text color |
|
|
34
|
+
|
|
35
|
+
Inside Nyxwire components you rarely set `size`: the CSS sizes direct `svg` children to the text. Buttons use 1.2em (an icon button is square at the control height), badges 1em, and a stat icon fills its 20px box in the stat's intent color. Elsewhere, use 16px next to small text, 20px next to body text and 24px for standalone icons. Each icon also gets the classes `lucide` and `lucide-<name>` for styling.
|
|
36
|
+
|
|
37
|
+
## Accessibility
|
|
38
|
+
|
|
39
|
+
- Lucide adds `aria-hidden="true"` automatically unless you pass an `aria-*` attribute, `role` or `title`, so an icon next to a text label is ignored by screen readers, as it should be.
|
|
40
|
+
- An icon-only button needs a name on the button: `aria-label="Open map"`.
|
|
41
|
+
- A standalone icon that carries meaning (a status, a warning) gets `role="img"` and an `aria-label`, or visible text next to it.
|
|
42
|
+
|
|
43
|
+
## Outside Vue
|
|
44
|
+
|
|
45
|
+
These docs use Starlight's `<Icon>` component. On plain HTML pages, copy the SVG markup of a Lucide icon from lucide.dev into the page; the `nw-btn`, `nw-badge` and `nw-stat-icon` classes size inline `svg` elements the same way.
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# Palette
|
|
2
|
+
|
|
3
|
+
> Every Nyxwire color in all four flavors, generated from @nyxwire/palette with hex, RGB, OKLCH and contrast against the flavor's base.
|
|
4
|
+
|
|
5
|
+
Each flavor has 24 named colors: twelve neutrals and twelve accents. The names are the API; the values are tuned per flavor. Colors were designed in OKLCH, gamut-mapped, and frozen as hex, the canonical form. RGB and OKLCH below are derived from that hex, and every table on this page is generated from the published package at build time.
|
|
6
|
+
|
|
7
|
+
**Neutrals**, darkest to lightest on dark flavors: `crust`, `mantle` and `base` are backgrounds; `surface0` to `surface2` are raised fills; `overlay0` to `overlay2` are lines and icons; `subtext0`, `subtext1` and `text` are text. Lumen runs the background ramp the other way (`crust` lightest around the edges, `base` the page). **Accents** are identical across the three dark flavors; Lumen has a deeper set that stays readable on light backgrounds.
|
|
8
|
+
|
|
9
|
+
The last column is the WCAG contrast ratio against the flavor's `base`. Ratios are truncated, never rounded up, and badges mark AAA (7:1), AA (4.5:1) and AA large text or UI (3:1). Backgrounds and hairlines sit below 3:1 by design.
|
|
10
|
+
|
|
11
|
+
## Abyss
|
|
12
|
+
|
|
13
|
+
The deepest dark: near-black indigo with the highest contrast, for dense dashboards and HUD frames.
|
|
14
|
+
|
|
15
|
+
| Color | CSS variable | Hex | RGB | OKLCH | Contrast vs base |
|
|
16
|
+
| --- | --- | --- | --- | --- | --- |
|
|
17
|
+
| Crust | `--nw-crust` | `#030312` | 3 3 18 | `oklch(11.2% 0.039 278.1)` | 1.03 below 3:1 |
|
|
18
|
+
| Mantle | `--nw-mantle` | `#050419` | 5 4 25 | `oklch(12.8% 0.048 280.4)` | 1.02 below 3:1 |
|
|
19
|
+
| Base | `--nw-base` | `#080720` | 8 7 32 | `oklch(15.0% 0.052 280.2)` | base |
|
|
20
|
+
| Surface 0 | `--nw-surface0` | `#12122f` | 18 18 47 | `oklch(20.1% 0.056 280.1)` | 1.08 below 3:1 |
|
|
21
|
+
| Surface 1 | `--nw-surface1` | `#1b1c3b` | 27 28 59 | `oklch(24.4% 0.058 279.8)` | 1.20 below 3:1 |
|
|
22
|
+
| Surface 2 | `--nw-surface2` | `#262747` | 38 39 71 | `oklch(28.9% 0.058 280.8)` | 1.37 below 3:1 |
|
|
23
|
+
| Overlay 0 | `--nw-overlay0` | `#3e415f` | 62 65 95 | `oklch(38.6% 0.051 279.3)` | 2.00 below 3:1 |
|
|
24
|
+
| Overlay 1 | `--nw-overlay1` | `#646781` | 100 103 129 | `oklch(52.1% 0.041 279.7)` | 3.57 AA large |
|
|
25
|
+
| Overlay 2 | `--nw-overlay2` | `#82849b` | 130 132 155 | `oklch(62.0% 0.035 281.4)` | 5.39 AA |
|
|
26
|
+
| Subtext 0 | `--nw-subtext0` | `#aeb0c1` | 174 176 193 | `oklch(76.1% 0.024 280.5)` | 9.21 AAA |
|
|
27
|
+
| Subtext 1 | `--nw-subtext1` | `#d0d2dd` | 208 210 221 | `oklch(86.5% 0.015 277.8)` | 13.13 AAA |
|
|
28
|
+
| Text | `--nw-text` | `#f0f1f7` | 240 241 247 | `oklch(95.9% 0.008 278.6)` | 17.54 AAA |
|
|
29
|
+
| Indigo | `--nw-indigo` | `#848fff` | 132 143 255 | `oklch(69.2% 0.163 277.0)` | 6.92 AA |
|
|
30
|
+
| Iris | `--nw-iris` | `#cdc0ff` | 205 192 255 | `oklch(84.0% 0.088 293.9)` | 11.85 AAA |
|
|
31
|
+
| Flux | `--nw-flux` | `#d071ff` | 208 113 255 | `oklch(71.3% 0.214 313.1)` | 7.05 AAA |
|
|
32
|
+
| Synth | `--nw-synth` | `#ff47d8` | 255 71 216 | `oklch(70.9% 0.260 338.0)` | 6.73 AA |
|
|
33
|
+
| Alarm | `--nw-alarm` | `#ff5d7b` | 255 93 123 | `oklch(69.8% 0.197 12.8)` | 6.69 AA |
|
|
34
|
+
| Flare | `--nw-flare` | `#ff9845` | 255 152 69 | `oklch(77.3% 0.156 56.2)` | 9.25 AAA |
|
|
35
|
+
| Volt | `--nw-volt` | `#f8e445` | 248 228 69 | `oklch(90.9% 0.170 101.9)` | 15.23 AAA |
|
|
36
|
+
| Matrix | `--nw-matrix` | `#4bf677` | 75 246 119 | `oklch(85.9% 0.220 148.0)` | 13.89 AAA |
|
|
37
|
+
| Circuit | `--nw-circuit` | `#17edd5` | 23 237 213 | `oklch(85.0% 0.150 182.0)` | 13.29 AAA |
|
|
38
|
+
| Ice | `--nw-ice` | `#5eddfe` | 94 221 254 | `oklch(83.9% 0.120 217.9)` | 12.48 AAA |
|
|
39
|
+
| Arc | `--nw-arc` | `#4aa9ff` | 74 169 255 | `oklch(71.7% 0.154 248.9)` | 7.92 AAA |
|
|
40
|
+
| Steel | `--nw-steel` | `#b5bdd5` | 181 189 213 | `oklch(80.0% 0.035 270.9)` | 10.55 AAA |
|
|
41
|
+
|
|
42
|
+
## Nocturne
|
|
43
|
+
|
|
44
|
+
The default dark: deep electric indigo. Websites and docs start here.
|
|
45
|
+
|
|
46
|
+
| Color | CSS variable | Hex | RGB | OKLCH | Contrast vs base |
|
|
47
|
+
| --- | --- | --- | --- | --- | --- |
|
|
48
|
+
| Crust | `--nw-crust` | `#0a0329` | 10 3 41 | `oklch(15.1% 0.075 283.5)` | 1.07 below 3:1 |
|
|
49
|
+
| Mantle | `--nw-mantle` | `#0e0533` | 14 5 51 | `oklch(17.3% 0.085 282.8)` | 1.04 below 3:1 |
|
|
50
|
+
| Base | `--nw-base` | `#14093e` | 20 9 62 | `oklch(20.1% 0.094 283.5)` | base |
|
|
51
|
+
| Surface 0 | `--nw-surface0` | `#1d154c` | 29 21 76 | `oklch(24.5% 0.097 283.3)` | 1.11 below 3:1 |
|
|
52
|
+
| Surface 1 | `--nw-surface1` | `#272258` | 39 34 88 | `oklch(29.1% 0.094 283.1)` | 1.27 below 3:1 |
|
|
53
|
+
| Surface 2 | `--nw-surface2` | `#302d60` | 48 45 96 | `oklch(32.9% 0.088 283.1)` | 1.46 below 3:1 |
|
|
54
|
+
| Overlay 0 | `--nw-overlay0` | `#464673` | 70 70 115 | `oklch(41.5% 0.074 282.7)` | 2.09 below 3:1 |
|
|
55
|
+
| Overlay 1 | `--nw-overlay1` | `#6c6d93` | 108 109 147 | `oklch(54.9% 0.059 283.1)` | 3.73 AA large |
|
|
56
|
+
| Overlay 2 | `--nw-overlay2` | `#8b8cab` | 139 140 171 | `oklch(65.0% 0.046 283.6)` | 5.65 AA |
|
|
57
|
+
| Subtext 0 | `--nw-subtext0` | `#b2b4ca` | 178 180 202 | `oklch(77.5% 0.031 281.5)` | 9.02 AAA |
|
|
58
|
+
| Subtext 1 | `--nw-subtext1` | `#d4d4e3` | 212 212 227 | `oklch(87.4% 0.021 286.0)` | 12.58 AAA |
|
|
59
|
+
| Text | `--nw-text` | `#f2f3fa` | 242 243 250 | `oklch(96.5% 0.009 279.7)` | 16.66 AAA |
|
|
60
|
+
| Indigo | `--nw-indigo` | `#848fff` | 132 143 255 | `oklch(69.2% 0.163 277.0)` | 6.46 AA |
|
|
61
|
+
| Iris | `--nw-iris` | `#cdc0ff` | 205 192 255 | `oklch(84.0% 0.088 293.9)` | 11.05 AAA |
|
|
62
|
+
| Flux | `--nw-flux` | `#d071ff` | 208 113 255 | `oklch(71.3% 0.214 313.1)` | 6.57 AA |
|
|
63
|
+
| Synth | `--nw-synth` | `#ff47d8` | 255 71 216 | `oklch(70.9% 0.260 338.0)` | 6.27 AA |
|
|
64
|
+
| Alarm | `--nw-alarm` | `#ff5d7b` | 255 93 123 | `oklch(69.8% 0.197 12.8)` | 6.24 AA |
|
|
65
|
+
| Flare | `--nw-flare` | `#ff9845` | 255 152 69 | `oklch(77.3% 0.156 56.2)` | 8.63 AAA |
|
|
66
|
+
| Volt | `--nw-volt` | `#f8e445` | 248 228 69 | `oklch(90.9% 0.170 101.9)` | 14.20 AAA |
|
|
67
|
+
| Matrix | `--nw-matrix` | `#4bf677` | 75 246 119 | `oklch(85.9% 0.220 148.0)` | 12.95 AAA |
|
|
68
|
+
| Circuit | `--nw-circuit` | `#17edd5` | 23 237 213 | `oklch(85.0% 0.150 182.0)` | 12.39 AAA |
|
|
69
|
+
| Ice | `--nw-ice` | `#5eddfe` | 94 221 254 | `oklch(83.9% 0.120 217.9)` | 11.63 AAA |
|
|
70
|
+
| Arc | `--nw-arc` | `#4aa9ff` | 74 169 255 | `oklch(71.7% 0.154 248.9)` | 7.38 AAA |
|
|
71
|
+
| Steel | `--nw-steel` | `#b5bdd5` | 181 189 213 | `oklch(80.0% 0.035 270.9)` | 9.84 AAA |
|
|
72
|
+
|
|
73
|
+
## Twilight
|
|
74
|
+
|
|
75
|
+
The softest dark: dusky violet-indigo with the lightest dark base, for long reading sessions.
|
|
76
|
+
|
|
77
|
+
| Color | CSS variable | Hex | RGB | OKLCH | Contrast vs base |
|
|
78
|
+
| --- | --- | --- | --- | --- | --- |
|
|
79
|
+
| Crust | `--nw-crust` | `#1b1136` | 27 17 54 | `oklch(21.5% 0.069 292.0)` | 1.13 below 3:1 |
|
|
80
|
+
| Mantle | `--nw-mantle` | `#211540` | 33 21 64 | `oklch(23.9% 0.078 292.3)` | 1.07 below 3:1 |
|
|
81
|
+
| Base | `--nw-base` | `#271a4b` | 39 26 75 | `oklch(26.5% 0.087 291.6)` | base |
|
|
82
|
+
| Surface 0 | `--nw-surface0` | `#312457` | 49 36 87 | `oklch(30.5% 0.089 292.1)` | 1.13 below 3:1 |
|
|
83
|
+
| Surface 1 | `--nw-surface1` | `#3b2f61` | 59 47 97 | `oklch(34.4% 0.085 292.4)` | 1.32 below 3:1 |
|
|
84
|
+
| Surface 2 | `--nw-surface2` | `#453b6a` | 69 59 106 | `oklch(38.5% 0.079 292.1)` | 1.56 below 3:1 |
|
|
85
|
+
| Overlay 0 | `--nw-overlay0` | `#59517a` | 89 81 122 | `oklch(46.0% 0.066 292.5)` | 2.15 below 3:1 |
|
|
86
|
+
| Overlay 1 | `--nw-overlay1` | `#7c7799` | 124 119 153 | `oklch(58.6% 0.052 291.5)` | 3.71 AA large |
|
|
87
|
+
| Overlay 2 | `--nw-overlay2` | `#9793af` | 151 147 175 | `oklch(67.6% 0.041 291.8)` | 5.32 AA |
|
|
88
|
+
| Subtext 0 | `--nw-subtext0` | `#bab7cd` | 186 183 205 | `oklch(78.9% 0.031 291.9)` | 8.04 AAA |
|
|
89
|
+
| Subtext 1 | `--nw-subtext1` | `#d9d7e4` | 217 215 228 | `oklch(88.5% 0.018 293.1)` | 11.07 AAA |
|
|
90
|
+
| Text | `--nw-text` | `#f5f4fa` | 245 244 250 | `oklch(97.0% 0.008 293.9)` | 14.37 AAA |
|
|
91
|
+
| Indigo | `--nw-indigo` | `#848fff` | 132 143 255 | `oklch(69.2% 0.163 277.0)` | 5.50 AA |
|
|
92
|
+
| Iris | `--nw-iris` | `#cdc0ff` | 205 192 255 | `oklch(84.0% 0.088 293.9)` | 9.41 AAA |
|
|
93
|
+
| Flux | `--nw-flux` | `#d071ff` | 208 113 255 | `oklch(71.3% 0.214 313.1)` | 5.60 AA |
|
|
94
|
+
| Synth | `--nw-synth` | `#ff47d8` | 255 71 216 | `oklch(70.9% 0.260 338.0)` | 5.34 AA |
|
|
95
|
+
| Alarm | `--nw-alarm` | `#ff5d7b` | 255 93 123 | `oklch(69.8% 0.197 12.8)` | 5.31 AA |
|
|
96
|
+
| Flare | `--nw-flare` | `#ff9845` | 255 152 69 | `oklch(77.3% 0.156 56.2)` | 7.35 AAA |
|
|
97
|
+
| Volt | `--nw-volt` | `#f8e445` | 248 228 69 | `oklch(90.9% 0.170 101.9)` | 12.11 AAA |
|
|
98
|
+
| Matrix | `--nw-matrix` | `#4bf677` | 75 246 119 | `oklch(85.9% 0.220 148.0)` | 11.04 AAA |
|
|
99
|
+
| Circuit | `--nw-circuit` | `#17edd5` | 23 237 213 | `oklch(85.0% 0.150 182.0)` | 10.56 AAA |
|
|
100
|
+
| Ice | `--nw-ice` | `#5eddfe` | 94 221 254 | `oklch(83.9% 0.120 217.9)` | 9.92 AAA |
|
|
101
|
+
| Arc | `--nw-arc` | `#4aa9ff` | 74 169 255 | `oklch(71.7% 0.154 248.9)` | 6.29 AA |
|
|
102
|
+
| Steel | `--nw-steel` | `#b5bdd5` | 181 189 213 | `oklch(80.0% 0.035 270.9)` | 8.38 AAA |
|
|
103
|
+
|
|
104
|
+
## Lumen
|
|
105
|
+
|
|
106
|
+
The light flavor: lavender daylight with a deeper accent set.
|
|
107
|
+
|
|
108
|
+
| Color | CSS variable | Hex | RGB | OKLCH | Contrast vs base |
|
|
109
|
+
| --- | --- | --- | --- | --- | --- |
|
|
110
|
+
| Crust | `--nw-crust` | `#d3cefa` | 211 206 250 | `oklch(87.0% 0.061 290.3)` | 1.23 below 3:1 |
|
|
111
|
+
| Mantle | `--nw-mantle` | `#dedaff` | 222 218 255 | `oklch(90.3% 0.050 290.3)` | 1.10 below 3:1 |
|
|
112
|
+
| Base | `--nw-base` | `#eae6ff` | 234 230 255 | `oklch(93.6% 0.034 293.1)` | base |
|
|
113
|
+
| Surface 0 | `--nw-surface0` | `#ddd9ff` | 221 217 255 | `oklch(90.0% 0.052 290.1)` | 1.11 below 3:1 |
|
|
114
|
+
| Surface 1 | `--nw-surface1` | `#d1cdf8` | 209 205 248 | `oklch(86.5% 0.059 289.4)` | 1.25 below 3:1 |
|
|
115
|
+
| Surface 2 | `--nw-surface2` | `#c6c1ef` | 198 193 239 | `oklch(83.0% 0.064 289.9)` | 1.40 below 3:1 |
|
|
116
|
+
| Overlay 0 | `--nw-overlay0` | `#b0abd9` | 176 171 217 | `oklch(76.1% 0.066 289.7)` | 1.78 below 3:1 |
|
|
117
|
+
| Overlay 1 | `--nw-overlay1` | `#7c76a4` | 124 118 164 | `oklch(58.9% 0.070 290.1)` | 3.46 AA large |
|
|
118
|
+
| Overlay 2 | `--nw-overlay2` | `#686191` | 104 97 145 | `oklch(51.9% 0.075 290.2)` | 4.65 AA |
|
|
119
|
+
| Subtext 0 | `--nw-subtext0` | `#524a7e` | 82 74 126 | `oklch(44.1% 0.084 289.5)` | 6.53 AA |
|
|
120
|
+
| Subtext 1 | `--nw-subtext1` | `#3d326b` | 61 50 107 | `oklch(36.0% 0.096 289.6)` | 9.24 AAA |
|
|
121
|
+
| Text | `--nw-text` | `#1f0e47` | 31 14 71 | `oklch(23.1% 0.099 290.0)` | 14.24 AAA |
|
|
122
|
+
| Indigo | `--nw-indigo` | `#4940d7` | 73 64 215 | `oklch(48.5% 0.221 276.9)` | 5.75 AA |
|
|
123
|
+
| Iris | `--nw-iris` | `#6746a7` | 103 70 167 | `oklch(48.0% 0.150 295.9)` | 5.73 AA |
|
|
124
|
+
| Flux | `--nw-flux` | `#8c16c5` | 140 22 197 | `oklch(49.9% 0.240 310.0)` | 5.68 AA |
|
|
125
|
+
| Synth | `--nw-synth` | `#a8008b` | 168 0 139 | `oklch(49.6% 0.217 338.3)` | 5.68 AA |
|
|
126
|
+
| Alarm | `--nw-alarm` | `#b6002c` | 182 0 44 | `oklch(49.1% 0.197 20.5)` | 5.70 AA |
|
|
127
|
+
| Flare | `--nw-flare` | `#9d3a00` | 157 58 0 | `oklch(48.2% 0.144 42.7)` | 5.68 AA |
|
|
128
|
+
| Volt | `--nw-volt` | `#6e5700` | 110 87 0 | `oklch(46.7% 0.095 90.9)` | 5.70 AA |
|
|
129
|
+
| Matrix | `--nw-matrix` | `#00680f` | 0 104 15 | `oklch(44.9% 0.147 143.8)` | 5.77 AA |
|
|
130
|
+
| Circuit | `--nw-circuit` | `#006558` | 0 101 88 | `oklch(45.4% 0.082 179.9)` | 5.74 AA |
|
|
131
|
+
| Ice | `--nw-ice` | `#006081` | 0 96 129 | `oklch(45.8% 0.092 230.6)` | 5.77 AA |
|
|
132
|
+
| Arc | `--nw-arc` | `#0055b6` | 0 85 182 | `oklch(46.8% 0.169 257.4)` | 5.80 AA |
|
|
133
|
+
| Steel | `--nw-steel` | `#4d5976` | 77 89 118 | `oklch(46.6% 0.050 267.0)` | 5.74 AA |
|
|
134
|
+
|
|
135
|
+
## Use the values
|
|
136
|
+
|
|
137
|
+
#### JavaScript
|
|
138
|
+
|
|
139
|
+
```ts
|
|
140
|
+
import { flavors, flavorEntries, semanticRoles } from '@nyxwire/palette'
|
|
141
|
+
import type { ColorName, FlavorName } from '@nyxwire/palette'
|
|
142
|
+
|
|
143
|
+
const nocturne = flavors.nocturne
|
|
144
|
+
nocturne.colors.indigo.hex // '#848fff'
|
|
145
|
+
nocturne.colors.indigo.oklch // { l, c, h }
|
|
146
|
+
nocturne.colors[semanticRoles.primary].rgb // { r: 132, g: 143, b: 255 }
|
|
147
|
+
|
|
148
|
+
for (const flavor of flavorEntries) console.log(flavor.id, flavor.dark, flavor.onAccent)
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
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.
|
|
152
|
+
|
|
153
|
+
#### JSON
|
|
154
|
+
|
|
155
|
+
```js
|
|
156
|
+
import palette from '@nyxwire/palette/palette.json' with { type: 'json' }
|
|
157
|
+
|
|
158
|
+
palette.flavors.lumen.colors.base.hex // '#eae6ff'
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
The JSON holds the same data as the JavaScript exports, role maps included.
|
|
162
|
+
|
|
163
|
+
#### CSS
|
|
164
|
+
|
|
165
|
+
```css
|
|
166
|
+
@import '@nyxwire/palette/css';
|
|
167
|
+
|
|
168
|
+
body {
|
|
169
|
+
background: var(--nw-base);
|
|
170
|
+
color: var(--nw-text);
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
`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:
|
|
175
|
+
|
|
176
|
+
```css
|
|
177
|
+
@import '@nyxwire/palette/css/abyss.css';
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
For components, prefer the semantic tokens from `@nyxwire/css` ([Color roles](color-roles.md)) over raw palette variables.
|
|
@@ -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 |
|