Skip to content

fix(tokens): rename base color to dark (kill text-base footgun)#5

Merged
nimkimi merged 1 commit into
mainfrom
fix/issue-3-rename-base-token
Jun 21, 2026
Merged

fix(tokens): rename base color to dark (kill text-base footgun)#5
nimkimi merged 1 commit into
mainfrom
fix/issue-3-rename-base-token

Conversation

@nimkimi

@nimkimi nimkimi commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Root cause (#3)

The palette defined a color token named base, and base is also Tailwind's default font-size key. So .text-base emitted two rules — a font-size and color: #0E0E10. That's the footgun that rendered the Education headings invisible (#4 fixed the symptom at one call site; this fixes the cause).

Fix

Rename the color token basedark. Now text-base is purely a font-size utility and the collision is structurally impossible.

  • Migrated every color call site: bg-base / ring-offset-base / border-base and the deliberate dark-on-lime text-base*-dark.
  • Left the two legitimate sizing uses of text-base (contact input, Toast close button) untouched — now unambiguous.

Tests

  • tests/unit/tailwind-tokens.test.ts — locks the invariant that no color token may share a name with a font-size key. This is the durable guard; it fails on the old base collision and would have caught the original bug.
  • e2e/accent-contrast.spec.ts — asserts the accent CTA + selected segmented-control label still render genuinely dark text on lime (regression guard if text-dark is ever dropped).
  • Existing e2e/about-readability.spec.ts still passes. Full suite: lint ✓, tsc ✓, 240 unit ✓, e2e ✓.

Two latent bugs the footgun was masking (now fixed, verified in-browser)

Removing the silent color also removed text-base's silent size override at a few sites. Two were genuine bugs:

  • "In progress" pill rendered 16px (its text-[10px] was being overridden) → now 10px, matching its neighbouring tags.
  • Selected segmented label rendered 16px vs 14px for the others (a size jump on selection) → now 14px, consistent.

The nav "Let's talk" CTA settles to a 12px label (matching the nav's mono-label scale) — reviewed and chosen over restoring the old 16px.

Closes #3

The palette defined a color named `base`, which is also Tailwind's default
font-size key. So `.text-base` emitted BOTH a font-size AND `color: #0E0E10`
— the footgun that rendered the Education headings invisible (#3, partially
fixed at the call site in #4). Renaming the color token to `dark` makes the
collision structurally impossible: `text-base` is now purely a font size.

- Migrate every color call site: `bg-base`/`ring-offset-base`/`border-base`
  and the deliberate dark-on-lime `text-base` → `*-dark`.
- The two legitimate sizing uses of `text-base` (contact input, Toast close)
  are left untouched — now unambiguous.
- New `tests/unit/tailwind-tokens.test.ts` locks the invariant: no color
  token may share a name with a font-size key (would have caught this).
- New `e2e/accent-contrast.spec.ts` guards that the accent CTA + selected
  segmented label still render dark text on lime.

Removing the footgun also surfaced two latent size bugs it had been masking,
now fixed: the "In progress" pill rendered 16px (its `text-[10px]` was being
overridden), and the selected segmented label rendered 16px vs 14px for the
others (size jump on select). The nav CTA keeps a 12px label.

Closes #3
@vercel

vercel Bot commented Jun 21, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
hackimi Ready Ready Preview, Comment Jun 21, 2026 2:48pm

@nimkimi nimkimi merged commit 69a6b2d into main Jun 21, 2026
5 checks passed
@nimkimi nimkimi deleted the fix/issue-3-rename-base-token branch June 21, 2026 14:51
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.

text-base Tailwind utility collides with the base color token (silent text-invisibility footgun)

1 participant