Skip to content

negative rotate with variables (-rotate-(--foo)) not working correctly #18013

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

Closed
whytspace opened this issue May 14, 2025 · 1 comment · Fixed by #18014
Closed

negative rotate with variables (-rotate-(--foo)) not working correctly #18013

whytspace opened this issue May 14, 2025 · 1 comment · Fixed by #18014

Comments

@whytspace
Copy link

whytspace commented May 14, 2025

What version of Tailwind CSS are you using?

v4.1.6

What build tool (or framework if it abstracts the build tool) are you using?

Vite 6.3.5

What version of Node.js are you using?

For example: v20.10.0

What browser are you using?

N.A.

What operating system are you using?

macOS

Reproduction URL

https://play.tailwindcss.com/XIDXFoclli

Describe your issue

the negative rotate does not work with the new variable syntax (-rotate-(--myvar))). It generated the same code as the positive variant rotate-(--myvar)).

Example:

  • rotate-20 generates rotate: 20deg;
  • -rotate-20 generates rotate: -20deg;
  • rotate-(--myvar) generates rotate: var(--myvar);
  • -rotate-(--myvar) generates rotate: var(--myvar);, but should generate rotate: calc(var(--myvar) * -1);

Is that a bug or intentional behaviour?

Side note:

-rotate-z-(--myvar) works as expected. I will use it as a workaround for now.
However it does not use rotate, but transform: rotate() instead. Is there a reason for this difference? Just asking because translate-* and translate-x-* both use the new translate property instead of transform.

philipp-spiess added a commit that referenced this issue May 14, 2025
Fixes #18013

## Test plan

See updated unit tests
@philipp-spiess
Copy link
Member

Thanks! Will be fixed with the next release 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants