diff --git a/docs/src/modules/components/ThemeContext.js b/docs/src/modules/components/ThemeContext.js index a30fdcc08d7702..66a674f7d3ca08 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');