Skip to content

feat(core): add contextual JS class transforms#193

Open
sonofmagic wants to merge 1 commit into
mainfrom
feat/contextual-js-class-transforms
Open

feat(core): add contextual JS class transforms#193
sonofmagic wants to merge 1 commit into
mainfrom
feat/contextual-js-class-transforms

Conversation

@sonofmagic
Copy link
Copy Markdown
Owner

Summary

  • make JS mangling context-aware instead of replacing every string literal/template token
  • add transformer.classFunctions for class helper calls such as cva, tv, clsx, cn, classnames, and twJoin
  • preserve twMerge arguments by default so runtime merge semantics keep original Tailwind classes

Behavior change

This intentionally changes JS transform behavior: arbitrary business strings are no longer mangled, while explicit class contexts and configured class helper functions still are.

Testing

  • pnpm --filter @tailwindcss-mangle/config test
  • pnpm --filter @tailwindcss-mangle/core test
  • pnpm --filter unplugin-tailwindcss-mangle test
  • pnpm --filter @tailwindcss-mangle/config build
  • pnpm --filter @tailwindcss-mangle/core build
  • pnpm --filter unplugin-tailwindcss-mangle build
  • pnpm lint
  • pnpm lint:style

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 3, 2026

⚠️ No Changeset found

Latest commit: bed0e71

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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