I am attempting to enhance the current options within MUI's theme palette by adding a couple of properties. Take a look at this example:
declare module @material-ui/core/styles/createMuiTheme {
interface CustomOptions extends SimplePaletteColorOptions {
lightest?: string
darkest?: string
}
interface InfoPalette {
info: CustomOptions
}
interface PaletteOptions {
info: CustomOptions
}
interface Palette {
info: InfoPalette
}
}
The goal is to include lightest
and darkest
as new properties in the main color categories within the theme like info
, success
, and so on. While I can successfully create new categories for custom styles, extending existing ones has proven challenging as Typescript continues to flag these properties as non-existent.
For more insights on this matter, you can refer to a similar thread that does not quite address the issue directly: Can't customize color palette types on Material UI theme in TypeScript