mrzachnugent / react-native-reusables

Universal shadcn/ui for React Native featuring a focused collection of components - Crafted with NativeWind v4 and accessibility in mind.
https://rnr-docs.vercel.app
MIT License
3.91k stars 157 forks source link

[ BUG ] Button Text color doesn't change regardless of the current theme #244

Closed musab-olurode closed 2 months ago

musab-olurode commented 2 months ago

Describe the bug Button Text color remains black in both light and dark theme WITHOUT changing anything. It looks like the text-foreground class has no effect in the button TextContext. Adding any other non-theme text color works as expected. This exists on the starter-base without any modifications.

To Reproduce Steps to reproduce the behavior:

  1. Create a new project as instructed in the README
  2. Install dependencies
  3. Start the app on android and or web
  4. Buton Text remains black in both themes

Expected behavior Button Text should use the defined foreground color in dark mode

Screenshots image

Platform (please complete the following information):

Additional context

musab-olurode commented 2 months ago

Additionally, simple tailwind animations on icons are broken. rnr-bug Inspecting the generated HTML in the browser, it looks like all classes are being added to the SVG icons and all their children image

archodev commented 2 months ago

Nativewind animations are still experimental

archodev commented 2 months ago

~But also experiencing the same button text issue, it is fixed if you make the color a hex instead of hsl~ Tested this again, this no longer fixes it

musab-olurode commented 2 months ago

Nativewind animations are still experimental

I was using it fine in a previous version of rnr though.

musab-olurode commented 2 months ago

But also experiencing the same button text issue, it is fixed if you make the color a hex instead of hsl

That doesn't break nativewind?

archodev commented 2 months ago

But also experiencing the same button text issue, it is fixed if you make the color a hex instead of hsl

That doesn't break nativewind?

I just tested this again and that trick no longer works, for now what does work is on the custom text view putting dark:text-white

trevorpfiz commented 2 months ago

@musab-olurode have you tested with the latest versions of NativeWind? 4.1.6 works for me, but after that text-foreground seems to be breaking.

musab-olurode commented 2 months ago

@trevorpfiz I've tested with 4.0.33 (the preinstalled version on the starter base) and 4.0.36

musab-olurode commented 2 months ago

@trevorpfiz I just tried 4.16, still doesn't work.

Edit: 4.16 seems to be working now

trevorpfiz commented 2 months ago

@mrzachnugent You can see text-foreground not setting a color on the button text when it is inside a Card. I am noticing this bug in different project, where it seems all uses of text-foreground within a Card are not working. 4.1.6 is the latest version without the bug. repro: https://github.com/trevorpfiz/starter-base-repro

text-foreground-bug-in-card