next-themes icon indicating copy to clipboard operation
next-themes copied to clipboard

How to implement 2 theme provider ?

Open codingwithashu opened this issue 1 year ago • 4 comments

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

codingwithashu avatar Sep 08 '23 17:09 codingwithashu

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.

n-batalha avatar Nov 22 '23 09:11 n-batalha

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?

trm217 avatar Apr 22 '24 11:04 trm217