@orangecheck/design 0.21.0 → 0.22.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/README.md +29 -8
- package/dist/components.js +1 -1
- package/dist/components.js.map +1 -1
- package/dist/components.mjs +1 -1
- package/dist/components.mjs.map +1 -1
- package/dist/composites.js +1 -1
- package/dist/composites.js.map +1 -1
- package/dist/composites.mjs +1 -1
- package/dist/composites.mjs.map +1 -1
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -8
- package/dist/index.mjs.map +1 -1
- package/dist/styles/theme.css +8 -4
- package/dist/styles/themes/ember.css +18 -3
- package/dist/styles/themes/orangecheck.css +6 -6
- package/dist/styles/themes.css +4 -3
- package/dist/tokens.d.mts +1 -1
- package/dist/tokens.d.ts +1 -1
- package/dist/tokens.js +7 -7
- package/dist/tokens.js.map +1 -1
- package/dist/tokens.mjs +7 -7
- package/dist/tokens.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,10 +21,14 @@ Canonical design + rollout plan: `~/Projects/ochk/DESIGN-SYSTEM-PLAN.md`.
|
|
|
21
21
|
|
|
22
22
|
- **Mode** — `light | dark`, owned by `next-themes` via the `.dark` class. Toggle
|
|
23
23
|
with `<ThemeToggle />`. Unchanged from today.
|
|
24
|
-
- **Skin** — a named theme
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
- **Skin** — a named theme, owned by `<OcThemeProvider>` via the `data-oc-theme`
|
|
25
|
+
attribute, persisted in the `oc_skin` cookie at `Domain=.ochk.io` so a choice
|
|
26
|
+
carries across every family site. Pick with `<OcThemePicker />`. Five skins
|
|
27
|
+
ship: **`ember`** — the family **default** (a warm, rounded consumer skin:
|
|
28
|
+
terracotta, 1rem radius, pill buttons, self-hosted Hanken Grotesk; owns the
|
|
29
|
+
bare `:root`/`.dark` base) — plus `orangecheck`, `phosphor`, `lightning`,
|
|
30
|
+
`gold` (the four sharp/flat Bitcoin-ethos alternates, attribute-only arms). A
|
|
31
|
+
skin re-skins color, radius, type, and elevation — not just hue.
|
|
28
32
|
|
|
29
33
|
The two compose: any skin renders in both modes.
|
|
30
34
|
|
|
@@ -65,15 +69,32 @@ Header (gate the picker behind a flag during staged rollout):
|
|
|
65
69
|
```
|
|
66
70
|
|
|
67
71
|
Fonts are still loaded by the app via `next/font` into `--font-sans-display`
|
|
68
|
-
and `--font-mono-display`, exactly as before.
|
|
72
|
+
and `--font-mono-display`, exactly as before — the default skins defer to them.
|
|
73
|
+
A skin may instead **self-host its own font in-package**: `ember` ships Hanken
|
|
74
|
+
Grotesk as a variable woff2 under `src/styles/fonts/`, declared in
|
|
75
|
+
`src/styles/fonts.css` (imported first by `styles.css`). Tailwind v4 (Lightning
|
|
76
|
+
CSS) rebases the relative `url()` on `@import`, so the woff2 emits through every
|
|
77
|
+
consumer's build with **zero per-site `next/font` wiring**; the browser only
|
|
78
|
+
fetches it when ember is the active skin.
|
|
69
79
|
|
|
70
80
|
## Adding a skin
|
|
71
81
|
|
|
72
82
|
1. Add `src/styles/themes/<id>.css` declaring the full token set for both modes
|
|
73
|
-
(under `[data-oc-theme='<id>']` and `[data-oc-theme='<id>'].dark`).
|
|
83
|
+
(under `[data-oc-theme='<id>']` and `[data-oc-theme='<id>'].dark`). Scope every
|
|
84
|
+
selector to the two `[data-oc-theme='<id>']` arms — never touch bare `:root`/
|
|
85
|
+
`.dark`, or you re-skin the default.
|
|
74
86
|
2. `@import` it from `src/styles/themes.css`.
|
|
75
|
-
3. Add a row to `OC_THEMES` in `src/tokens/themes.ts
|
|
76
|
-
|
|
87
|
+
3. Add a row to `OC_THEMES` in `src/tokens/themes.ts` (this auto-populates the
|
|
88
|
+
appearance menu, picker, Storybook toolbar, and favicon recolor).
|
|
89
|
+
4. Add the id to the hardcoded `SKINS` arrays in `scripts/verify-themes.mjs` +
|
|
90
|
+
`scripts/verify-contrast.mjs`, then `yarn verify` (asserts the skin is
|
|
91
|
+
distinct and AA-clean in both modes).
|
|
92
|
+
5. (Optional) self-host a font: see the Hanken Grotesk note above.
|
|
93
|
+
6. Publish. Every site picks it up on the next Renovate bump — no per-site edits.
|
|
94
|
+
|
|
95
|
+
A skin is **opt-in** by default — shipping one makes it a picker option, not the
|
|
96
|
+
default. Changing `DEFAULT_OC_THEME` (family-wide) or a per-site
|
|
97
|
+
`<OcThemeProvider defaultSkin>` is a separate, deliberate flip.
|
|
77
98
|
|
|
78
99
|
## Build
|
|
79
100
|
|
package/dist/components.js
CHANGED
|
@@ -311,7 +311,7 @@ function TwoToneHeading({
|
|
|
311
311
|
}) {
|
|
312
312
|
const Tag = as ?? "h2";
|
|
313
313
|
const leadColor = tone === "onBrand" ? "text-primary-foreground" : "text-foreground";
|
|
314
|
-
const mutedColor = tone === "onBrand" ? "text-primary-foreground/
|
|
314
|
+
const mutedColor = tone === "onBrand" ? "text-primary-foreground/75" : "text-foreground/40";
|
|
315
315
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
316
316
|
Tag,
|
|
317
317
|
{
|