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

[material-ui] Fix createTheme with just color schemes #43518

Merged
merged 6 commits into from
Sep 2, 2024

Conversation

siriwatknp
Copy link
Member

@siriwatknp siriwatknp commented Aug 29, 2024

closes #43508, closes #43533

@siriwatknp siriwatknp added bug 🐛 Something doesn't work package: material-ui Specific to @mui/material customization: theme Centered around the theming features labels Aug 29, 2024
@mui-bot
Copy link

mui-bot commented Aug 29, 2024

Netlify deploy preview

https://deploy-preview-43518--material-ui.netlify.app/

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 3df87c5

packages/mui-material/src/styles/createTheme.ts Outdated Show resolved Hide resolved
theme.defaultColorScheme = defaultColorSchemeInput;
theme.colorSchemes = colorSchemesInput as Record<string, ColorSystem>;

if (theme.palette.mode === 'light') {
theme.colorSchemes.light = { palette: theme.palette } as ColorSystem;
theme.colorSchemes.light = {
...(colorSchemesInput.light !== true && colorSchemesInput.light),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this covered by line 100 above?

Copy link
Member Author

@siriwatknp siriwatknp Aug 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this line, the other fields that are not palette will be overridden because of the reassigning theme.colorSchemes.light.

@siriwatknp siriwatknp merged commit e13f1c9 into mui:master Sep 2, 2024
19 checks passed
@ksn5
Copy link

ksn5 commented Sep 2, 2024

@siriwatknp Thank you for addressing the issue. Could you please let me know when we can expect the patch version to be released with this fix?

@DiegoAndai
Copy link
Member

@ksn5 this should be available in the next patch version, 6.0.2, which should come out this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work customization: theme Centered around the theming features package: material-ui Specific to @mui/material
Projects
None yet
4 participants