Skip to content

refactor(css): tokenize index.css value-exact literals (#3, option 2)#102

Merged
miquelmatoses merged 1 commit into
mainfrom
refactor/indexcss-tokens
Jun 22, 2026
Merged

refactor(css): tokenize index.css value-exact literals (#3, option 2)#102
miquelmatoses merged 1 commit into
mainfrom
refactor/indexcss-tokens

Conversation

@miquelmatoses

Copy link
Copy Markdown
Collaborator

Third PR of the Phase 18 consolidation program. Value-preserving: every replacement is an exact-value mm-design token.

Replaced (11 literals)

Body bg -> --mm-color-background; table-header text -> --mm-color-white; prose text/headings -> --mm-color-gray-700/900/600; strong -> --mm-color-text-primary; borders -> --mm-color-gray-200; muted text -> --mm-color-gray-500; stat-card bg -> --mm-color-gray-50; callout accent borders -> --mm-color-blue/red/green.

The two #ffffff uses were deliberately mapped to different tokens (background vs white) so page background and text-on-blue do not couple.

Semantic-mismatch flags

None withheld. The only coupling risk (#ffffff serving two roles) was resolved by splitting it into the two semantically correct tokens above, rather than collapsing both to one.

Documented exception (left raw)

The bespoke prose-callout palette (11 background/text shades: #1e3a5f #1a3a6b #eff4ff #1e3a6e #fff0f0 #7a1f22 #f0f7f0 #264726 #d4a800 #fffbea #5c4500) has no exact mm-design token. Left as raw literals with a comment block explaining the deferred cross-repo promotion (dep pinned v0.2.0). Exception, not drift.

Gates

  • npm test -- --run: 248 passed
  • npm run build: green

🤖 Generated with Claude Code

…e-callout exception

Audit item #3, option 2 (partial tokenize + documented exception).

Replaced the 11 raw literals that map to an exact-value mm-design token and are
semantically coherent:
- #ffffff body background  -> var(--mm-color-background)
- #ffffff table-header text -> var(--mm-color-white)
- #374151 prose body text  -> var(--mm-color-gray-700)
- #111827 prose h2         -> var(--mm-color-gray-900)
- #4b5563 prose h3         -> var(--mm-color-gray-600)
- #111111 prose strong     -> var(--mm-color-text-primary)
- #e5e7eb borders (x4)     -> var(--mm-color-gray-200)
- #6b7280 muted text (x2)  -> var(--mm-color-gray-500)
- #f9fafb stat-card bg     -> var(--mm-color-gray-50)
- #0047ba callout border   -> var(--mm-color-blue)
- #cf3339 callout border   -> var(--mm-color-red)
- #427c42 callout border   -> var(--mm-color-green)

The two #ffffff uses were mapped to different tokens on purpose (background vs
white) so page background and text-on-blue do not couple to one token.

Left as documented raw literals (no exact mm-design token): the bespoke
prose-callout palette of 11 background/text shades. A comment block above the
prose section explains the deferred-promotion exception (cross-repo, dep pinned
v0.2.0).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@miquelmatoses miquelmatoses merged commit 9b04605 into main Jun 22, 2026
7 checks passed
@miquelmatoses miquelmatoses deleted the refactor/indexcss-tokens branch June 22, 2026 22:32
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