theming: oc-primitives — the Oc kit and the brand-kit colour picker, connected live #135

Closed
opened 2026-07-26 22:03:58 +00:00 by ben · 1 comment
Owner

Parent

Feature spec: #22 (shell); brand-kit seam (internal/brandkit tokens → --oc-*). Filed from Ben's rulings 2026-07-26 after the review sweep of 6596977..9e946b7: integration-last was deliberate seam-first sequencing — now build the integration layer; and pay all standards debt now. Ben's ruling: connect theming; colour choice becomes a limited palette / set-colour control.

What to build

The promised Oc primitives exist (button, input, field, pill, panel — the set the ui-kit data contract promised with the shell slice) styled exclusively by the existing --oc-* tokens the brandkit seam already compiles. The DS2 brand-kit settings screen offers the limited palette / set-colour choice, compiles it through the brandkit seam, and the primitives re-theme live. This is the expand step — component migration follows in its own tickets.

Acceptance criteria

  • Given the Oc primitives, their styling references only --oc-* tokens — zero hex literals.
  • Given DS2, when the operator picks a palette or sets the colour, then the brandkit seam compiles it and every mounted primitive re-themes without reload.
  • Given an invalid/low-contrast choice, the seam's validation answer is surfaced honestly (the seam already rules on it).

Blocked by

None — can start immediately.

Task manifest

task: theming:oc-primitives
implements_flow: shell
implements_edge: "DS2 set-colour/palette → brandkit compile → live re-theme of the Oc kit"
wireframe: docs/ux/wireframes/shell/shell-ds2-settings-brand-kit.html
interface: "the Oc primitive set in packages/ui-kit, token-only styling, + the DS2 palette/set-colour control over the brandkit seam"
seam: "component tests: primitives restyle from token values alone; DS2 drives the compile through the seam"
acceptance: "see Acceptance criteria above"
depends_on: []
out_of_scope: [migrating existing screens (their own tickets), new token kinds]
needs_human_decision: []
## Parent Feature spec: #22 (shell); brand-kit seam (internal/brandkit tokens → `--oc-*`). Filed from Ben's rulings 2026-07-26 after the review sweep of `6596977..9e946b7`: integration-last was deliberate seam-first sequencing — now build the integration layer; and pay all standards debt now. Ben's ruling: connect theming; colour choice becomes a limited palette / set-colour control. ## What to build The promised Oc primitives exist (button, input, field, pill, panel — the set the ui-kit data contract promised with the shell slice) styled **exclusively** by the existing `--oc-*` tokens the brandkit seam already compiles. The DS2 brand-kit settings screen offers the limited palette / set-colour choice, compiles it through the brandkit seam, and the primitives re-theme live. This is the expand step — component migration follows in its own tickets. ## Acceptance criteria - [ ] Given the Oc primitives, their styling references only `--oc-*` tokens — zero hex literals. - [ ] Given DS2, when the operator picks a palette or sets the colour, then the brandkit seam compiles it and every mounted primitive re-themes without reload. - [ ] Given an invalid/low-contrast choice, the seam's validation answer is surfaced honestly (the seam already rules on it). ## Blocked by None — can start immediately. ## Task manifest ```yaml task: theming:oc-primitives implements_flow: shell implements_edge: "DS2 set-colour/palette → brandkit compile → live re-theme of the Oc kit" wireframe: docs/ux/wireframes/shell/shell-ds2-settings-brand-kit.html interface: "the Oc primitive set in packages/ui-kit, token-only styling, + the DS2 palette/set-colour control over the brandkit seam" seam: "component tests: primitives restyle from token values alone; DS2 drives the compile through the seam" acceptance: "see Acceptance criteria above" depends_on: [] out_of_scope: [migrating existing screens (their own tickets), new token kinds] needs_human_decision: [] ```
Author
Owner

Shipped in 0bb46d0 (on origin/main).

The Oc primitive kit (packages/ui-kit/src/components/): OcButton, OcInput, OcField, OcPill, OcPanel — each styled exclusively by the brandkit seam's --oc-* colour tokens, zero hex literals (a source-level test greps every primitive's <style> and finds none; where the kit owns no foreground colour it uses inherit/currentColor, never a literal). New brandTokens.ts fixes the colour-var contract (OC_COLOR_VARS, mirroring internal/brandkit/token.go's KindColor set) and one applyBrandTokens(tokens) helper that echoes a compiled set onto :root so every mounted primitive re-themes live, no reload. Exported via @ourcloud/ui-kit/Oc*.vue subpaths.

DS2 (BrandKitScreen.vue): the colours field is a limited palette of preset swatches plus a set-colour control (a native colour input behind the wireframe's custom…); every pick compiles through the brandkit seam (compilePreview now returns the --oc-* tokens) and re-themes the live primitives — the editor re-derives no token. A low-contrast choice surfaces the seam's own contrast warning, never a block (ADR 0015).

Acceptance:

  • Oc primitives reference only --oc-* tokens — zero hex (tested in packages/ui-kit/tests/unit/ocPrimitives.test.ts).
  • DS2 palette/set-colour → seam compile → every mounted primitive re-themes without reload (tested in dashboard/tests/unit/brandKitTheming.test.ts, mounting OcButton and asserting :root --oc-accent re-themes).
  • Invalid/low-contrast → the seam's validation surfaced honestly, apply never blocked.

Out of scope (untouched): migrating existing screens (their own tickets), new token kinds.

Evidence: ui-kit 66 tests, dashboard 442, app 214 green; all three vue-tsc builds + eslint clean.

Shipped in `0bb46d0` (on origin/main). **The Oc primitive kit** (`packages/ui-kit/src/components/`): `OcButton`, `OcInput`, `OcField`, `OcPill`, `OcPanel` — each styled **exclusively** by the brandkit seam's `--oc-*` colour tokens, **zero hex literals** (a source-level test greps every primitive's `<style>` and finds none; where the kit owns no foreground colour it uses `inherit`/`currentColor`, never a literal). New `brandTokens.ts` fixes the colour-var contract (`OC_COLOR_VARS`, mirroring `internal/brandkit/token.go`'s `KindColor` set) and one `applyBrandTokens(tokens)` helper that echoes a compiled set onto `:root` so every mounted primitive re-themes live, no reload. Exported via `@ourcloud/ui-kit/Oc*.vue` subpaths. **DS2** (`BrandKitScreen.vue`): the colours field is a limited palette of preset swatches **plus** a set-colour control (a native colour input behind the wireframe's `custom…`); every pick compiles through the brandkit seam (`compilePreview` now returns the `--oc-*` `tokens`) and re-themes the live primitives — the editor re-derives no token. A low-contrast choice surfaces the seam's own contrast **warning**, never a block (ADR 0015). Acceptance: - [x] Oc primitives reference only `--oc-*` tokens — zero hex (tested in `packages/ui-kit/tests/unit/ocPrimitives.test.ts`). - [x] DS2 palette/set-colour → seam compile → every mounted primitive re-themes without reload (tested in `dashboard/tests/unit/brandKitTheming.test.ts`, mounting `OcButton` and asserting `:root --oc-accent` re-themes). - [x] Invalid/low-contrast → the seam's validation surfaced honestly, apply never blocked. Out of scope (untouched): migrating existing screens (their own tickets), new token kinds. Evidence: ui-kit 66 tests, dashboard 442, app 214 green; all three `vue-tsc` builds + eslint clean.
ben closed this issue 2026-07-27 08:52:56 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#135
No description provided.