@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 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 (`orangecheck` default, `midnight`, …), owned by
25
- `<OcThemeProvider>` via the `data-oc-theme` attribute, persisted in the
26
- `oc_skin` cookie at `Domain=.ochk.io` so a choice carries across every family
27
- site. Pick with `<OcThemePicker />`.
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
- 4. Publish. Every site picks it up on the next Renovate bump — no per-site edits.
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
 
@@ -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/60" : "text-foreground/40";
314
+ const mutedColor = tone === "onBrand" ? "text-primary-foreground/75" : "text-foreground/40";
315
315
  return /* @__PURE__ */ jsxRuntime.jsxs(
316
316
  Tag,
317
317
  {