jaredh159 / tailwind-react-native-classnames

simple, expressive API for tailwindcss + react-native

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support adding gradient to background

karwan-ali opened this issue · comments

commented

Hello,

I was wondering if it is possible to implement gradient to background like in normal tailwindcss?

Example:
bg-gradient-to-b

My React Native app can't find gradient styles. See attached images.
Screenshot 2023-02-12 at 21 20 19

I also get error when adding "from-black to-white":
Screenshot 2023-02-12 at 21 21 04

We don't support gradients at all. That's because this library is only aiming to cover tailwindcss utilities that map directly to core style props in RN native. Gradients are not supported directly in RN (native).

I'm guessing you might be using RN web? If so, check out the discussion here: #125

also:

#156

commented

Oh sorry, I was going to write another comment as I found a library that took care of this. I was not aware that gradient was not supported in RN. Thank you for the fast reply!

If other people are interested in what library I used for implementing gradient:
expo-linear-gradient