Skip to content

refactor(www): upgrade tailwind-variants, drop tailwind-merge and cnfast - #550

Open
mehdibha wants to merge 5 commits into
mainfrom
claude/tailwind-variant-release-a95f42
Open

refactor(www): upgrade tailwind-variants, drop tailwind-merge and cnfast#550
mehdibha wants to merge 5 commits into
mainfrom
claude/tailwind-variant-release-a95f42

Conversation

@mehdibha

Copy link
Copy Markdown
Owner

Summary

Upgrades tailwind-variants to 3.3.0 — the full TypeScript rewrite (heroui-inc/tailwind-variants#301) that vendors the tailwind-merge engine — and consolidates the design system's styling dependencies onto that single package:

  • tailwind-merge removed (www dep + shipped registry deps). It was only ever listed as tv's optional peer; 3.3.0 never imports it at runtime.
  • cnfast removed. cn in registry/lib/utils now wraps tv's own cn, narrowed to string (React Aria className render props reject undefined). The publisher's init-emitted src/lib/utils.ts ships the same wrapper (CN_UTILS_TS, now exported and reused by the publish smoke test's fixture).
  • InferTv adapted in lib/styles.tsx: TVReturnType is now an interface with a 6th E (extend) type param; composed tv objects carry a real extend, so the cast passes TVReturnTypeLike<never, never> | undefined.

Users installing components now get tailwind-variants instead of tailwind-variants + tailwind-merge + cnfast.

Why 3.3.0 is safe (verified)

  • Merge parity: A/B harness ran identical configs through 3.2.2 + tailwind-merge 3.4.0 vs 3.3.0's built-in engine — extend chains (the exact shape createStyles composes for density/params), slots, className overrides, v4 syntax (rounded-(--btn-radius), **:[svg]:) — byte-identical output on every case.
  • cn parity: tv's cn vs cnfast — identical on strings, objects, nested arrays, falsy values, and merge conflicts.
  • Perf: invoking a composed tv function dropped 1.15µs → 0.25µs (~4.6×), extend-chain creation 1.70µs → 1.29µs. This is per-render work across every registry component.
  • Upstream fixes we inherit: variant types lost on extend (feat(create): algorithm picker (oklch / tailwind / material / contrast) #185), compoundSlots+extend (feat: enhance landing page #199), compoundVariants+slots+defaultVariants (refactor(www): decouple accordion from disclosure parts #238), falsy boolean compound variants (refactor(www): reorganize docs + revamp the components gallery (/docs/components) #209). The one behavioral break (empty slots: {} enables slot mode) has zero occurrences here.
  • pnpm build:registry (zero drift in tracked generated output), typecheck, test (235), check all green; the publish smoke test type-checks the full emitted set against the new utils.

Notes

  • Merging is now unconditional — on 3.2.2 it silently turned off if tailwind-merge wasn't installed next to tv.
  • Trade-off: the vendored engine snapshots tailwind-merge's class tables, so recognition of future Tailwind utilities now tracks tv releases. Unknown classes are left untouched, so our custom utilities (focus-ring, cursor-interactive, …) are unaffected. Consumers who use tailwind-merge for their own code will carry both engines (~7KB gzip overlap) — their call.
  • compoundVariants/compoundSlots are now reliable with the runtime extend chains — previously unused in the registry (0/49 styles.ts); style authors can reach for them.

@cursor

cursor Bot commented Jul 31, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
dotui Ready Ready Preview Jul 31, 2026 10:04pm

@github-actions github-actions Bot added area: www The dotui.org app: site, landing, docs pages area: registry Registry source and generated output (www/src/registry) labels Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: registry Registry source and generated output (www/src/registry) area: www The dotui.org app: site, landing, docs pages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant