Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.gap-px utility is not merged with .gap-1 #536

Closed
Predota opened this issue Feb 20, 2025 · 2 comments · Fixed by #538
Closed

.gap-px utility is not merged with .gap-1 #536

Predota opened this issue Feb 20, 2025 · 2 comments · Fixed by #538
Labels
bug Something isn't working context-v3 Related to tailwind-merge v3

Comments

@Predota
Copy link

Predota commented Feb 20, 2025

Describe the bug

The .gap-px utility is not merged with .gap-1 as expected when using tailwind-merge. Instead of resolving to a single gap utility, both classes remain, leading to potential styling conflicts.

To Reproduce

  1. Use tailwind-merge to process a class list that includes both .gap-px and .gap-1.
  2. Observe that both classes persist instead of .gap-1 taking precedence.

You can use the following CodeSandbox to reproduce the issue:
https://codesandbox.io/p/sandbox/suspicious-burnell-qx2z9k?file=%2Fsrc%2Findex.ts

Expected behavior

The .gap-1 utility should replace .gap-px in the final merged class list since it has a higher numerical value.

Environment

  • tailwind-merge version: 3.0.1
  • Runtime: Node.js 18
  • Bundler: Parcel 1.12.5
  • TypeScript: 4.4.4
  • Browser: [e.g. Chrome 120, Firefox 118]
@github-actions github-actions bot added the context-v3 Related to tailwind-merge v3 label Feb 20, 2025
@dcastil dcastil added the bug Something isn't working label Feb 22, 2025
@dcastil
Copy link
Owner

dcastil commented Feb 22, 2025

Thanks for all the info, this is indeed a bug. Gonna fix this now.

Copy link

This was addressed in release v3.0.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working context-v3 Related to tailwind-merge v3
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants