From f61a766cd00f3f1f7a6fbe1c4cdb74805e2839ee Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 30 Nov 2026 21:05:10 +0000 Subject: [PATCH] Tokens: dark-scheme On colour per accent (onField); DuoIcon: one pair on every surface Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_017btD1e9imKS56Kc2qvU4PY --- .changeset/icon-one-pair.md | 6 ++++++ packages/marketing/README.md | 2 +- packages/marketing/src/lib/duo-roles.ts | 18 +++++++++--------- packages/tokens/scripts/build.ts | 6 ++++-- packages/tokens/src/tokens.ts | 6 ++++-- 5 files changed, 24 insertions(+), 14 deletions(-) create mode 100644 .changeset/icon-one-pair.md diff --git a/.changeset/icon-one-pair.md b/.changeset/icon-one-pair.md new file mode 100644 index 0000000..96ec915 --- /dev/null +++ b/.changeset/icon-one-pair.md @@ -0,0 +1,6 @@ +--- +"@botspace/tokens": minor +"@botspace/marketing": minor +--- + +Tokens: each accent gains `onField`, its dark-scheme On colour (e.g. On Blue), as `accents..onField`, `--color-on--field` and `color.accent..onField`. DuoIcon: every icon now uses one pair on every surface, the accent's `field` body with an `onField` detail (Mayur, 30 Nov 2026). diff --git a/packages/marketing/README.md b/packages/marketing/README.md index a78a0e3..f6c56f1 100644 --- a/packages/marketing/README.md +++ b/packages/marketing/README.md @@ -58,7 +58,7 @@ Under prefers-reduced-motion every part shows its final frame. ## Icons -`DuoIcon` draws BotSpace's own solid duotone icons for products and channels. On a light ground the light layer takes the accent's Material container role and the dark layer its on-container role. On a dark ground pass `mode="dark"`: the body takes tone 60 and the detail tone 95, so every part reads on dark menus. Each icon has a default accent (WhatsApp green, Instagram magenta, Sales green, Support purple, and so on); pass `accent` only to override it. +`DuoIcon` draws BotSpace's own solid duotone icons for products and channels. Every icon uses one colour pair on every surface, light or dark: the body takes the accent's dark-scheme colour (`field`, e.g. Blue) and the detail its dark-scheme On colour (`onField`, e.g. On Blue). Role colours only, never tonal steps. Each icon has a default accent (WhatsApp green, Instagram magenta, Sales green, Support purple, and so on); pass `accent` only to override it. ```tsx import { DuoIcon } from "@botspace/marketing" diff --git a/packages/marketing/src/lib/duo-roles.ts b/packages/marketing/src/lib/duo-roles.ts index ed8a3cb..1abcdf9 100644 --- a/packages/marketing/src/lib/duo-roles.ts +++ b/packages/marketing/src/lib/duo-roles.ts @@ -1,20 +1,20 @@ -// Icon layer colours for the BotSpace accents, read from the tonal palettes in @botspace/tokens. -// Light ground: the body takes the container role (tone 90) and the detail its on-container (tone 10). -// Dark ground: the body takes tone 60 and the detail tone 95, so the detail layer is the brightest and -// parts that sit straight on the ground (an arrow, a handle) never sink into it (Mayur, 30 Nov). +// Icon layer colours for the BotSpace accents, from the accent role tokens in @botspace/tokens. +// One pair on every surface, light or dark (Mayur, 30 Nov 2026): the body is the accent's dark-scheme colour +// (`field`, e.g. Blue) and the detail its dark-scheme On colour (`onField`, e.g. On Blue). Role colours only, +// never tonal steps. `mode` is kept for the ground the icon sits on, and for ink. // Accents are grounds and icon colours only. A colour never stands for an agent or a role. -import { accentPalettes, palettes } from "@botspace/tokens" +import { accents, palettes } from "@botspace/tokens" export type Roles = { container: string; onContainer: string } export type Swatch = { id: string; label: string; base: string; light: Roles; dark: Roles } type Tones = Record -const roles = (p: Tones) => ({ light: { container: p[90], onContainer: p[10] }, dark: { container: p[60], onContainer: p[95] } }) const nv = palettes["neutral-variant"] as Tones -const accent = (id: keyof typeof accentPalettes, label: string): Swatch => { - const p = accentPalettes[id] as Tones - return { id, label, base: p[40], ...roles(p) } +const accent = (id: keyof typeof accents, label: string): Swatch => { + const a = accents[id] + const pair = { container: a.field, onContainer: a.onField } + return { id, label, base: a.base, light: pair, dark: pair } } /** Ink is the neutral pair (the source colours of the icon files); the rest are the brand accents. */ diff --git a/packages/tokens/scripts/build.ts b/packages/tokens/scripts/build.ts index 2e95240..6a0b448 100644 --- a/packages/tokens/scripts/build.ts +++ b/packages/tokens/scripts/build.ts @@ -22,7 +22,8 @@ add("color-sky", sky, "Grid lines on ink and the hero highlight only.") for (const [step, v] of Object.entries(slate)) add(`color-slate-${step}`, v) for (const [name, a] of Object.entries(accents)) { add(`color-${name}`, a.base, `Accent role colour. Marks and illustration, not body text.`) - add(`color-${name}-field`, a.field, `Plain tile ground (dark-scheme role colour).`) + add(`color-${name}-field`, a.field, `Plain tile ground and icon body (dark-scheme role colour).`) + add(`color-on-${name}-field`, a.onField, `Detail on field, e.g. an icon's inner part (dark-scheme On colour).`) add(`color-${name}-container`, a.container, `Accent ground for sections, tiles, images.`) } for (const [name, s] of Object.entries(status)) { @@ -138,7 +139,8 @@ const dtcg: Node = { slate: group(slate, (x) => color(x)), accent: group(accents, (a) => ({ base: color(a.base, "Marks and illustration. Not body text."), - field: color(a.field, "Plain tile ground."), + field: color(a.field, "Plain tile ground and icon body."), + onField: color(a.onField, "Detail on field (dark-scheme On colour)."), container: color(a.container, "Ground for sections, tiles, images. Never mapped to a role."), })), status: group(status, (x) => ({ fill: color(x.fill, "Status only."), text: color(x.text) })), diff --git a/packages/tokens/src/tokens.ts b/packages/tokens/src/tokens.ts index 8aa8337..4e2f645 100644 --- a/packages/tokens/src/tokens.ts +++ b/packages/tokens/src/tokens.ts @@ -44,13 +44,15 @@ export const slate = { const accent = (name: keyof typeof accentPalettes) => { const p = accentPalettes[name] - return { base: p[40], field: p[80], container: p[90] } + return { base: p[40], field: p[80], onField: p[20], container: p[90] } } /** * The six accents, each a tonal palette from a hue in src/seed.ts. * `base` is tone 40 (the light-scheme role colour): grid tiles and marks. - * `field` is tone 80 (the dark-scheme role colour): plain tile grounds (Mayur, 5 Oct 2026). + * `field` is tone 80 (the dark-scheme role colour): plain tile grounds (Mayur, 5 Oct 2026), and the body of every icon. + * `onField` is tone 20 (the dark-scheme On colour, e.g. On Blue): the detail on `field`. Icons use field + onField on + * every surface, light or dark (Mayur, 30 Nov 2026). * `container` is tone 90 (the Container colour): page sections and website tiles. */ export const accents = {