@axiapps/axi-design 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 darkharasho
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 ADDED
@@ -0,0 +1,121 @@
1
+ # axi-design
2
+
3
+ The design language for the [axi suite](https://axi.wiki) — flat and outlined,
4
+ dark, drawn in saturated ink.
5
+
6
+ One CSS file. No build step for consumers, no dependencies, no JavaScript.
7
+
8
+ ## Use it
9
+
10
+ On the web, link the published file:
11
+
12
+ ```html
13
+ <link rel="stylesheet" href="https://darkharasho.github.io/axi-design/v1/axi.css">
14
+ ```
15
+
16
+ In an app that bundles — anything on Vite, and every Electron app in the suite
17
+ — install it and import the stylesheet instead:
18
+
19
+ ```bash
20
+ npm install @axiapps/axi-design
21
+ ```
22
+
23
+ ```js
24
+ import '@axiapps/axi-design/axi.css'
25
+ ```
26
+
27
+ There is a third case: an app that already draws its own components through
28
+ its own CSS variables, and wants to point them at ours rather than be
29
+ rewritten. That app wants the palette without the components:
30
+
31
+ ```js
32
+ import '@axiapps/axi-design/tokens.css'
33
+ ```
34
+
35
+ `--bg-card: var(--axi-surface)` and the like is then the whole port, and the
36
+ values can never drift — which is what happens the moment the token block is
37
+ copied into the consumer by hand.
38
+
39
+ The two are not interchangeable. A `<link>` to the Pages URL is a network
40
+ request at load, which is correct for a site and wrong for a desktop app: an
41
+ Electron window opened offline renders unstyled, and one opened online pays a
42
+ round-trip before it can paint. Bundling resolves the file at build time, so
43
+ the app ships with it.
44
+
45
+ Either way, set your accent:
46
+
47
+ ```css
48
+ :root { --axi-accent: #b06bff; }
49
+ ```
50
+
51
+ That is the whole theming surface. See [the pattern
52
+ gallery](https://darkharasho.github.io/axi-design/) for every component, with a
53
+ live accent switcher.
54
+
55
+ ## Per-instance knobs
56
+
57
+ These custom properties are read with a fallback and never declared on the
58
+ component, so you can set one on a single element or on any ancestor and it
59
+ cascades. They are **not** theme tokens: setting them in `:root` is legal but
60
+ meaningless for most of them, because they answer "how wide is *this* grid",
61
+ not "what does the system look like". Everything else is
62
+ [`docs/RULES.md`](docs/RULES.md) territory.
63
+
64
+ | Knob | Sets | Fallback | Example |
65
+ |---|---|---|---|
66
+ | `--axi-pill-fill` | the fill a pressed `.axi-pill` takes | `var(--axi-accent)` | `<button class="axi-pill" aria-pressed="true" style="--axi-pill-fill: var(--axi-danger)">` |
67
+ | `--axi-switch-fill` | the fill an on `.axi-switch` takes | `var(--axi-accent)` | `<button class="axi-switch" aria-checked="true" style="--axi-switch-fill: var(--axi-danger)">` |
68
+ | `--axi-switch-w` / `--axi-switch-h` / `--axi-switch-knob` | a `.axi-switch`'s track and slug size | `46px` / `26px` / `16px` | `<button class="axi-switch" style="--axi-switch-w: 32px; --axi-switch-h: 18px; --axi-switch-knob: 11px">` |
69
+ | `--axi-card-strip` | the colour of `.axi-card--strip`'s top strip | `var(--axi-accent)` | `<a class="axi-card axi-card--strip" style="--axi-card-strip: var(--axi-ok)">` |
70
+ | `--axi-grid-min` | minimum column width in `.axi-grid` | `300px` | `<div class="axi-grid" style="--axi-grid-min: 240px">` |
71
+ | `--axi-row-gap` | gap between `.axi-row` children | `10px` | `<div class="axi-row" style="--axi-row-gap: 6px">` |
72
+ | `--axi-stack-gap` | gap between `.axi-stack` children | `12px` | `<div class="axi-stack" style="--axi-stack-gap: 20px">` |
73
+ | `--axi-panel-pad` | `.axi-panel`'s own padding | `26px` | `<div class="axi-panel" style="--axi-panel-pad: 14px">` |
74
+ | `--axi-page-pad` | `.axi-page`'s horizontal gutter | `var(--axi-gutter)` | `<div class="axi-page axi-page--narrow" style="--axi-page-pad: 0">` |
75
+ | `--axi-menu-width` | width of `.axi-menu__pop` | `310px` | `<div class="axi-menu__pop" style="--axi-menu-width: 380px">` |
76
+ | `--axi-drawer-width` | width of `.axi-drawer` (capped at `100vw`) | `560px` | `<aside class="axi-drawer" style="--axi-drawer-width: 720px">` |
77
+ | `--axi-series` | the ink a meter fill, bar, plot line or `.axi-diamond--series` is drawn in | `var(--axi-accent)` | `<span class="axi-meter__fill" style="--axi-series: var(--axi-ok)">` |
78
+ | `--axi-meter-v` | how full one `.axi-meter__fill` is | `0%` | `<span class="axi-meter__fill" style="--axi-meter-v: 62%">` |
79
+ | `--axi-meter-h` | height of a `.axi-meter` | `12px` | `<div class="axi-meter" style="--axi-meter-h: 18px">` |
80
+ | `--axi-meter-label` / `--axi-meter-value` | the outer column widths of `.axi-meter-list` | `132px` / `62px` | `<div class="axi-meter-list" style="--axi-meter-label: 180px">` |
81
+ | `--axi-bar-v` | height of one `.axi-bars__col` | `0%` | `<div class="axi-bars__col" style="--axi-bar-v: 78%">` |
82
+ | `--axi-bar-part` | height of one `.axi-bars__part` within its column | `0%` | `<span class="axi-bars__part" style="--axi-bar-part: 40%">` |
83
+ | `--axi-bars-gap` | gap between columns in `.axi-bars` | `6px` | `<div class="axi-bars" style="--axi-bars-gap: 2px">` |
84
+ | `--axi-plot-h` | height of a `.axi-plot` or `.axi-bars` | `180px` | `<div class="axi-plot" style="--axi-plot-h: 240px">` |
85
+ | `--axi-plot-rows` | how many horizontal rules a `.axi-plot` draws | `4` | `<div class="axi-plot" style="--axi-plot-rows: 6">` |
86
+
87
+ `--axi-page-pad: 0` is the one to know about: it is how a measure nested
88
+ inside another measure avoids paying the gutter twice.
89
+
90
+ ## Versioning
91
+
92
+ Published under `v<major>/`, and **`v1/` is append-only** — it will keep
93
+ serving for as long as the Pages site exists. Non-breaking fixes republish
94
+ `v1/axi.css` in place; anything that would break a consumer goes to `v2/`. No
95
+ consumer should ever wake up to a changed class name.
96
+
97
+ npm carries the exact version instead: `@axiapps/axi-design@1.6.0` is that
98
+ build and no other, which is what a lockfile is for. The Pages URL and the
99
+ package therefore answer different questions — "the current v1" and "the
100
+ version I built against" — and a bundling app should always prefer the second.
101
+
102
+ ## Develop
103
+
104
+ ```bash
105
+ npm install
106
+ npm run build # src/*.css -> dist/axi.css
107
+ npx vitest run --pool=forks --poolOptions.forks.maxForks=2
108
+ python3 -m http.server # then open the gallery at /
109
+ ```
110
+
111
+ `dist/axi.css` is committed, because the release workflow publishes that exact
112
+ file. A test asserts it matches its sources, so a source edit that skips the
113
+ rebuild fails rather than shipping stale CSS.
114
+
115
+ The rules the system is built on are in [docs/RULES.md](docs/RULES.md). Read
116
+ them before adding a component.
117
+
118
+ ## Licence
119
+
120
+ MIT. The suite's apps are GPL; the language they are drawn in is not, so
121
+ anything can use it.