File tree 1 file changed +8
-3
lines changed
packages/mui-material/src/styles
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -264,10 +264,15 @@ export default function createPalette(palette) {
264
264
return color ;
265
265
} ;
266
266
267
- const modes = { dark : getDark ( ) , light : getLight ( ) } ;
267
+ let modeHydrated ;
268
+ if ( mode === 'light' ) {
269
+ modeHydrated = getLight ( ) ;
270
+ } else if ( mode === 'dark' ) {
271
+ modeHydrated = getDark ( ) ;
272
+ }
268
273
269
274
if ( process . env . NODE_ENV !== 'production' ) {
270
- if ( ! modes [ mode ] ) {
275
+ if ( ! modeHydrated ) {
271
276
console . error ( `MUI: The palette mode \`${ mode } \` is not supported.` ) ;
272
277
}
273
278
}
@@ -310,7 +315,7 @@ export default function createPalette(palette) {
310
315
// E.g., shift from Red 500 to Red 300 or Red 700.
311
316
tonalOffset,
312
317
// The light and dark mode object.
313
- ...modes [ mode ] ,
318
+ ...modeHydrated ,
314
319
} ,
315
320
other ,
316
321
) ;
You can’t perform that action at this time.
0 commit comments