-
Notifications
You must be signed in to change notification settings - Fork 4.5k
space-x-* does not work in RTL direction #2017
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
Comments
I fix this by doing this: [dir="rtl"] {
.space-x-4 > :not(template) ~ :not(template) {
--space-x-reverse: 0 !important;
margin-left: calc(1rem * var(--space-x-reverse)) !important;
margin-right: calc(1rem * calc(1 - var(--space-x-reverse))) !important;
}
} But I would like to know, there is a way to make space without depends on direction? |
Just use tailwindcss-dir and add space variant to variants: {
space: ['responsive', 'direction'],
}, |
@hsul4n Not working! still, the margin in the last item and none in the first one 😟 |
I fixed this problem by this code: [dir="rtl"] {
.space-x-4 > :not(template) ~ :not(template) {
--space-x-reverse: 0 !important;
margin-left: calc(1rem * var(--space-x-reverse)) !important;
margin-right: calc(1rem * calc(1 - var(--space-x-reverse))) !important;
}
} |
@chalist good trick.
then you can do something like Saves much time, isn't it? |
yes sure. But you wrote not working. This is because I write that comment :D |
Thank you 👍 |
Sorry @mohamed-ibrahem, I always add style utilities to variants property but looks like this doesn't work with Here's example <div class="flex space-x-4 rtl:space-x-reverse">
<div>1</div>
<div>2</div>
<div>3</div>
</div> |
@hsul4n your solution was the best one. Worked for me. Thank you. |
it work for me thank you, |
For 2021 and tailwind v2 i used only this and works |
…dlabs#2017) It looks like this page description was copypasted from [the dark-mode page](https://github.com/tailwindlabs/tailwindcss.com/blob/af7b452ad5ccf09f47961d09420663ebdd606140/src/docs/dark-mode.mdx?plain=1#L7).
The text was updated successfully, but these errors were encountered: