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

fix: Mantine setting global styles #525

Closed
wants to merge 1 commit into from

Conversation

matthewlipski
Copy link
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

Copy link

vercel bot commented Jan 18, 2024

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
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
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