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

CSS leaking override mantine styles #151

Open
Elvincth opened this issue Jun 11, 2024 · 13 comments
Open

CSS leaking override mantine styles #151

Elvincth opened this issue Jun 11, 2024 · 13 comments
Labels
help wanted Extra attention is needed

Comments

@Elvincth
Copy link

CSS from "jotai-devtools/styles.css" leaks and overrides my current project mantine styles (downgraded to v0.8.0 works fine)
Package version: v0.10.0

image

Before importing "jotai-devtools/styles.css":
image

After importing "jotai-devtools/styles.css":
image

@arjunvegda
Copy link
Member

Thanks for reporting! Could you paste the output of pn why @mantine/core? I wonder if this is a conflict between the Mantine versions of your project and Jotai DevTools 🤔

@Elvincth
Copy link
Author

Thanks for reporting! Could you paste the output of pn why @mantine/core? I wonder if this is a conflict between the Mantine versions of your project and Jotai DevTools 🤔

Here you go, please let me know if you need anything else to debug

dependencies:
@aokiapp/rjsf-mantine-theme 0.4.0
├── @mantine/core 7.10.1 peer
└─┬ @mantine/dates 7.10.1 peer
  └── @mantine/core 7.10.1 peer
@mantine/core 7.10.1
@mantine/dates 7.10.1
└── @mantine/core 7.10.1 peer
@mantine/dropzone 7.10.1
└── @mantine/core 7.10.1 peer
@mantine/modals 7.10.1
└── @mantine/core 7.10.1 peer
@mantine/nprogress 7.10.1
└── @mantine/core 7.10.1 peer
@mantine/tiptap 7.10.1
└── @mantine/core 7.10.1 peer
jotai-devtools 0.10.0
├─┬ @mantine/code-highlight 7.10.1
│ └── @mantine/core 7.10.1 peer
└── @mantine/core 7.10.1
mantine-datatable 7.10.1
└── @mantine/core 7.10.1 peer

@Elvincth
Copy link
Author

I am wondering is it related CSS layering in https://mantine.dev/styles/mantine-styles/? As currently I am using next.js it does not guarantee styles import order.

@arjunvegda
Copy link
Member

Thanks! The versions look good to me. I wonder if the culprit is this file 🤔. Mantine does not let us isolate styles so using it for library has become harder since Mantine v6 😓.

Could you create a small repro on CSB or Stackblitz please?

@Elvincth
Copy link
Author

Hey @arjunvegda I had successfully repro it in stackblitz, please take a look. It is using vite and react.

image

@arjunvegda
Copy link
Member

Thanks for the repro! This seems like a bug. Ideally, the styles should not create a conflict.

I wonder if this is a sign to move off of Mantine. 😓 Would you like to help with this?

For now, does swapping the order of the imports fix the issue?

-import "@mantine/core/styles.css";
import "jotai-devtools/styles.css";
+import "@mantine/core/styles.css";

@Elvincth
Copy link
Author

Thanks for the repro! This seems like a bug. Ideally, the styles should not create a conflict.

I wonder if this is a sign to move off of Mantine. 😓 Would you like to help with this?

For now, does swapping the order of the imports fix the issue?

-import "@mantine/core/styles.css";

import "jotai-devtools/styles.css";

+import "@mantine/core/styles.css";

Swapping import doesn't fix the problem, I could try investigate and fix it 👍

@arjunvegda arjunvegda added the help wanted Extra attention is needed label Jun 19, 2024
@arjunvegda
Copy link
Member

Weird, it works fine on Stackblitz when I swap it. There are probably conflicts in other components too.

And thanks a lot @Elvincth! We can connect over Discord if you'd like to help migrate the UI away from Mantine.

@Elvincth
Copy link
Author

Weird, it works fine on Stackblitz when I swap it. There are probably conflicts in other components too.

And thanks a lot @Elvincth! We can connect over Discord if you'd like to help migrate the UI away from Mantine.

Hey @arjunvegda, that sounds good where can I connect you through Discord?

@arjunvegda
Copy link
Member

What's your discord username? I'll send you an invite.

@Elvincth
Copy link
Author

What's your discord username? I'll send you an invite.

@Elvincth thanks!

@kvnxiao
Copy link

kvnxiao commented Jul 11, 2024

Just checking in, is this still an issue?

@Elvincth
Copy link
Author

Just checking in, is this still an issue?

Fixed in #157

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants