Skip to content

Commit

Permalink
[system] Remove dead code (#38884)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored Sep 10, 2023
1 parent 8dd133f commit 60db3b0
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/mui-system/src/cssVars/getInitColorSchemeScript.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}';
}
}
Expand All @@ -82,7 +79,7 @@ try {
if (colorScheme) {
${colorSchemeNode}.setAttribute('${attribute}', colorScheme);
}
} catch (e) {} })();`,
} catch(e){}})();`,
}}
/>
);
Expand Down

0 comments on commit 60db3b0

Please sign in to comment.