-
Notifications
You must be signed in to change notification settings - Fork 121
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
Is it possible to disable chakra global styles? #232
Comments
Hey @thenano, thanks for bringing this up, we can expose this flag if it would be helpful. PRs are welcome! |
Thanks for the reply @masiulis! I had an initial hack at adding those flags to the provider and it didn't solve my problem, and also seemed to impact RSI styles negatively. I'll try and have a deeper look into it and report back. |
@thenano Any luck on finding a way to disable the global styles? Otherwise, going to dive into myself and will post my findings |
Hey @schembor I have managed to disable the global styles and cssRest by passing |
Hey @schembor @thenano I didn't realise chakra was polluting global scope without a way to avoid it, that's pretty bad. We can definitely disable the global overrides and add our own. From the comment: So what I think should be done is add EDIT: previously discussed in #102 |
Would love to see this change implemented! FWIW conditionally rendering the import hides the worst of the damage. You can still see the style changing in the background when the modal opens however.
|
Would it make sense to use Web components for this? https://developer.mozilla.org/en-US/docs/Web/API/Web_components so the element is encapsulated and does not apply chakra ui to the whole DOM? |
I have also use MUI for application styling. want to use this library for spreadsheets import. Can i use this without installing Chakra UI packages ? |
We use RSI in an app that uses MUI for the rest of it's styling. This seems to work almost fine, except there are some global chakra styles that leak when rendering RSI which in turn impact our app styles (thinks like body font size, and some spacing get's messed up).
I've seen that chakra has a "disableGlobalStyles" prop that can be passed to the provider which the documentation suggests would avoid this sort of leak, so I'm wondering if there's a way this can be done with RSI?
I have tried to wrap RSI with a ChakraProvider with the said prop but it didn't have any impact. I'm wondering if there's any other ways to do this that anyone would know of, or if we could pass props that could be set specifically in the provider?
Thanks very much!
The text was updated successfully, but these errors were encountered: