Skip to content

fix: cn keeps text-title and text-body next to a text color - #57

Merged
zyx1121 merged 1 commit into
mainfrom
fix/cn-font-size
Oct 7, 2026
Merged

zyx1121 merged 1 commit into
mainfrom
fix/cn-font-size

Conversation

@zyx1121

@zyx1121 zyx1121 commented Oct 7, 2026

Copy link
Copy Markdown
Member

Stock tailwind-merge rules read our custom text-title / text-body as text colors, so cn("text-body", "text-foreground") returned text-foreground and the size was silently dropped in every component that also sets a text color (button, badge, dialog description…). It went unnoticed because the inherited size is also 16px; it showed in #56, where a 24px label rendered at 16px.

  • registry/winlab/lib/utils.ts (the utils item, installed at @/lib/utils) now builds cn with createCn from cn/config, registering title and body as font sizes.
  • All 25 components and blocks import cn from it and list utils as a registry dependency.
  • CI: the check job asserts cn("text-body text-title", "text-foreground") === "text-title text-foreground"; smoke checks the installed lib/utils.ts and button import.

Verified on sandbox: all checks and build pass; cn("text-body", "text-muted-foreground") now keeps both, cn("bg-primary", "bg-muted") still merges to bg-muted.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zyx1121
zyx1121 merged commit e281634 into main Oct 7, 2026
2 checks passed
@zyx1121
zyx1121 deleted the fix/cn-font-size branch October 7, 2026 14:22
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