diff --git a/packages/mui-material/src/styles/ThemeProviderWithVars.test.js b/packages/mui-material/src/styles/ThemeProviderWithVars.test.js index 40815035040a50..ac438617e5228d 100644 --- a/packages/mui-material/src/styles/ThemeProviderWithVars.test.js +++ b/packages/mui-material/src/styles/ThemeProviderWithVars.test.js @@ -384,7 +384,7 @@ describe('[Material UI] ThemeProviderWithVars', () => { expect(() => { fireEvent.click(screen.getByText('Dark')); }).toErrorDev([ - 'MUI: The `setMode` function has no effect if `colorSchemeSelector` is not configured.\nPlease create a theme with `createTheme({ cssVariables: { colorSchemeSelector: "class" | "data" } })`.\nTo learn more, visit https://mui.com/material-ui/customization/css-theme-variables/configuration/#toggling-dark-mode-manually', + 'MUI: The `setMode` function has no effect if `colorSchemeSelector` is not configured.\nTo toggle the mode manually, please configure `colorSchemeSelector` to use a class or data attribute.\nTo learn more, visit https://mui.com/material-ui/customization/css-theme-variables/configuration/#toggling-dark-mode-manually', ]); }); }); diff --git a/packages/mui-system/src/cssVars/createCssVarsProvider.js b/packages/mui-system/src/cssVars/createCssVarsProvider.js index 420b7efed48ee2..b6341ec97e2b27 100644 --- a/packages/mui-system/src/cssVars/createCssVarsProvider.js +++ b/packages/mui-system/src/cssVars/createCssVarsProvider.js @@ -249,7 +249,7 @@ export default function createCssVarsProvider(options) { console.error( [ 'MUI: The `setMode` function has no effect if `colorSchemeSelector` is not configured.', - 'Please create a theme with `createTheme({ cssVariables: { colorSchemeSelector: "class" | "data" } })`.', + 'To toggle the mode manually, please configure `colorSchemeSelector` to use a class or data attribute.', 'To learn more, visit https://mui.com/material-ui/customization/css-theme-variables/configuration/#toggling-dark-mode-manually', ].join('\n'), );