material-ui
material-ui copied to clipboard
[system] Add `defaultMode` to `InitColorSchemeScript`
closes #43972
Root cause
InitColorSchemeScript has a hard-coded default mode as system when the user first visit to the site, however this contradict the flow if the project has <ThemeProvider defaultMode="light"> on user's dark environment.
Solution
- Add
defaultModetoInitColorSchemeScript. - Update docs to make sure that both places are defined for custom
defaultMode.
- [x] I have followed (at least) the PR section of the contributing guide.
Netlify deploy preview
Bundle size report
Details of bundle changes (Toolpad) Details of bundle changes
Generated by :no_entry_sign: dangerJS against ab80c0848676b0498e6ead28a3f5747ec631fcba
@siriwatknp what do you think about my previous comments?