From d9378b9b7614871efed584e1e33b2ae197b1c001 Mon Sep 17 00:00:00 2001 From: siriwatknp Date: Mon, 16 Sep 2024 15:09:12 +0700 Subject: [PATCH] fix warning --- packages/mui-material/src/styles/ThemeProviderWithVars.test.js | 2 +- packages/mui-system/src/cssVars/createCssVarsProvider.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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'), );