Skip to content

Support for translate-* utilities in Tailwind CSS v4 (missing implicit transform behavior) #594

@omrfrkcpr

Description

@omrfrkcpr

Describe the bug

In Tailwind CSS v4, the translate-* utilities no longer require the transform base class, because they use the native translate property directly (e.g., translate: 50% 0). However, tailwind-merge still assumes that translate-* depends on transform, which leads to unexpected class merging behavior.

Classes like translate-x-1/2 are either dropped or not properly merged unless an unnecessary transform class is added manually, even though it has no effect in v4.

To Reproduce

Use tailwind-merge with the following:

twMerge("translate-x-1/2")
// Expected: "translate-x-1/2"
// Actual: gets dropped or ignored unless "transform" is added

But in Tailwind CSS v4, this class works perfectly fine on its own, because:

.translate-x-1\/2 {
  translate: 50% 0;
}

Expected behavior

tailwind-merge should not require the transform class for translate-* utilities in Tailwind CSS v4. It should treat them as standalone, valid utilities.

Expected output:

twMerge("translate-x-1/2") 
// => "translate-x-1/2" ✅

No need for:

twMerge("transform translate-x-1/2") 
// This is redundant in Tailwind v4

Environment

  • tailwind-merge version: [3.3.1]
  • tailwindcss version: [4.1]
  • package manager: [yarn]
  • framework: [next.js, typescript]

Additional context

This is due to a major change in Tailwind CSS v4, where transform-related utilities (translate, rotate, scale, skew) use native properties like translate, rotate, and scale, and no longer depend on the transform class.

It would be ideal if tailwind-merge could support this change, perhaps by version awareness or by updating the merge logic for transform-related utilities.

Metadata

Metadata

Assignees

No one assigned

    Labels

    context-v3Related to tailwind-merge v3

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions