Comments (6)
I understand the use case,
I will consider adding this.
from tailwindcss-rtl.
I solve this problem by this way from documentation :
To use a negative translate value, prefix the class name with a dash to convert it to a negative value.
So you can use class:
-translate-y-6
to translate from right to left
And:
translate-y-6
to translate from left to right
from tailwindcss-rtl.
Hi,
I don't think this is actually how it should work.
https://tailwindcss.com/docs/translate
the translation parameter is the axis (Y or X) so there is no left/right or start/end.
from tailwindcss-rtl.
Try to imagine this switch:
function Switcher(props)
{
const {
checked,
enabledLabel,
disabledLabel,
label,
onChange,
errors,
name,
description
} = props;
return(
<>
{label &&
<div className="font-medium text-gray-700 text-sm">
{label}
</div>
}
<div className="mt-1 flex rounded-md">
<div
className={`relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:shadow-outline ${checked ? 'bg-primary-600' : 'bg-gray-200'}`}
aria-checked="false"
role="checkbox"
tabIndex={0}
onClick={onChange}
>
<div
className={`inline-block h-5 w-5 rounded-full bg-white shadow transform transition ease-in-out duration-200 ${checked ? '-translate-x-5' : '-translate-x-0'}`}
aria-hidden="true"
>
</div>
</div>
<div className="ms-3 text-sm text-gray-600">
{checked
? <small>{enabledLabel}</small>
: <small>{disabledLabel}</small>
}
</div>
</div>
{errors &&
<Error errors={errors}/>
}
{description &&
<Description>{description}</Description>
}
</>
)
}
export default Switcher;
The position on the X axis (left or right) varies depending on the direction.
from tailwindcss-rtl.
@20lives Thank you!
from tailwindcss-rtl.
I know this issue is a little old. But i ran into the same issue, but on further inspection there is a rtl:
variant in tailwind (might be new?) so you can just do the opposite transform if you need to.
from tailwindcss-rtl.
Related Issues (20)
- Support for ESM HOT 1
- why aren't the native css "text-align: start" and end used? HOT 3
- tailwind-rtl not working when the parent dir="rtl" in version 0.8.0 HOT 5
- Plugin doesn't work with Tailwind v3 HOT 5
- Tailwind 3.0 RTL Search Patterns HOT 2
- :not([dir="rtl"]) is breaking everything HOT 6
- Question: Why does this not use `border-(start|end)-(start|end)-radius`? HOT 1
- Negative inset classes not working.
- Vite support? HOT 10
- Support for arbitrary values? HOT 5
- Negative values not being generated HOT 7
- inset
- right-* left-* classes to be start-* and end-* HOT 1
- [Question] Anyone tried using `tailwindcss-rtl` along with `twin.macro`? HOT 1
- Add support for `before`, `after` and right or left values
- Add support to space-x-() HOT 1
- dependency conflict when install tailwindcss-rtl package
- does not support negative margins i.e. -ms-x
- add support for bg-end bg-start
- How to ignore the change to rtl for certain elements?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tailwindcss-rtl.