Skip to content

fix: Mantine setting global styles - #525

Closed
matthewlipski wants to merge 1 commit into
mainfrom
mantine-global-styles-fix
Closed

fix: Mantine setting global styles#525
matthewlipski wants to merge 1 commit into
mainfrom
mantine-global-styles-fix

Conversation

@matthewlipski

Copy link
Copy Markdown
Collaborator

Due to the Mantine update from 0.11, the way in which Mantine component styling is now different. Mantine now sets styles in CSS, some of which are set globally. This can cause issues by overwriting existing styles, when in reality they should be scoped to only elements within the editor.

This PR unsets global styles set by Mantine and moves them inside the .bn-container element (excluding setting CSS variables). Unfortunately, for Mantine styling to work at all, you need to import @mantine/core/styles/global.css, which includes said global styles. This means that AFAIK, there is no way to skip importing them, and the best we can do is to unset them. This feels really hacky, so any suggestions for a nicer fix are welcome.

Closes #523

@vercel

vercel Bot commented Jan 18, 2024

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
blocknote ✅ Ready (Inspect) Visit Preview Jan 18, 2024 3:56pm
blocknote-website ✅ Ready (Inspect) Visit Preview Jan 18, 2024 3:56pm

@YousefED

Copy link
Copy Markdown
Collaborator

closing, main issue is fixed by upgrading mantine (#535)
For other styles, using "unset" is probably not an option because it'd also unset user added styles

@YousefED YousefED closed this Jan 22, 2024
@nperez0111
nperez0111 deleted the mantine-global-styles-fix branch October 21, 2025 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Importing react style.css is breaking our own CSS

2 participants