feat(v2): dark mode toggle customization (#3127)

* Add dark/light style fields to config

* Update yarn.lock

* Remove css content

* Add documentation

* Add icon fields to toggle component

* Add config validation fields

* Remove changes from docusaurus.config

* Add unicode documentation example

* Fix default values

* Add color mode config default

* Add lodash to theme-classic

* Change themeConfigSchema name to match other packages

* Add themeConfig color-mode tests

* Add default config merge function

* Remove unneeded object merging

* Add more documentation
This commit is contained in:
Drew Alexander 2020-07-31 21:39:12 +08:00 committed by GitHub
parent e442ac95ee
commit 53b28d2bb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 171 additions and 24 deletions

View file

@ -158,6 +158,22 @@ Example:
```js title="docusaurus.config.js"
module.exports = {
themeConfig: {
colorMode: {
defaultMode: 'light',
disableSwitch: false,
respectPrefersColorScheme: true,
switchConfig: {
darkIcon: '🌙',
darkIconStyle: { // Style object passed to inline CSS
// For more information about styling options visit: https://reactjs.org/docs/dom-elements.html#style
marginLeft: '2px',
},
lightIcon: '\u2600',
lightIconStyle: {
marginLeft: '1px',
},
},
},
navbar: {
title: 'Site Title',
logo: {