Next.js Discord

Discord Forum

next-theme

Answered
Iridescent shark posted this in #help-forum
Open in Discord
Iridescent sharkOP
How to apply next-theme class to <body> instead of <html>?
Answered by Iridescent shark
I fixed it by overriding blueprintjs css styles in globals.css, thank you for help
View full answer

11 Replies

Why do you want to do so?
Iridescent sharkOP
I'm using blueprintjs components which dark theme works by adding .bp5-dark to the container. If class is added to the <html> some components don't change theme.
From my knowledge, this is not supported by next-themes;
Ignore that unknown file
Iridescent sharkOP
ok, then I need to write my own
Maybe...

Does using body give you the correct results?
The way i see it, its mostly a problem with how blueprintjs handles their theming.
One way around this might be to use the useTheme hook. Do with that what you will:
https://github.com/pacocoursey/next-themes?tab=readme-ov-file#avoid-hydration-mismatch
Iridescent sharkOP
I fixed it by overriding blueprintjs css styles in globals.css, thank you for help
Answer