Replies: 8 comments 1 reply
-
I'm not 100% how I feel about this. Personally, I don't use RN web at all, so I don't feel particularly motivated to take on the maintenance of all the additional surface area represented by a decision to support all of the web utilities. I also have a concern about bloating the code and slowing down the parsing logic, for RN native, performance is really critical. That said, I know a lot of folks really like RN web, and are using this library with some success in that context. I have sometimes thought that maybe at some point I might reorganize the lib to have a I wonder if a possible compromise would be to outline a handful or few dozen of the most core utilities that would go a long way towards making RN-web users not need to add a bunch of custom utilities. Stuff like |
Beta Was this translation helpful? Give feedback.
-
I've just added tailwindcss to my expo app to get the web classes as well. This had me change some One utility that i'm missing the most are the PS: I haven't tried compiling the code into an app yet, and i'm currently not managing to compile media-query styles on production, but need to take a deeper look at vercel/next.js#14595 – so this is unrelated |
Beta Was this translation helpful? Give feedback.
-
Hey @finkef, i've been working on a wrapper for |
Beta Was this translation helpful? Give feedback.
-
Totally get your point, @jaredh159! How about creating a @teovillanueva Interesting project! I'm currently working on support for web selectors, like |
Beta Was this translation helpful? Give feedback.
-
@finkef I like the idea of using a macro. Definitely makes using tailwind with RN cleaner. The thing is, the approach of using twrnc in web does not look like a great idea to me. I think the web should be using classnames but since it isn't supported by RNW i came up with the postcss plugin that translates the native tailwind selectors into data attributes selectors which are supported by RNW. Can i ask if you @finkef and @jaredh159 are willing to create a unified source for this? I think we are all trying to achieve the same thing which is a common api for using tailwindcss in react-native in the same way we use it in web. I started to create a spec for using tailwindcss in RN/RNW |
Beta Was this translation helpful? Give feedback.
-
I see the macro simply as layer on top of twrnc, trying to enhance the ergonomics especially across platforms and for targeting Next.js and SSR with CSS media queries. I think twrnc has a super nice and clean API that already solves plenty of use cases without complicating the usage, whereas using the macro comes with some considerations and things to keep in mind towards the media queries. Also, for the macro all styles need to be static whereas I think twrnc could support stuff like I see the value in merging the projects, but I think it would complicate things a lot for people using just RN on native platforms that benefit from a much more flexible API from twrnc. |
Beta Was this translation helpful? Give feedback.
-
@finkef you are right, i was thinking maybe instead of "merging" the projects to create like a set of tools that are completely independent one from another. Mainly because there are lots of projects trying to achieve the same thing in different ways and there is no project that has the solution to all problems. |
Beta Was this translation helpful? Give feedback.
-
@jaredh159 I'd like to get this to your attention again 😅. I believe in the next few months we'll see a more and more usage of RN and RNW to create universal apps. Not sure how to approach this, with an extra layer (macro) or in the repo, but I think supporting web should be in the roadmap 🤗 |
Beta Was this translation helpful? Give feedback.
-
Since this package works with react-native-web (although not officially supported I think), I was wondering if there is any interest in also adding web-only tw utilities like "cursor-pointer". When building for the web, natively supported RN styles gets us 90% of the way there, but showing a pointer cursor for buttons is a must.
My specific use case is that I want to support web utilities in react-native-tailwind.macro since it's trying to allow fully universal tailwind styles on both mobile and web.
I think the best option is adding support for those utilities in this repo by adding the missing resolvers. Alternatively, I could add them through this lib's plugins downstream in react-native-tailwind.macro, but I think many more users could benefit off of them when implemented here.
What do you think, @jaredh159?
Beta Was this translation helpful? Give feedback.
All reactions