[theme] Fix Hidden breakpoints issues and updates the migration guide#22702
[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
adaptV4Themeutility to support thetypepalette prop. In addition themigration-v4.mdtheme breaking changes is updated.