From 77d092a731cea124008251555662f100b2a4e1d5 Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Sun, 10 Sep 2023 02:15:05 +0200 Subject: [PATCH] [system] Remove dead code --- packages/mui-system/src/cssVars/getInitColorSchemeScript.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/mui-system/src/cssVars/getInitColorSchemeScript.tsx b/packages/mui-system/src/cssVars/getInitColorSchemeScript.tsx index 4170e0ace8cd9c..d392ddbc8d053d 100644 --- a/packages/mui-system/src/cssVars/getInitColorSchemeScript.tsx +++ b/packages/mui-system/src/cssVars/getInitColorSchemeScript.tsx @@ -60,16 +60,13 @@ export default function getInitColorSchemeScript(options?: GetInitColorSchemeScr __html: `(function() { try { var mode = localStorage.getItem('${modeStorageKey}') || '${defaultMode}'; - var cssColorScheme = mode; var colorScheme = ''; if (mode === 'system') { // handle system mode var mql = window.matchMedia('(prefers-color-scheme: dark)'); if (mql.matches) { - cssColorScheme = 'dark'; colorScheme = localStorage.getItem('${colorSchemeStorageKey}-dark') || '${defaultDarkColorScheme}'; } else { - cssColorScheme = 'light'; colorScheme = localStorage.getItem('${colorSchemeStorageKey}-light') || '${defaultLightColorScheme}'; } } @@ -82,7 +79,7 @@ try { if (colorScheme) { ${colorSchemeNode}.setAttribute('${attribute}', colorScheme); } -} catch (e) {} })();`, +} catch(e){}})();`, }} /> );