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

motion-translate classes interfere with normal translate classes on opposite axis #35

Open
Boston343 opened this issue Jan 7, 2025 · 0 comments

Comments

@Boston343
Copy link

Boston343 commented Jan 7, 2025

It appears as if when you use a motion-translate class for one axis, it messes up normal translate classes for the other axis (at least when using absolute positioning).

I'm testing this out and came across this issue in a tooltip component. To center the tooltip component (which appears on the top), I use the classes absolute top-2 left-[50%] translate-x-[-50%] on the tooltip itself. When adding the class motion-translate-y-in-[.5rem] it messes with the absolute positioning, and completely ignores the translate-x-[-50%] until the exit animation occurs where it's position jumps. See below video for example of it occurring on all tooltip site possibilities.

Previously I was using the tailwindcss-animate package and using the class slide-in-from-bottom-2 works as expected where it animates the y axis positioning and doesn't change the x-axis translation, so I believe it should be possible with this library as well.

I'm using [email protected] and [email protected]. Issue occurs both in dev mode and on the built site (Astro project).

tailwindcss-motion-issue.mp4
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

No branches or pull requests

1 participant