Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Darkmode not applied in next.js next-themes #824

Closed
TheMikeyRoss opened this issue Jun 7, 2024 · 2 comments
Closed

Darkmode not applied in next.js next-themes #824

TheMikeyRoss opened this issue Jun 7, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@TheMikeyRoss
Copy link

Describe the bug
Switching the theme using next-themes don't apply changes to the colors of `BlockNote

Misc

  • Node version: 18.19.3
  • Package manager: pnpm
  • Browser: chrome
@TheMikeyRoss TheMikeyRoss added the bug Something isn't working label Jun 7, 2024
@zaaakher
Copy link
Contributor

zaaakher commented Jun 7, 2024

Make sure to pass the resolvedTheme to theme prop in the BlockNoteView component.

<BlockNoteView
  editor={noteEditor}
  data-note-input
  theme={resolvedTheme as 'light' | 'dark'}
/>

and in your globals.css

.bn-container[data-note-input][data-color-scheme="dark"] {
   /* styles when theme is dark*/ 
}
.bn-container[data-note-input][data-color-scheme="light"] {
   /* styles when theme is light */ 
}

Make sure to use the css variables mentioned here

@TheMikeyRoss
Copy link
Author

That's exactly what i'm looking for, thank you @zaaakher

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants