@biffo/design-tokens 0.152.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.
Files changed (2) hide show
  1. package/package.json +30 -0
  2. package/tokens.css +91 -0
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@biffo/design-tokens",
3
+ "version": "0.152.0",
4
+ "description": "Biffo's design tokens — one definition of the platform's visual language, for the portal, sibling apps and plugin frontends.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/keiranholloway/biffo-template.git",
9
+ "directory": "packages/design-tokens"
10
+ },
11
+ "sideEffects": [
12
+ "*.css"
13
+ ],
14
+ "exports": {
15
+ "./tokens.css": "./tokens.css",
16
+ "./package.json": "./package.json"
17
+ },
18
+ "files": [
19
+ "tokens.css"
20
+ ],
21
+ "publishConfig": {
22
+ "access": "public"
23
+ },
24
+ "scripts": {
25
+ "test": "vitest run"
26
+ },
27
+ "devDependencies": {
28
+ "vitest": "^4.1.0"
29
+ }
30
+ }
package/tokens.css ADDED
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Biffo design tokens — the single definition of the platform's visual
3
+ * language, for the portal, sibling apps and plugin frontends alike.
4
+ *
5
+ * WHY THIS EXISTS
6
+ *
7
+ * These values were previously defined only in one sibling app's `globals.css`
8
+ * — the most downstream repo in the fleet — and every other surface either
9
+ * re-declared them by hand or invented its own. That produced three different
10
+ * brand blues across surfaces a founder sees in one page: the portal's
11
+ * `#5457ee`, the Ideation Engine's `#4338ca`, and whatever a new plugin's
12
+ * skeleton happened to carry. Since plugin frontends are embedded in the portal
13
+ * as same-origin iframes, the difference reads as three different products.
14
+ *
15
+ * HOW IT REACHES A SEPARATELY-DEPLOYED APP
16
+ *
17
+ * Plugin and sibling frontends are their own repos with their own builds; they
18
+ * share no bundler with the portal, so a workspace import cannot reach them.
19
+ * This package is published to npm on every `core-v*` tag at the core version
20
+ * (the same rule as `@biffo/cli` — one number, no mapping table), and consumers
21
+ * take an ordinary dependency:
22
+ *
23
+ * import '@biffo/design-tokens/tokens.css'
24
+ *
25
+ * A runtime `@import` from a CDN URL was the alternative and was rejected: it
26
+ * makes every plugin's appearance depend on a network fetch it does not
27
+ * control, so a CDN blip unstyles the product rather than shipping it stale.
28
+ *
29
+ * CHANGING A TOKEN
30
+ *
31
+ * Values here are consumed by surfaces that deploy independently, so a change
32
+ * lands unevenly: the portal may show the new brand colour before a plugin
33
+ * does. Prefer adding a token over redefining one, and expect a value change to
34
+ * need a release plus one PR per consumer.
35
+ *
36
+ * Consumers must not re-declare these locally. `tokens.test.ts` in this package
37
+ * is the definition's own guard; the consuming repos assert against the
38
+ * published file so a local copy cannot drift back in.
39
+ */
40
+
41
+ :root {
42
+ color-scheme: light;
43
+
44
+ /* ── Surfaces ─────────────────────────────────────────────────────────── */
45
+ --bg: #ffffff;
46
+ --bg-subtle: #f6f7fb;
47
+ --surface: #ffffff;
48
+ --ink: #0b0f24;
49
+ --ink-2: #141a3c;
50
+
51
+ /* ── Text ─────────────────────────────────────────────────────────────── */
52
+ --text: #0f172a;
53
+ --text-muted: #545d72;
54
+ --text-invert: #f8fafc;
55
+ --text-invert-muted: #b6bcd4;
56
+
57
+ /* ── Brand ────────────────────────────────────────────────────────────── */
58
+ --brand: #5457ee;
59
+ --brand-strong: #4043c9;
60
+ --brand-soft: #eef0ff;
61
+ --accent: #22d3ee;
62
+
63
+ /* ── Lines & elevation ────────────────────────────────────────────────── */
64
+ --border: #e7e9f1;
65
+ --border-strong: #d7dae6;
66
+ --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
67
+ --shadow-md: 0 10px 30px -12px rgba(15, 23, 42, 0.18);
68
+ --shadow-lg: 0 30px 60px -24px rgba(15, 23, 42, 0.28);
69
+
70
+ /* ── Shape & rhythm ───────────────────────────────────────────────────── */
71
+ --radius: 14px;
72
+ --radius-lg: 22px;
73
+ --container: 1120px;
74
+ --nav-h: 64px;
75
+
76
+ /* ── Status ───────────────────────────────────────────────────────────────
77
+ *
78
+ * Added here rather than left to each app because every surface that reports
79
+ * a state needs them, and they were being invented per-app. Deliberately
80
+ * muted rather than signal red/amber/green: most Biffo surfaces score or
81
+ * grade something on a scale, where a "good/bad" reading is often wrong (a
82
+ * build-complexity score of 5 means *simple*, not *excellent*). Use these for
83
+ * magnitude and standing; reserve saturated colour for genuine alerts.
84
+ */
85
+ --state-positive: #3f8f6b;
86
+ --state-positive-soft: #e8f5ef;
87
+ --state-caution: #9a7b2f;
88
+ --state-caution-soft: #fdf6e6;
89
+ --state-negative: #8a5a5a;
90
+ --state-negative-soft: #fbeeee;
91
+ }