diff --git a/src/theme/theme.ts b/src/theme/theme.ts index 71a42e9b..353dd1a7 100644 --- a/src/theme/theme.ts +++ b/src/theme/theme.ts @@ -7,14 +7,11 @@ export const drawerWidth = 240; export const createCustomTheme = (mode: PaletteMode, brandPalette?: Interactiveness) => { const basePalette = mode == 'light' ? lightModePalette : darkModePalette; - const themePalette = brandPalette - ? Object.assign({}, basePalette, { - background: { - brand: brandPalette - } - }) - : basePalette; + const themePalette = structuredClone(basePalette); + if (brandPalette && themePalette.background) { + themePalette.background.brand = brandPalette; + } return createTheme({ palette: { mode,