-
-
Notifications
You must be signed in to change notification settings - Fork 555
feat: Dark theme #171
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
feat: Dark theme #171
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. I left some inline comments. Also:
editor content styling
- The actual editor is not currently themed as it is part of the core package, while the dark theme at least partially relies on Mantine which is only used for UI in the react package.
The core package should be responsible for styling the actual editor content right? The contents of the editor now remains black text on white bg, that should also be changed
website dark mode
I've pushed a commit that enables dark mode on the website so we can properly showcase the dark-mode compatibality 😄. This brings up a few new issues:
- We need to update the theme at run time (there's a TODO left in code where we can do this).
- Some elements of the website will need to come with a dark + light variant. I've already done this for the logo + "try this" elements. We'll need to update the screenshots
- Ideally, the examples in the documentation are also theme-aware
packages/react/src/ElementFactory/components/EditorElementComponentWrapper.tsx
Outdated
Show resolved
Hide resolved
One thing about the editor dark mode is since we're only using basic CSS in |
Yes that's ok for now (i.e.: use a .dark class on the container). We can come up with other solutions as well to set these colors dynamically (e.g.: css vars), but I think now it's ok |
Also, do we want to sort out the website dark mode in this PR? Imo should be on a separate branch since it seems like dark mode for the editor is highly requested and I think shouldn't break anything for the website, maybe just look a bit ugly if we have a dark mode example. |
# Conflicts: # packages/react/src/BlockSideMenu/BlockSideMenuFactory.tsx # packages/react/src/ElementFactory/components/EditorElementComponentWrapper.tsx # packages/react/src/ElementFactory/components/ReactElementFactory.tsx # packages/react/src/FormattingToolbar/FormattingToolbarFactory.tsx # packages/react/src/hooks/useBlockNote.ts
* Added first iteration dark theme * website dark mode * Removed some unnecessary styles * Changed how theme is passed to factories * Changed `useDarkTheme` option to `theme` * Removed redundant varible * Added dark theme to editor body * Changed editor theme from class to attribute * Converted mock ID to string and updated snapshots * Updated unit test snapshots * Updated snapshots * Updated snapshots * Updated screenshots * Made keyboard handler tests less flaky * Removed dark mode toggle from website --------- Co-authored-by: yousefed <[email protected]>
This PR adds a dark theme to BlockNote which you can toggle using the
useDarkTheme
editor option. Looks pretty good but has a few issues:useDarkTheme
option to change this. I think this may be fixed in PR feat: customize sidemenu #143.core
package, while the dark theme at least partially relies on Mantine which is only used for UI in thereact
package.Theming with Mantine is actually a bit of a pain since we customize the layouts quite a bit and have to change the colours of those manually. At some point when we want to focus more on UI design it might be worth just making a custom UI instead of relying on premade Mantine components.
closes #169