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
Copy file name to clipboardExpand all lines: README.md
+3-4Lines changed: 3 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -189,19 +189,18 @@ 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.
193
-
The searchbar automatically reacts to changes to the system mode. If you want to force dark mode you can set the option to `'always'`.
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.
194
193
195
194
Example:
196
195
197
196
```javascript
198
197
docsSearchBar({
199
198
...
200
-
enableDarkMode:true
199
+
enableDarkMode:'auto'
201
200
})
202
201
```
203
202
204
-
Dark mode with `enableDarkMode` set to `true` and system mode set to `dark`:
203
+
Dark mode with `enableDarkMode` set to `auto` and system mode set to `dark`:
205
204
206
205

Copy file name to clipboardExpand all lines: src/lib/DocsSearchBar.js
+6-8Lines changed: 6 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ import { MeiliSearch } from 'meilisearch'
21
21
* @param {function} [options.handleSelected] This function is called when a suggestion is selected
22
22
* @param {function} [options.enhancedSearchInput] When set to true, a theme is applied to the search box to improve its appearance
23
23
* @param {'column'|'simple'} [options.layout] Layout of the search bar
24
-
* @param {boolean|'always'} [options.enableDarkMode] Allows you to display the searchbar in dark mode. Can be forced with the string 'always'
24
+
* @param {boolean|'auto'} [options.enableDarkMode] Allows you to display the searchbar in dark mode. Option 'auto' automatically sets the mode based on the system mode
25
25
* @return {Object}
26
26
*/
27
27
constusage=`Usage:
@@ -174,7 +174,7 @@ class DocsSearchBar {
174
174
* Wraps input selector in a docs-searchbar-js div
175
175
* @function addThemeWrapper
176
176
* @param {string} inputSelector Selector of the input element
177
-
* @param {boolean|'always'} enableDarkMode Wether darkMode is enabled
177
+
* @param {boolean|'auto'} enableDarkMode Wether darkMode is enabled
0 commit comments