Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
siriwatknp committed Oct 17, 2024
1 parent 42ad012 commit ab80c08
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/data/material/customization/dark-mode/dark-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,14 @@ To set a different default mode, pass the `defaultMode` prop to the ThemeProvide
The `defaultMode` value can be `'light'`, `'dark'`, or `'system'`.
:::

### InitColorSchemeScript component

If you are using the `InitColorSchemeScript` component to [prevent SSR flicker](/material-ui/customization/css-theme-variables/configuration/#preventing-ssr-flickering), you have to set the `defaultMode` with the same value you passed to the `ThemeProvider` component:

```js
<InitColorSchemeScript defaultMode="dark">
```

## Styling in dark mode

Use the `theme.applyStyles` utility to apply styles for a specific mode.
Expand Down

0 comments on commit ab80c08

Please sign in to comment.