From 5a388f7a206820951d5877818e4c90a065f093b4 Mon Sep 17 00:00:00 2001 From: anle9650 Date: Tue, 19 Sep 2023 22:19:59 -0600 Subject: [PATCH 1/3] Update ThemeContext.js --- docs/src/modules/components/ThemeContext.js | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/src/modules/components/ThemeContext.js b/docs/src/modules/components/ThemeContext.js index a30fdcc08d7702..92efb208e695a0 100644 --- a/docs/src/modules/components/ThemeContext.js +++ b/docs/src/modules/components/ThemeContext.js @@ -202,6 +202,7 @@ export function ThemeProvider(props) { document.body.classList.add('mode-light'); } + document.documentElement.dataset.muiColorScheme = paletteMode; const metas = document.querySelectorAll('meta[name="theme-color"]'); metas.forEach((meta) => { meta.setAttribute('content', getMetaThemeColor(paletteMode)); From 6913b4b8c0777b5af19d0c2b45c956d8cace0e98 Mon Sep 17 00:00:00 2001 From: anle9650 Date: Tue, 19 Sep 2023 22:26:25 -0600 Subject: [PATCH 2/3] Update ThemeContext.js --- docs/src/modules/components/ThemeContext.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/src/modules/components/ThemeContext.js b/docs/src/modules/components/ThemeContext.js index 92efb208e695a0..63369296299bdb 100644 --- a/docs/src/modules/components/ThemeContext.js +++ b/docs/src/modules/components/ThemeContext.js @@ -193,6 +193,8 @@ export function ThemeProvider(props) { }, [direction]); useEnhancedEffect(() => { + document.documentElement.dataset.muiColorScheme = paletteMode; + // To support light and dark mode images in the docs if (paletteMode === 'dark') { document.body.classList.remove('mode-light'); @@ -201,8 +203,7 @@ export function ThemeProvider(props) { document.body.classList.remove('mode-dark'); document.body.classList.add('mode-light'); } - - document.documentElement.dataset.muiColorScheme = paletteMode; + const metas = document.querySelectorAll('meta[name="theme-color"]'); metas.forEach((meta) => { meta.setAttribute('content', getMetaThemeColor(paletteMode)); From 9cbc22d93db75cb16653a749c33f9d877c2f48d0 Mon Sep 17 00:00:00 2001 From: anle9650 Date: Tue, 19 Sep 2023 22:27:15 -0600 Subject: [PATCH 3/3] Update ThemeContext.js --- docs/src/modules/components/ThemeContext.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/modules/components/ThemeContext.js b/docs/src/modules/components/ThemeContext.js index 63369296299bdb..66a674f7d3ca08 100644 --- a/docs/src/modules/components/ThemeContext.js +++ b/docs/src/modules/components/ThemeContext.js @@ -203,7 +203,7 @@ export function ThemeProvider(props) { document.body.classList.remove('mode-dark'); document.body.classList.add('mode-light'); } - + const metas = document.querySelectorAll('meta[name="theme-color"]'); metas.forEach((meta) => { meta.setAttribute('content', getMetaThemeColor(paletteMode));