Skip to content

Making @blocknote/mantine compatible with Mantine projects #1555

@strblr

Description

@strblr

Is your feature request related to a problem? Please describe.
When using @blocknote/mantine in projects that already use Mantine, there is a conflict between variables, provider and maybe mantine versions.

Describe the solution you'd like
BlockNoteView from @blocknote/mantine wraps the editor in MantineProvider. We should be able to opt-out of this, in case we're already in a Mantine codebase and have such a provider higher up.

This issue became obvious when I tried to customize Blocknote's CSS variables using mantine variables. I expected var(--mantine-color-text) (for example) to refer to the app's variable, but instead it refered to the local variable set up by Blocknote's Mantine provider so it didn't change the color the way I expected. This makes it hard to customize the theme using the app's mantine variables. Things like the default radius will be different from the app's theme as well.

Two additional points:

  • Making mantine packages peer dependencies
  • Having a CSS export that does not include Mantine CSS files, as these are usually already imported in a Mantine codebase

Describe alternatives you've considered
Unclear.

Additional context

Bonus
[ ] I'm a sponsor and would appreciate if you could look into this sooner than later 💖

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions