You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Say you want to show a small portion of your site in dark mode while in light mode. Because nested ThemeProviders will always inherit the root colorMode, doing this becomes tricky. Some discussion on that here.
However, digging around in the source code I found that NestedColorModeProvider creates a helper class that allows this.
// ... light themed stuff<divclassName="theme-ui-dark"><ThemeProvidertheme={{}}>{/* dark themed stuff */}</ThemeProvider></div>
My question is, is this safe to use? Since it's not documented the concern is how long this might be supported.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Say you want to show a small portion of your site in dark mode while in light mode. Because nested
ThemeProvider
s will always inherit the root colorMode, doing this becomes tricky. Some discussion on that here.However, digging around in the source code I found that NestedColorModeProvider creates a helper class that allows this.
My question is, is this safe to use? Since it's not documented the concern is how long this might be supported.
Beta Was this translation helpful? Give feedback.
All reactions