@fusion.dev/helix-theme 0.0.8 → 0.0.10
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/README.md +37 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# @fusion.dev/helix-theme
|
|
2
|
+
|
|
3
|
+
The theme derivation engine. Computes a complete, contrast-guaranteed token set
|
|
4
|
+
from a small set of intent inputs.
|
|
5
|
+
|
|
6
|
+
```sh
|
|
7
|
+
npm install @fusion.dev/helix-theme
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
```js
|
|
11
|
+
import { initTheme } from '@fusion.dev/helix-theme'
|
|
12
|
+
|
|
13
|
+
const engine = await initTheme('/helix/theme.wasm')
|
|
14
|
+
const theme = engine.derive({ brand: '#3b82f6' }, [':root'])
|
|
15
|
+
|
|
16
|
+
document.head.append(Object.assign(document.createElement('style'), {
|
|
17
|
+
textContent: theme.css[':root'],
|
|
18
|
+
}))
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Give it what you mean — a brand color, and whatever else you have an opinion
|
|
22
|
+
about — and it returns every token the system needs with the contrast
|
|
23
|
+
relationships already satisfied, rather than a palette you then have to check.
|
|
24
|
+
|
|
25
|
+
**It has to be awaited and there is no way around that.** WebAssembly
|
|
26
|
+
instantiates asynchronously, so the engine is handed back from `initTheme`
|
|
27
|
+
rather than being importable: you cannot hold one without having waited for it.
|
|
28
|
+
|
|
29
|
+
The derivation is Rust and ships as WASM, so the same arithmetic runs in a
|
|
30
|
+
browser, in a build step and in the CLI, rather than two implementations
|
|
31
|
+
disagreeing by construction.
|
|
32
|
+
|
|
33
|
+
Zero dependencies and zero peers: it computes values and touches no DOM.
|
|
34
|
+
|
|
35
|
+
[Documentation](https://helix.fusion.dev) · [Theme builder](https://helix.fusion.dev/theme)
|
|
36
|
+
|
|
37
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fusion.dev/helix-theme",
|
|
3
3
|
"description": "Theme derivation engine. Computes a complete, contrast-guaranteed token set from intent inputs.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.10",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Ross Sheppard <ross.sheppard@fusion.dev>",
|
|
7
7
|
"repository": {
|