You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
453: Automatic dark/light mode toggle, force dark mode r=bidoubiwa a=ColinFrick
This adds a new event listener to the color scheme, and `always` as a third option for `enableDarkMode`
Any objection against the option value `always`? It could also be `force` or something like that?
What do you think?
Closes#369
Co-authored-by: Colin Frick <[email protected]>
Co-authored-by: colin.frick <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+8-3Lines changed: 8 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -189,18 +189,23 @@ docsSearchBar({
189
189
##### `enableDarkMode`<!-- omit in toc -->
190
190
191
191
Allows you to display the searchbar in dark mode. It is useful if your website has dark mode support and you also want the searchbar to appear in a dark version.
192
-
You can always edit the style of the searchbar to match the style of your website.
192
+
You can always edit the style of the searchbar to match the style of your website. When the option `enableDarkMode` is set to `auto`, the searchbar automatically sets the mode to the system mode.
193
+
194
+
`enableDarkMode` has three possible states:
195
+
-`false`: enforce light mode.
196
+
-`true`: enforce dark mode.
197
+
-`auto`: system mode (light or dark).
193
198
194
199
Example:
195
200
196
201
```javascript
197
202
docsSearchBar({
198
203
...
199
-
enableDarkMode:true
204
+
enableDarkMode:'auto'
200
205
})
201
206
```
202
207
203
-
Dark mode with `enableDarkMode` set to `true` and system mode set to `dark`:
208
+
Dark mode with `enableDarkMode` set to `auto` and system mode set to `dark`:
204
209
205
210

0 commit comments