Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to implement 2 theme provider ? #215

Open
codingwithashu opened this issue Sep 8, 2023 · 2 comments
Open

How to implement 2 theme provider ? #215

codingwithashu opened this issue Sep 8, 2023 · 2 comments

Comments

@codingwithashu
Copy link

codingwithashu commented Sep 8, 2023

I have a landing & dashboard where the landing has a separate ThemeProvider with dark mode and the dashboard has a separate ThemeProvider with a light mode, Whenever I go from the landing page to the dashboard theme mode does not change.

Dashboard -
image

Landing -

image

image

@n-batalha
Copy link

Another use case is a render side by side of different themes in storybook.

side-by-side

https://storybook.js.org/blog/how-to-add-a-theme-switcher-to-storybook/

I suspected the shared theme setting might be due to the use of localstorage with a shared default key, but it's not the issue.

@trm217
Copy link
Collaborator

trm217 commented Apr 22, 2024

As of now, the attribute / class that controls the theming is set on the document element.
@pacocoursey perhaps in v1, we could allow defining what element to set the theme value on, what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants