-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
Theme provider wrong import results in inconsitent styling #27628
Comments
Can you make some examples of what does not work because
Can you share an example of a wrongly processed theme or do you have nested theming in application? |
Sure here is a simple example: https://codesandbox.io/s/theming-material-demo-forked-fnhvx?file=/demo.js The issue also applies to many other components whos type depends on a theme, as well as the darkscrollBar helper. |
It works as expected behaviour. Look you got context from But material UI in v5 under the hood uses emotion as its styling engine. If you look at In my opinion |
@stevemk14ebr Were you using v4 before, migrating from it to v5? I'm asking to understand why you are using |
I used From this documentation the difference between the two imports doesn't seem to be mentioned at all. As a user I found the difference in behavior extremely confusing. Under no circumstance would I expect that a button who is inside of a theme provider, would not use that theme! This is an example of what I mean: There should be no difference between these two in my opinion:
The documentation states that theme provider provides a theme to sub-elements, if it does not do that, as this examples show, then I would kindly suggest it be renamed to avoid user confusion like this! |
from: https://next.material-ui.com/styles/api/#heading-themeprovider |
@stevemk14ebr Ok great we are good then, for now (until we get more feedback). In #27639 we make it clearer It's also an argument in favor of having a separate docs environment for different parts of the project. To emphasize that this doc, includes multiple different products. @mnajdova When should we leverage https://docs.npmjs.com/deprecating-and-undeprecating-packages-or-package-versions#deprecating-an-entire-package? |
This one took me quite a while to figure out. What was occurring for me was inconsistent application of style at different levels of the dom hierarchy and different styling across browsers. The reason was the following:
instead of
symptoms:
It would be nice if the incorrect import would fail, or at the very least warn the user with a big fat console message. It's very odd debugging something that partially works!
The text was updated successfully, but these errors were encountered: