-
-
Notifications
You must be signed in to change notification settings - Fork 547
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
[5.x] Reverse spaces in RTL #10184
[5.x] Reverse spaces in RTL #10184
Conversation
Why are we overriding |
Exactly. My solution is not to replace The class .super-btn {
@apply p-4 flex items-start hover:bg-gray-200 border border-transparent rounded-md space-x-4;
.
.
. |
Additionally, your idea to replace all margins with spaces will reduce the number of classes and keep the code clear and concise. |
Right, but what's going on the |
I think the issue here is the question... Why are we doing this |
Aha, I understand! Tailwind calculates spaces on the left side, so as you can see here, we move the calculation to the right. /* LTR tailwind */
.space-* {
margin-right: calc(**rem* var(--tw-space-x-reverse));
margin-left: calc(**rem* calc(1 - var(--tw-space-x-reverse)));
}
/* RTL tailwind */
.space-* {
margin-left: calc(**rem* var(--tw-space-x-reverse));
margin-right: calc(**rem* calc(1 - var(--tw-space-x-reverse)));
} |
How about this? tailwindlabs/tailwindcss#2017 (comment) |
I didn't know that! I first found a solution and then copied and pasted it. I will update code! |
It would be really nice if tailwind just automatically flipped it for you in RTL mode! TIL how |
Maybe those |
There's also this https://github.com/20lives/tailwindcss-rtl |
Two or three weeks ago, I did the same thing for another project and replaced all left and right elements with start and end. I think I'll apply the same approach for Statamic, but I've previously implemented RTL for Statamic months ago using this method of finding the first solution and implementing it! I'm uncertain whether all the plugins for RTL are functioning smoothly, as I've tested them and haven't found a complete solution. I tend to focus heavily on details, which might contribute to the challenge. However, I haven't tried testing this one yet! |
@jackmcdade I've converted classes to |
@peimn is this ready for review? |
Yes, it is ready. This update only addresses the reverse issue. I will send a separate pull request to handle the removal of ltr: rtl: stuff and replace them with CSS rules and Tailwind classes. |
The Super button uses
space-x-4
, which has not been styled for RTL layout.