Skip to content

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

Closed

Description

@charlesBochet

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)

Activity

  1. YousefED commented on Jan 18, 2024

    @YousefED
    Collaborator

    Thanks, we'll look into this asap!

  2. YousefED commented on Jan 22, 2024

    @YousefED
    Collaborator

    Should be fixed! closed by #535

  3. dogfootruler-kr commented on Jan 23, 2024

    @dogfootruler-kr

    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!

  4. CarlosVP120 commented on May 21, 2024

    @CarlosVP120

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

  5. AIchovy commented on May 25, 2024

    @AIchovy

    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.

  6. YousefED commented on May 27, 2024

    @YousefED
    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?

  7. matthewlipski commented on May 31, 2024

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions