File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
docs/src/modules/components/overview/pickers Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,14 @@ const components: Components<Theme> = {
6565 } ,
6666} ;
6767
68+ // Use CSS variables to avoid first load light/dark blink.
69+ const darkThemeManagement = {
70+ colorSchemes : { light : true , dark : true } ,
71+ cssVariables : {
72+ colorSchemeSelector : 'data-mui-color-scheme' ,
73+ } ,
74+ } ;
75+
6876export default function MainDemo ( ) {
6977 const brandingTheme = useTheme ( ) ;
7078 const isMobile = useMediaQuery ( brandingTheme . breakpoints . down ( 'sm' ) ) ;
@@ -77,7 +85,7 @@ export default function MainDemo() {
7785 setShowCustomTheme ( ( prev ) => ! prev ) ;
7886 } ;
7987
80- const theme = createTheme ( { palette : { mode : brandingTheme . palette . mode } } ) ;
88+ const theme = createTheme ( darkThemeManagement , { palette : { mode : brandingTheme . palette . mode } } ) ;
8189 const customTheme = createTheme ( brandingTheme , {
8290 components,
8391 shape : { borderRadius : 8 } ,
You can’t perform that action at this time.
0 commit comments