theming: contract — ban raw hex, forever #139

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

Parent

Standards debt — the contract step of the theming expand–contract. 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.

What to build

With every batch migrated, the door closes: a lint rule bans hex colour literals in component and style code across app, dashboard and ui-kit (tokens only), any stragglers are converted, and the rule runs in CI so the debt cannot re-accrue.

Acceptance criteria

  • The lint rule rejects a hex literal in any component/style source, and CI runs it.
  • Zero hex literals remain outside the brandkit compiler itself (which legitimately emits them).
  • All suites and lint green.

Blocked by

  • theming:migrate-app, theming:migrate-dashboard-core, theming:migrate-dashboard-ops.

Task manifest

task: theming:contract-no-hex
implements_flow: none
implements_edge: "none — contract step"
wireframe: "none; the seam contract IS the design"
interface: "a CI-enforced no-hex lint rule + final straggler conversion"
seam: "lint green in CI; sweep count zero"
acceptance: "see Acceptance criteria above"
depends_on: [theming:migrate-app, theming:migrate-dashboard-core, theming:migrate-dashboard-ops]
out_of_scope: [brandkit compiler internals]
needs_human_decision: []
## Parent Standards debt — the contract step of the theming expand–contract. 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. ## What to build With every batch migrated, the door closes: a lint rule bans hex colour literals in component and style code across app, dashboard and ui-kit (tokens only), any stragglers are converted, and the rule runs in CI so the debt cannot re-accrue. ## Acceptance criteria - [ ] The lint rule rejects a hex literal in any component/style source, and CI runs it. - [ ] Zero hex literals remain outside the brandkit compiler itself (which legitimately emits them). - [ ] All suites and lint green. ## Blocked by - theming:migrate-app, theming:migrate-dashboard-core, theming:migrate-dashboard-ops. ## Task manifest ```yaml task: theming:contract-no-hex implements_flow: none implements_edge: "none — contract step" wireframe: "none; the seam contract IS the design" interface: "a CI-enforced no-hex lint rule + final straggler conversion" seam: "lint green in CI; sweep count zero" acceptance: "see Acceptance criteria above" depends_on: [theming:migrate-app, theming:migrate-dashboard-core, theming:migrate-dashboard-ops] out_of_scope: [brandkit compiler internals] needs_human_decision: [] ```
Author
Owner

Done in 433f3ed (on origin/main). The theming expand–contract is closed.

Lint rule (acceptance 1): new local ESLint rule oc-theming/no-hex-color (eslint-rules/no-hex-color.mjs), wired into eslint.config.mjs for **/*.vue. It rejects any raw hex colour literal in a component <style> block (issue-ref #nnn in CSS comments excluded by construction). CI runs it via pnpm run lint, already in scripts/seam-smoke.sh.

Zero remain (acceptance 2): the two stragglers outside the four migration batches — the shared ui-kit CodesLedgerScreen.vue (20 hex) and NavChrome.vue (5 hex + one rgba() fallback) — converted onto the --oc-* tokens with the batches recipe. The whole-repo styling sweep is zero.

Boundary: the ban is on styling. Brand-kit colour data legitimately stays hex — the compiler that emits tokens.css/--oc-* values (dashboard/src/lib/brandkit.ts, app/src/lib/founding.ts, Go internal/brandkit) and the wireframe-dictated seed preset palette (p1-s3-brand-kit.html swatches) + the accent-input example. All colour data in script/template, never in a <style> block, so the styling ban never touches them.

Seam: packages/ui-kit/tests/unit/themingContract.test.ts (7 tests) drives the real rule module over bad/good SFCs and sweeps every .vue <style> block across app, dashboard and ui-kit.

Verified (acceptance 3): lint green, all builds green, all suites green (ui-kit 73, dashboard 601, app 309). STATUS.md updated (header + milestone log).

Done in `433f3ed` (on `origin/main`). The theming expand–contract is **closed**. **Lint rule (acceptance 1):** new local ESLint rule `oc-theming/no-hex-color` (`eslint-rules/no-hex-color.mjs`), wired into `eslint.config.mjs` for `**/*.vue`. It rejects any raw hex colour literal in a component `<style>` block (issue-ref `#nnn` in CSS comments excluded by construction). CI runs it via `pnpm run lint`, already in `scripts/seam-smoke.sh`. **Zero remain (acceptance 2):** the two stragglers outside the four migration batches — the shared ui-kit `CodesLedgerScreen.vue` (20 hex) and `NavChrome.vue` (5 hex + one `rgba()` fallback) — converted onto the `--oc-*` tokens with the batches recipe. The whole-repo styling sweep is zero. **Boundary:** the ban is on *styling*. Brand-kit colour *data* legitimately stays hex — the compiler that emits `tokens.css`/`--oc-*` values (`dashboard/src/lib/brandkit.ts`, `app/src/lib/founding.ts`, Go `internal/brandkit`) and the wireframe-dictated seed preset palette (`p1-s3-brand-kit.html` swatches) + the accent-input example. All colour data in script/template, never in a `<style>` block, so the styling ban never touches them. **Seam:** `packages/ui-kit/tests/unit/themingContract.test.ts` (7 tests) drives the real rule module over bad/good SFCs and sweeps every `.vue` `<style>` block across app, dashboard and ui-kit. **Verified (acceptance 3):** lint green, all builds green, all suites green (ui-kit 73, dashboard 601, app 309). STATUS.md updated (header + milestone log).
ben closed this issue 2026-07-27 10:28:36 +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#139
No description provided.