Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(v2): Added switch config docs to theme-classic API #3194

Merged
merged 15 commits into from
Aug 5, 2020
2 changes: 1 addition & 1 deletion website/docs/api/docusaurus.config.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ module.exports = {
switchConfig: {
darkIcon: '🌙',
lightIcon: '\u2600',
// React inline style objects
// React inline style object
// see https://reactjs.org/docs/dom-elements.html#style
darkIconStyle: {
marginLeft: '2px',
Expand Down
23 changes: 22 additions & 1 deletion website/docs/theme-classic.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The classic theme provides by default light and dark mode support, with a navbar

It is possible to customize the color mode support with the following configuration:

```js {6-15} title="docusaurus.config.js"
```js {6-35} title="docusaurus.config.js"
module.exports = {
// ...
themeConfig: {
Expand All @@ -33,6 +33,27 @@ module.exports = {
// Should we use the prefers-color-scheme media-query,
// using user system preferences, instead of the hardcoded defaultMode
respectPrefersColorScheme: false,

// Dark/light switch icon options
switchConfig: {
// Icon for the switch while in dark mode
darkIcon: '🌙',

// CSS to apply to dark icon,
// React inline style object
// see https://reactjs.org/docs/dom-elements.html#style
darkIconStyle: {
marginLeft: '2px',
},

// Unicode icons such as `\u2600` will work if
// the code is 4 characters long and not 5 e.g. `\u1F602`
lightIcon: '\u2600',
slorber marked this conversation as resolved.
Show resolved Hide resolved

lightIconStyle: {
marginLeft: '1px',
},
},
},
// ...
},
Expand Down