Skip to content

fix(ui): stop tailwind-merge from dropping text colors on custom font-size tokens - #64

Merged
PAMulligan merged 1 commit into
mainfrom
fix/62-get-started-button-contrast
Aug 25, 2026
Merged

fix(ui): stop tailwind-merge from dropping text colors on custom font-size tokens#64
PAMulligan merged 1 commit into
mainfrom
fix/62-get-started-button-contrast

Conversation

@PAMulligan

Copy link
Copy Markdown
Contributor

Summary

  • Fixes Restyle "Get Started" button text #62 — the onboarding "Get Started" button rendered dark, near-unreadable text on the indigo background.
  • Root cause: the design system's custom fontSize tokens (text-button, text-body, …) are unknown to tailwind-merge's default config, so it classified them as text colors. In Button, text-button (size clause) came after text-brand-fg (variant clause) in cn(), so the white text class was silently dropped — same failure applied to the secondary/ghost variants' text-ink/text-muted.
  • Fix: extendTailwindMerge in cn() declaring the custom font-size class group, so sizes and colors merge independently.

Verification

  • twMerge('bg-brand text-brand-fg …', 'px-5 py-3 text-button') now keeps text-brand-fg; size-vs-size and color-vs-color conflicts still resolve correctly.
  • Screenshotted the onboarding modal in the dev preview: computed button color is rgb(255,255,255) on indigo in both light and dark themes.
  • tsc --noEmit clean; 521/521 vitest tests pass.

🤖 Generated with Claude Code

…-size tokens

The design system's fontSize tokens (text-button, text-body, ...) are unknown
to tailwind-merge's default config, so they fell into the text-color group and
cancelled real color classes in the same cn() call — the primary Button lost
text-brand-fg to text-button, rendering dark inherited ink on the indigo
background. Extend twMerge with the custom font-size class group so size and
color merge independently.

Fixes #62

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@PAMulligan
PAMulligan merged commit 015500c into main Aug 25, 2026
5 checks passed
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.

Restyle "Get Started" button text

1 participant