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

Display class not being removed when it precedes line-clamp-* #345

Closed
Aleuck opened this issue Nov 14, 2023 · 2 comments · Fixed by #347
Closed

Display class not being removed when it precedes line-clamp-* #345

Aleuck opened this issue Nov 14, 2023 · 2 comments · Fixed by #347
Labels
bug Something isn't working context-v2 Related to tailwind-merge v2

Comments

@Aleuck
Copy link

Aleuck commented Nov 14, 2023

Describe the bug

The line-clamp-* depends on having display set to -webkit-box or -webkit-inline-box. Tailwind line-clamp-* sets display: -webkit-box.

Therefore there is no point in keeping other basic display classes like inline, block or inline-block when there is a line-clamp-* afterwards.

However, twMerge keeps Display classes when they are followed by a line clamp class.

To Reproduce

> twMerge('inline-block', 'line-clamp-1')
'inline-block line-clamp-1'
> twMerge('inline', 'line-clamp-2')
'inline line-clamp-2'
> twMerge('block', 'line-clamp-2')
'block line-clamp-2'

Expected behavior

> twMerge('inline-block', 'line-clamp-1')
'line-clamp-1'
> twMerge('inline', 'line-clamp-2')
'line-clamp-2'
> twMerge('block', 'line-clamp-2')
'line-clamp-2'

Environment

  • tailwind-merge version: 2.0.0
@dcastil dcastil added bug Something isn't working context-v2 Related to tailwind-merge v2 labels Nov 16, 2023
@dcastil
Copy link
Owner

dcastil commented Nov 16, 2023

Hey @Aleuck! 👋

You're right. Tailwind also sets overflow: hidden in the line-clamp classes, so overflow classes should be removed, too. I'll fix this in the coming days.

Copy link

github-actions bot commented Dec 2, 2023

This was addressed in release v2.1.0.

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-v2 Related to tailwind-merge v2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants