tailwind-react-native-classnames
tailwind-react-native-classnames copied to clipboard
Add transform support
I can't find any reference to transform
in the supported-utilites.md file.
This does exist in RN, any plans to include it? My current usecase is to center an icon in a thumbnail, which i do with the following tailwind classes: absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2
Thanks for this great lib!
where do you see in the RN style props docs that transform
is supported by RN (native)? I don't see it anywhere.
https://reactnative.dev/docs/transforms
Transforms are style properties that will help you modify the appearance and position of your components
@jaredh159 apologies for that, missed your reply! Indeed, they are supported 🙏
Ok, thanks. Interesting. I must have missed it because they weren't listed on the main pages for style props. I'm not sure when I'll do it, but I'll try to add support before too long.
I'll give it a try and open a WIP PR already with tests, before I attack the code itself 👌
ok sure, happy to look at a PR if you feel up for it. 👍
Any change? :)
@KULTI1995 haven't had a chance to look at this, also it's not really smth i need at the moment.. This said, just spent a bit of time, maybe this'll help smone start or get an idea.
@jaredh159 if you could take a look at the approach, me or smone can take it from there and complete with more tests and styles. I'm not opening a PR here until there's consequent work done, but wip can be seen here: https://github.com/walidvb/tailwind-react-native-classnames/pull/1
Also, it might well make sense to separate each transforms in their own files, idk yet.
Last, i wasn't able to get rid of an ts error at the bottom of the styles.js
file, added a @ts-ignore
for now.
Hoping to find more time for this at some point!
@walidvb hey, left a few comments on your PR, thanks for the time you spent on this.
@jaredh159 appreciate it. Really just layed out a skeleton, but comments from the maintainer will really help make sure changes/additions to core respect your architecture!
I'm thinking it might actually be worth it opening a wip PR here, to open the convo to whoever follows this?
But there is no one to follow here. It will work for some/not for others, but there should be all possible styles carried over. Transform is in Tracy native styles, and that's not in the library. Hence it should be in there.
It is known that enthusiasm is for a while. It would be nice if by this time, when you are working on it, you would have introduced rotate, scale at least.
@KULTI1995 Tracy = Tailwind? i'm not sure what you mean? All styles supported by tailwindcss should be supported in this library?
Reg. enthusiasm, i'm not using these features nor this library at the moment, i was just contributing because i think RN deserves to have the same level of quality with tailwind than the web version. I'll try and find some time, but like everyone here i'm quite busy ;)
Feel free to fork my code, I think i've laid the ground work there 👌:)
I've already implemented it, in my library, which has a foundation in this one. But there is much, much more implemented. And it's cool, like as a foundation, it's in this transform. Because cache is implemented in this one, in mine it's not.
It is known that enthusiasm is for a while. It would be nice if by this time, when you are working on it, you would have introduced rotate, scale at least.
@KULTI1995 mind opening a PR?