How to give light theme to some components and dark theme to others? #3039
-
Hello, my team is building a plugin for Twilio Flex in which some Paste components need to use a light theme and others a dark theme. I'm wondering if there is a way to do this with the careful placement of Paste's CustomizationProvider? I assume we would need to use two instances of it, if it will work at all. Could one be a child of another, or should I place them so that they do not conflict? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @WillCKyle - using multiple Customization Providers might affect the performance of your plugin. Are you using custom themes or the base themes ("default" and "dark")? If you're just using the base themes, multiple Theme Providers might work better for you than multiple Customization Providers. If you're using custom themes and would like to keep using the Customization Provider, an option might be naming your light and dark components and passing custom styles for them. Here's a CodeSandbox we made so that you can see both options. You can use multiple Customization Providers in the same way that multiple Theme Providers are used in the first example, but there is a chance it would affect your performance. |
Beta Was this translation helpful? Give feedback.
Hey @WillCKyle - using multiple Customization Providers might affect the performance of your plugin. Are you using custom themes or the base themes ("default" and "dark")? If you're just using the base themes, multiple Theme Providers might work better for you than multiple Customization Providers. If you're using custom themes and would like to keep using the Customization Provider, an option might be naming your light and dark components and passing custom styles for them. Here's a CodeSandbox we made so that you can see both options. You can use multiple Customization Providers in the same way that multiple Theme Providers are used in the first example, but there is a chance it would a…