Skip to content
Discussion options

You must be logged in to vote

Solution

You'd want to set --translate-px instead of --translate-x-px and --translate-y-px: https://play.tailwindcss.com/6cl3KwAT1e?file=css

Analysis

Your original config produced this CSS:

.translate-x-px {
  --tw-translate-x: var(--translate-x-px) /* var(--px) */;
  --tw-translate-y: var(--translate-x-px) /* var(--px) */;
  translate: var(--tw-translate-x) var(--tw-translate-y);
}
.translate-x-px {
  --tw-translate-x: 1px;
  translate: var(--tw-translate-x) var(--tw-translate-y);
}

What happened is that you created two theme token values for translate, x-px and y-px.

So now, translate-x-px would mean both:

  • translate-|x-px: translate x and y by the value of x-px, 15px.
  • translate-x-|px: …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@hoangnhan2ka3
Comment options

Answer selected by hoangnhan2ka3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #19621 on January 30, 2026 11:42.