DEV Community

Discussion on: Easy way to use Dark Mode in Next.js + Tailwind

 
thomasledoux1 profile image
Thomas Ledoux

I think you could move the ThemeProvider in github.com/rjitsu/cssKenpai-v2/blo... to the top level of the rendering. Maybe that might help to get the <div className="dark:bg-gray-700"> part working?

Thread Thread
 
rjitsu profile image
Rishav Jadon

Great, that fixed it, thanks so much! I thought the ThemeProvider could only have Component as it's children, that's why I didn't try this yet. Thanks.

Thread Thread
 
thomasledoux1 profile image
Thomas Ledoux

Happy to hear that! Glad to help