Skip to content

leading classes are getting removed if applied in the middle #573

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

Open
ubaid-myalfred opened this issue May 1, 2025 · 1 comment
Open
Labels
context-v3 Related to tailwind-merge v3

Comments

@ubaid-myalfred
Copy link

Describe the bug

Tailwind merge remove the leading classes if it is applied in the middle of the class. It is only working if I apply it on the end.

To Reproduce

Not working
className='text-[1.5rem]! leading-[1.75rem]! md:text-2xl lg:text-[1.625rem] xl:leading-[2.188rem]! xl:text-3xl! max-w-3xl! text-primary-headingDark80!'

Working
className='text-[1.5rem]! leading-[1.75rem]! md:text-2xl lg:text-[1.625rem] xl:text-3xl! max-w-3xl! text-primary-headingDark80! xl:leading-[2.188rem]!'

Expected behavior

Leading class should be applied but it keeps getting removed

Environment

Tailwindcss v4.1.4
tailwind merge v3.2.0

@github-actions github-actions bot added the context-v3 Related to tailwind-merge v3 label May 1, 2025
@dcastil
Copy link
Owner

dcastil commented May 11, 2025

Hey @ubaid-myalfred! 👋

Just tested it out in https://codesandbox.io/p/sandbox/spjzgc and the only class that gets removed is xl:leading-[2.188rem]!. Are you sure that the problem doesn't come from a different part of your codebase?

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

No branches or pull requests

2 participants