Skip to content

Commit

Permalink
fix: custom color schemes
Browse files Browse the repository at this point in the history
  • Loading branch information
siriwatknp committed Aug 5, 2024
1 parent 4306f26 commit 47d98eb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/mui-material/src/styles/createTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ export default function createTheme(
}

theme.defaultColorScheme = defaultColorSchemeInput;
theme.colorSchemes = {};
theme.colorSchemes = colorSchemesInput as Record<string, ColorSystem>;

if (theme.palette.mode === 'light') {
theme.colorSchemes = { light: { palette: theme.palette } as ColorSystem };
theme.colorSchemes.light = { palette: theme.palette } as ColorSystem;
attachColorScheme(theme, 'dark', colorSchemesInput.dark);
}
if (theme.palette.mode === 'dark') {
theme.colorSchemes = { dark: { palette: theme.palette } as ColorSystem };
theme.colorSchemes.dark = { palette: theme.palette } as ColorSystem;
attachColorScheme(theme, 'light', colorSchemesInput.light);
}

Expand Down

0 comments on commit 47d98eb

Please sign in to comment.