Skip to content

Commit

Permalink
docs: update configuration options
Browse files Browse the repository at this point in the history
  • Loading branch information
nasso committed Dec 22, 2022
1 parent 00f67ba commit 0f4d7af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions website/docs/api/docusaurus.config.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,8 @@ module.exports = {
},
},
colorMode: {
defaultMode: 'light',
defaultMode: 'auto',
disableSwitch: false,
respectPrefersColorScheme: true,
},
navbar: {
title: 'Site Title',
Expand Down
8 changes: 3 additions & 5 deletions website/docs/api/themes/theme-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ Accepted fields:

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `defaultMode` | <code>'light' \| 'dark'</code> | `'light'` | The color mode when user first visits the site. |
| `defaultMode` | <code>'light' \| 'dark' \| 'auto'</code> | `'light'` | The color mode when user first visits the site. |
| `disableSwitch` | `boolean` | `false` | Hides the switch in the navbar. Useful if you want to support a single color mode. |
| `respectPrefersColorScheme` | `boolean` | `false` | Whether to use the `prefers-color-scheme` media-query, using user system preferences, instead of the hardcoded `defaultMode`. |

```mdx-code-block
</APITable>
Expand All @@ -44,7 +43,6 @@ module.exports = {
colorMode: {
defaultMode: 'light',
disableSwitch: false,
respectPrefersColorScheme: false,
},
// highlight-end
},
Expand All @@ -53,9 +51,9 @@ module.exports = {

:::caution

With `respectPrefersColorScheme: true`, the `defaultMode` is overridden by user system preferences.
With `defaultMode: auto`, the theme is determined by user system preferences.

If you only want to support one color mode, you likely want to ignore user system preferences.
If you only want to support one color mode, you likely want to set `defaultMode: light` or `defaultMode: dark` instead.

:::

Expand Down

0 comments on commit 0f4d7af

Please sign in to comment.