-
Hello, I'm currently utilizing the UnistylesRuntime.setTheme() method for theme management in our application. At present, we have a global theme applied across the entire app. Our default global theme is named 'blue'. However, we have encountered a scenario where we need to apply a different theme to a specific component within our application while keeping the rest of the app in the default 'blue' theme. We would like to apply a 'red' theme to this particular component. Could you please provide guidance or suggest a method to implement nested themes within our app? Specifically, we're looking for a way to maintain our global 'blue' theme while allowing certain components to override this with a 'red' theme or any other theme. Thank you for your assistance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hey! Currently such scenario is not supported. Theme is used in the entire app, there is no api to select it for single screen/stylesheet, but... Why don't you import red theme directly in this specific component? Instead of using theme from createStyleSheet simply use it from import on top of your file. It won't be dynamic but it will cover your case |
Beta Was this translation helpful? Give feedback.
Hey! Currently such scenario is not supported. Theme is used in the entire app, there is no api to select it for single screen/stylesheet, but...
Why don't you import red theme directly in this specific component? Instead of using theme from createStyleSheet simply use it from import on top of your file. It won't be dynamic but it will cover your case☺️