diff --git a/public/locales/en.json b/public/locales/en.json index 707a676c..4edd047a 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -829,7 +829,7 @@ }, "info": { "creating_theme": "Create a custom theme with the <2>MUI Theme Creator, copy everything after \"themeOptions\" from \"{\" to \"}\" and paste it into the \"theme\" text field.", - "theme_mode_lock": "In case the \"mode\" is defined in the \"palette\" object, the theme will be locked into this mode and will not change regardless of the apps device theme" + "theme_mode_lock": "In case \"mode\" or \"type\" is defined in the \"palette\" object, the theme will be locked into this mode and will not change regardless of the selected apps device theme" }, "theme_name": "Name" }, diff --git a/src/theme.ts b/src/theme.ts index f67e19aa..b464de65 100644 --- a/src/theme.ts +++ b/src/theme.ts @@ -29,8 +29,9 @@ export const createTheme = ( ) => { const systemMode = MediaQuery.getSystemThemeMode(); - const isStaticThemeMode = !!appTheme.muiTheme.palette?.mode; - const appThemeMode = appTheme.muiTheme.palette?.mode === 'dark' ? ThemeMode.DARK : ThemeMode.LIGHT; + const appThemeType = (appTheme.muiTheme.palette as any)?.type ?? appTheme.muiTheme.palette?.mode; + const isStaticThemeMode = !!appThemeType; + const appThemeMode = appThemeType === 'dark' ? ThemeMode.DARK : ThemeMode.LIGHT; const staticThemeMode = isStaticThemeMode ? appThemeMode : undefined; const mode = staticThemeMode ?? (themeMode === ThemeMode.SYSTEM ? systemMode : themeMode);