CreateTheme: MUI 6: how to combine colorSchemes with theme.palette.augmentColor(...) #44351
Labels
customization: theme
Centered around the theming features
package: material-ui
Specific to @mui/material
support: question
Community support but can be turned into an improvement
v6.x migration
We are updating our MUI material UI theme to follow version 6 recommendations and stumbled upon the documentation that colorSchemes is the preferred way going forward. I adjusted my theme with light and dark themes palettes but we have some custom colors we like to augment. The documentation on augmentColors specifies to use the initial theme to create an updated theme with createTheme(theme, {...}) where you specify the custom colors. But I don't get it to work with dark and light theme palettes for these custom colors as specifying just palette on the second theme creation overrides the initial theme as stated in the documentation and spreading theme.colorSchemes.light.palette gives TypeScript errors that Theme doesn't have this property.
Can someone help me to find a way to get custom augmented colors to work with colorSchemes for light and dark?
Search keywords:
The text was updated successfully, but these errors were encountered: