Replies: 2 comments
-
I have to use vanilla JS to clear out the previous class, but should't NextThemes do this by default? Why are my classes stacking?
|
Beta Was this translation helpful? Give feedback.
0 replies
-
I found it could be resolved once I specify <NextThemesProvider attribute="class" defaultTheme="dark" themes={["dark", "light", "mytheme"]}>
<Layout fontClass={`${inter.className}`}>
<Component {...pageProps} />
</Layout>
</NextThemesProvider> Refer: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When I change themes, I expect
<html lang="en" class="theme1"
to only contain the theme I switch too.However when I start changing the theme multiple times, I need up with at least 2 themes stuck in the top level class, ie:
<html lang="en" class="theme1 theme2"
// <-- this is terrible, I only expect 1 theme hereWhich forces me to add
!important
on the classes I want to enforce, but why is this happening?My tailwind.config
ThemeSwitcher
Beta Was this translation helpful? Give feedback.
All reactions