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

Importing react style.css is breaking our own CSS #523

Closed
charlesBochet opened this issue Jan 18, 2024 · 7 comments · Fixed by #790
Closed

Importing react style.css is breaking our own CSS #523

charlesBochet opened this issue Jan 18, 2024 · 7 comments · Fixed by #790
Assignees
Labels
bug Something isn't working prio:high High priority

Comments

@charlesBochet
Copy link

Describe the bug
We are using your awesome BlockNote on Twenty and wanted to migrate to the new version: https://github.com/twentyhq/twenty/pull/3517/files

From the release notes:

Breaking Changes
Change import "@blocknote/core/style.css"; to import "@blocknote/react/style.css"; if you're using @blocknote/react

This update changes how themes and styles are applied to the editor. This means if you were previously overriding CSS using the componentStyles field in a Theme object, you should convert those styles to CSS rules. See the new theming and styling documentation [here](https://www.blocknotejs.org/docs/theming).

However, react/style.css does change the style of non block-note related class, for example:
body,html{height:100%}...

This is an issue as we import it in our project using @blocknote/react/style.css, it completely breaks our page layout.

Before:
image

After:
image

(see that the Sort button for example is broken)

@charlesBochet charlesBochet added the bug Something isn't working label Jan 18, 2024
@YousefED
Copy link
Collaborator

Thanks, we'll look into this asap!

@YousefED
Copy link
Collaborator

Should be fixed! closed by #535

@dogfootruler-kr
Copy link

Hello @YousefED,

I'm not sure this issue is fixed in the latest version :(.

Before:
image

After:
image

My yarn.lock file:
image

Thank you!

@CarlosVP120
Copy link

It still happens with Shadcn, when importing the styles.css file, it modifies the whole layout :(

@AIchovy
Copy link

AIchovy commented May 25, 2024

It still happens with Shadcn, when importing the styles.css file, it modifies the whole layout :(

I also encountered the same problem. Import "@blocknote/mantine/style.css" made some styles of my page layout invalid.

@YousefED YousefED reopened this May 27, 2024
@YousefED
Copy link
Collaborator

Other report here: https://discord.com/channels/928190961455087667/1216075332524969994/1216075332524969994. @CarlosVP120 @AIchovy could you share a bit more details about what's being reset / changed?

@matthewlipski
Copy link
Collaborator

I've looked into this and looks like there is a data-mantine-color-scheme attribute being added to the html root element (see #651, also seems likely to be causing @dogfootruler-kr's styling issue). However, that's the only thing I'm seeing Mantine set on either html, body, or #root so this should solve any remaining problems so I'll create a PR to fix that. In the meantime, I'd appreciate any additional examples of BlockNote/Mantine setting any styles on html, body, or #root elements (screenshots/snippets from browser inspector would be great). Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working prio:high High priority
Projects
None yet
6 participants