tailwind-react-native-classnames icon indicating copy to clipboard operation
tailwind-react-native-classnames copied to clipboard

Add transform support

Open walidvb opened this issue 3 years ago • 15 comments

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!

walidvb avatar Dec 09 '21 15:12 walidvb

where do you see in the RN style props docs that transform is supported by RN (native)? I don't see it anywhere.

jaredh159 avatar Dec 09 '21 16:12 jaredh159

https://reactnative.dev/docs/transforms

Transforms are style properties that will help you modify the appearance and position of your components

a-eid avatar Dec 21 '21 08:12 a-eid

@jaredh159 apologies for that, missed your reply! Indeed, they are supported 🙏

walidvb avatar Dec 21 '21 11:12 walidvb

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.

jaredh159 avatar Dec 21 '21 15:12 jaredh159

I'll give it a try and open a WIP PR already with tests, before I attack the code itself 👌

walidvb avatar Dec 22 '21 16:12 walidvb

ok sure, happy to look at a PR if you feel up for it. 👍

jaredh159 avatar Dec 27 '21 15:12 jaredh159

Any change? :)

KULTI1995 avatar Jan 29 '22 08:01 KULTI1995

@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 avatar Jan 29 '22 17:01 walidvb

@walidvb hey, left a few comments on your PR, thanks for the time you spent on this.

jaredh159 avatar Jan 31 '22 13:01 jaredh159

@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?

walidvb avatar Jan 31 '22 14:01 walidvb

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.

KULTI1995 avatar Jan 31 '22 20:01 KULTI1995

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 avatar Jan 31 '22 20:01 KULTI1995

@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 👌:)

walidvb avatar Jan 31 '22 20:01 walidvb

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.

KULTI1995 avatar Jan 31 '22 21:01 KULTI1995

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?

arbel03 avatar Feb 25 '22 13:02 arbel03