-
-
Notifications
You must be signed in to change notification settings - Fork 184
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
Transforms only work if applied after classes like rotate, translate #20
Comments
I'm noticing a similar behavior with classes compiling in reverse order. Example:
|
Damn, those are some fairly huge bugs. I'll get them fixed up pronto. Big thanks for pointing these out! |
I've put together a test codesandbox on these issues and it seems to be ordering the margin classes correctly and the transforms work correctly.
By looking through the css tailwind builds, I can't see any !importants being added to the transform classes - do you have a source I can see on this? |
Thanks for looking into this @ben-rogerson! The project I discovered this issue uses Emotion and Gatsby. I forked the I've dug in a little and not closer to why, but glad I could produce an example outside my project. |
I've made a minimal bug reproduction here. I've noticed different behaviour between node versions when installing the reproduction locally. Ordering issue present
Ordering working correctly
Not sure what's triggering the issue within node v10.18.1 yet. |
I think I figured it out. It seems node (V8 really) switched to a stable sorting algorithm with v11 ( #22754, Getting things sorted in V8 ) The problem stems from here: Lines 27 to 32 in 2065f65
For example, if I test this on node v10.18.1, this is what I get: And this is what we get on newer node versions (which uses the updated v8) (using my browser here, dont have node v11 installed right now) A possible fix would be to use this sorting function - timsort. |
See: #20 Special thanks to: https://github.com/owaiswiz and https://github.com/n00b2pr0
I've added timsort and it's working perfectly when installed locally in node 10. |
|
This issue is solved! 🎉 We've reached closing time. |
Great! 1.0.0-alpha.8 works for me. 🎉 Thanks @ben-rogerson and @owaiswiz! 👏 |
tw.`rotate-90 transform`
works as expectedhowever,
tw.`transform rotate-90`
doesn't work.Seems anything set by
transform
isn't overridden later, so sincetransform
already sets--transform-rotate: 0
,rotate-90
is not applied. Same goes for all scale,skew, translate classes.Also using
rotate-90!
does nothing.It all only works if the order is reversed. TailwindCSS makes all rules set by these secondary utils (rotate, skew, etc) as !important so they override.
Thank you for the amazing library btw 😄
The text was updated successfully, but these errors were encountered: