gunnartorfis / sonner-native

An opinionated toast component for React Native. A port of @emilkowalski's sonner.
https://gunnartorfis.github.io/sonner-native
MIT License
459 stars 18 forks source link

Partial styling not effected #107

Closed code-z2 closed 1 month ago

code-z2 commented 1 month ago

i wanted to customize the styles (background color and fonts) but not go fully unstyled. However, the custom fonts get's applied but the background color does not not

To Reproduce

  1. setup sonner native as normal
  2. add default styles to toaster:
        <Toaster
            theme={colorScheme}
            toastOptions={{
              titleStyle: {
                fontFamily: "poppins-semibold",
                color: NavTheme[colorScheme].colors.text,
              },
              descriptionStyle: {
                fontFamily: "poppins-regular",
                color: NavTheme[colorScheme].colors.text,
              },
              toastContainerStyle: {
                backgroundColor: NavTheme[colorScheme].colors.secondary,
              },
            }}
          />

    where colors.text = #F9FAFB | #030712 where colors.secondary = #1f2937 | #f3f4f6 based on the current theme

Expected behavior The background color of the toast should appear as expected instead of casting an off background behind the actual toast.

Screenshots photo_2024-09-18 7 44 17 PM

Environment info

Library Version
sonner-native 0.13.0
react-native 0.74.5
react-native-reanimated 3.10.1
react-native-gesture-handler 2.16.1
gunnartorfis commented 1 month ago

To speed up the fixing process since I don't have time until tomorrow to take a look at this, did you try:

code-z2 commented 1 month ago

Yes, I tried some other styles too and even with classnames. 'Nativewind' classnames had no effect at all. contentStyle was applied to the section of the 'title' and 'description' only, combined with border styles still didn't work.

Tried specifying the styling in different props too: