Replies: 1 comment 1 reply
-
Hey! In my tests things work the way it sounds like you want, Here's a Play that demonstrates it: https://play.tailwindcss.com/V2QfJMX2w9 The order was chosen based on how this is normally done in graphics programming to try and make things intuitive as you've hinted at: https://gamedev.stackexchange.com/a/16721 If we translated before scaling, then the translation amount would be scaled, but we translate last to make sure we are translating by the expected amount. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Right now transformations are applied by
meaning an object is first scaled and rotated before it is translated as per these MDN Docs
However, that creates some really awkward defaults where simply because if I have
translate-y-2
andscale-80
it won't actually translate0.5rem
rather0.5rem * 80%
rem (note that the 0.8 is even relative to parent size because it's a percentage scale making it even weirder)Similarly, weird results will happen by applying the rotation before translation. I think better defaults would make things nicer in this case (but probably in 3.0.0 since it would be breaking) but maybe there's a case for making it configurable/class-based where you can have different orders of application?
Beta Was this translation helpful? Give feedback.
All reactions