Skip to content

feat(ui): consolidate grid-control colors into the --pretable-* theme contract#170

Merged
blove merged 8 commits into
mainfrom
theming-token-consolidation
Jun 8, 2026
Merged

feat(ui): consolidate grid-control colors into the --pretable-* theme contract#170
blove merged 8 commits into
mainfrom
theming-token-consolidation

Conversation

@blove

@blove blove commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Moves the 11 grid-control colors that grid.css depends on out of the undocumented --pt-color-* namespace into the documented --pretable-* theme contract, so the documented consumer recipe (theme.css + grid.css) yields a fully-themed grid.

The bug this fixes: grid.css consumed 11 --pt-color-* tokens (checkbox ×4, selection overlay, focus-ring, resize ×2, reorder ×3) that are defined only in tokens.css (the Alpenglow website palette) — not in any theme file, not in the documented contract, and not imported by the documented recipe. A consumer following the recipe got an unstyled checkbox, no selection background, an invisible resize handle, and a broken reorder ghost. The bench was already running those controls on undefined values; only the website worked, by accident, because it also imports tokens.css.

Changes

  • 10 new derived --pretable-* tokens added to each theme (material.css, excel.css), derived from each theme's existing accent/rule/bg tokens so they auto-adapt (incl. Material dark).
  • 1 dedupe: --pt-color-focus-ring → reuse existing --pretable-focus-ring.
  • grid.css: all 16 var(--pt-color-*) references repointed to --pretable-*; @layer pretable { :where(…) } structure preserved.
  • tokens.css: removed the 12 now-dead grid-control --pt-color-* declarations (Alpenglow palette + --pt-color-warning left intact).
  • Documented contract grows 24 → 34 tokens.

Testing

  • contract.test.ts: TOKENS extended 24→34; grid.css var-resolution test now runs against both themes; new guard asserts grid.css references no --pt-color-*.
  • @pretable/ui 18/18, website docs 21/21 green locally.
  • No exported TS symbols change (api:check unaffected).

Spec: docs/superpowers/specs/2026-06-07-grid-token-consolidation-design.md
Plan: docs/superpowers/plans/2026-06-07-grid-token-consolidation.md

🤖 Generated with Claude Code

blove and others added 8 commits June 7, 2026 15:40
Move the 11 grid-control colors grid.css depends on out of the undocumented
--pt-color-* namespace (defined only in the Alpenglow tokens.css, unreachable by
the documented theme+grid.css recipe) into the --pretable-* theme contract,
theme-derived. Fixes a real contract bug (documented recipe → undefined
checkbox/selection/resize/reorder colors) and grows the contract 24→34. Guards
via contract.test.ts (token list + both-theme var-resolution + no-pt-color check).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4-task plan: define 10 derived grid-control tokens in both themes + extend
contract TOKENS (T1); repoint grid.css via s/--pt-color-/--pretable-/ + both-theme
resolution guard + no-pt-color guard (T2); delete dead tokens from tokens.css
(T3); document in token-reference.mdx (T4).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Defines 10 grid-control tokens (checkbox/selection/resize/reorder) in both themes,
derived from each theme's accent/bg/rule so they recolor coherently and adapt to
dark mode. Extends contract.test.ts so every theme must define them.
Renames the 16 var(--pt-color-*) refs to --pretable-* (focus-ring dedupes onto
the existing --pretable-focus-ring). Adds a guard that grid.css references no
--pt-color-*, and verifies grid.css's --pretable-* deps resolve under BOTH themes
(was excel-only) — proving the documented recipe yields a fully-themed grid.
The grid-control --pt-color-* (checkbox/selection/resize/reorder/focus-ring) now
live in the --pretable-* theme contract; remove their now-unreferenced
declarations from the Alpenglow palette file. Non-grid --pt-color-* (e.g. warning)
are untouched.
…ference

Replaces fabricated per-theme hex (old M3 purple seed) with the real derivation
expressions, fixes the CSS-only count (22→32), and lists --pretable-bg-header in
the derives-from note.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
pretable Ignored Ignored Jun 8, 2026 3:27pm

Request Review

@blove blove enabled auto-merge (squash) June 8, 2026 15:28
@blove blove merged commit 9de93bc into main Jun 8, 2026
13 checks passed
@blove blove deleted the theming-token-consolidation branch June 8, 2026 15:29
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Vercel preview ready

Preview: https://pretable-fq16fchl6-cacheplane.vercel.app
Commit: 453ced12191384d344911612a9926436e16f6a5c

Updated automatically by the deploy-preview job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant