You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Any way not to have Mantine set styles globally? #546
BlockNote styles are importing Mantine styles which set a bunch of global styles. Maybe makes sense if your whole project is using Mantine, but mine doesn't and these things interfere with existing custom styles in my project (see below).
Additionally Mantine sets a bunch of color variables that I don't know if even BlockNote is using, so it's a bunch of extra useless css in the bundle.
I was experiencing this as well using tailwind, it was causing my theme to always default to dark mode. I have since fixed it by hardcoding the page to be light (I don't need a dark mode for my application).
So there's not really a way of removing or scoping those styles unfortunately, it's been a running issue since updating to Mantine v7. I added a fix in #553 which resets the styles, though this obviously isn't ideal since:
It clutters the CSS since styles are set and promptly unset
It will override those styles set on body, :root, etc, that are set by other stylesheets and loaded earlier
I was experiencing this as well using tailwind, it was causing my theme to always default to dark mode. I have since fixed it by hardcoding the page to be light (I don't need a dark mode for my application).
html{color-scheme: light !important;}
I got a problem with the update of block note also
and suddenly all my background was in dark mode
looks like mantine problem
i add the line code you give and it works well
but all my text comes black and not the color by default
Is this on 0.11.2? We pushed a new fix for this with #553, since we found a way to prevent Mantine global styles from being imported in the first place. Basically BlockNote should no longer be setting any styles on html. Can you check if your issue persists on the new version? Or if you're already on the new version, I'll look into it.
Activity
[-]Any way not to use Mantine?[/-][+]Any way not to have Mantine set styles globally?[/+]rockiger commentedon Jan 29, 2024
Yes, Mantine seems to be a problematic dependency. It also messes the Blocknote website up in dark-mode:
Source: https://www.blocknotejs.org/examples/custom-ui
leighton-tidwell commentedon Jan 29, 2024
I was experiencing this as well using tailwind, it was causing my theme to always default to dark mode. I have since fixed it by hardcoding the page to be light (I don't need a dark mode for my application).
matthewlipski commentedon Jan 31, 2024
So there's not really a way of removing or scoping those styles unfortunately, it's been a running issue since updating to Mantine v7. I added a fix in #553 which resets the styles, though this obviously isn't ideal since:
body,:root, etc, that are set by other stylesheets and loaded earlierBat-m commentedon Feb 1, 2024
I got a problem with the update of block note also
and suddenly all my background was in dark mode
looks like mantine problem
i add the line code you give and it works well
but all my text comes black and not the color by default
matthewlipski commentedon Feb 5, 2024
Is this on 0.11.2? We pushed a new fix for this with #553, since we found a way to prevent Mantine global styles from being imported in the first place. Basically BlockNote should no longer be setting any styles on
html. Can you check if your issue persists on the new version? Or if you're already on the new version, I'll look into it.