Next.js Discord

Discord Forum

nextjs themes issue

Answered
Crazy ant posted this in #help-forum
Open in Discord
Crazy antOP
Hello All, How do I customize the next-themes defaultTheme color, I want to provide color bg-gray-900 instead of default dark.
How do I change the default dark to bg-gray-900

layout.js->

<ThemeProvider
attribute="class"
defaultTheme="dark"
enableSystem
disableTransitionOnChange
>
<section>
{children}
</section>
</ThemeProvider>
Answered by Clown
You are using the class method
View full answer

4 Replies

You are using the class method
Answer
Just set the background color in one of the parents or body using className
When you using class attribute you need to use something like this:
className="bg-gray-100 dark:bg-gray-900"
Crazy antOP
@Clown .Thank you for your reply. Its fixed. Thank you very much.