-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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] Fix Hidden breakpoints issues and updates the migration guide #22702
Conversation
|
Correct, I think we should just document this as a breaking change that we cannot backport..
For the input we are good, people can specify it as |
Happy to do that.
Ok I see. What about we have diff --git a/packages/material-ui/src/styles/adaptV4Theme.js b/packages/material-ui/src/styles/adaptV4Theme.js
index bc0adac56e..c67386fcbc 100644
--- a/packages/material-ui/src/styles/adaptV4Theme.js
+++ b/packages/material-ui/src/styles/adaptV4Theme.js
@@ -74,17 +74,20 @@ export default function adaptV4Theme(inputTheme) {
...mixins,
};
- const { type: mode, ...paletteRest } = palette;
+ const { type, mode, ...paletteRest } = palette;
+
+ const finalMode = mode || type || 'light';
// theme.palette.text.hint
theme.palette = {
text: {
hint:
- palette.mode === 'dark' || palette.type === 'dark'
+ finalMode === 'dark'
? 'rgba(255, 255, 255, 0.5)'
: 'rgba(0, 0, 0, 0.38)',
},
- mode,
+ mode: finalMode,
+ type: finalMode,
...paletteRest,
}; |
I guess we could also handle #22695 (comment) here too O:). |
Agree, let me do the updates and fix the Hidden component 👍 |
@oliviertassinari changes are implemented, please take another look :) |
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
This PR addresses #22695 (comment) and updates the
adaptV4Theme
utility to support thetype
palette prop. In addition themigration-v4.md
theme breaking changes is updated.