mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-24 03:58:49 +02:00
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:
parent
e442ac95ee
commit
53b28d2bb2
7 changed files with 171 additions and 24 deletions
|
@ -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: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue