-
Notifications
You must be signed in to change notification settings - Fork 33
Closed as not planned
Labels
Description
What happened?
We have a custom "yellow" theme in our app, but we could call it "xmas" theme. To support both light and dark modes for it, we created yellow-light and yellow-dark variants. We apply these via ScopedTheme:
<ScopedTheme theme="yellow-dark">
<Card /> {/* uses dark: utility classes */}
</ScopedTheme>The problem is that dark: utility classes (like dark:bg-card) don't apply inside ScopedTheme theme="yellow-dark" correctly. They use the colors from the regular dark theme, but not the scoped dark theme.
This means we can use dark: without a ScopedTheme, but not with one that has a custom dark theme name.
Steps to Reproduce
- Define custom themes
yellow-lightandyellow-darkin your CSS with dark mode overrides, and put it in the metro config too. - Use different values for
bg-cardfor light, dark, yellow-light, yellow-dark themes. - Wrap a component in
<ScopedTheme theme="yellow-dark">. - Any
dark:utility classes (e.g.dark:bg-card) inside that tree will not take the value of the yellow-dark theme. Instead it wiill use the regular dark theme value for bg-card
Snack or Repository Link
https://github.com/pvinis/repro-uniwind-dark-themes
Uniwind version
1.6.0
React Native Version
0.83.2
Platforms
iOS, Android
Expo
Yes
Additional information
- I've searched for similar issues in this repository and found none
Reactions are currently unavailable