@@ -14,17 +14,17 @@ const { theme } = useData()
14
14
// hit the hotkey to invoke it.
15
15
const loaded = ref (false )
16
16
17
- const metaKey = ref ()
17
+ const metaKey = ref (` 'Meta' ` )
18
18
19
19
onMounted (() => {
20
20
if (! theme .value .algolia ) {
21
21
return
22
22
}
23
23
24
24
// meta key detect (same logic as in @docsearch/js)
25
- metaKey .value . textContent = / (Mac| iPhone| iPod| iPad)/ i .test (navigator .platform )
26
- ? ' ⌘'
27
- : ' Ctrl'
25
+ metaKey .value = / (Mac| iPhone| iPod| iPad)/ i .test (navigator .platform )
26
+ ? ` '⌘' `
27
+ : ` 'Ctrl' `
28
28
29
29
const handleSearchHotKey = (e : KeyboardEvent ) => {
30
30
if (e .key === ' k' && (e .ctrlKey || e .metaKey )) {
@@ -79,7 +79,7 @@ function load() {
79
79
<span class =" DocSearch-Button-Placeholder" >{{ theme.algolia?.buttonText || 'Search' }}</span >
80
80
</span >
81
81
<span class =" DocSearch-Button-Keys" >
82
- <kbd class =" DocSearch-Button-Key" ref = " metaKey " >Meta </kbd >
82
+ <kbd class =" DocSearch-Button-Key" > </kbd >
83
83
<kbd class =" DocSearch-Button-Key" >K</kbd >
84
84
</span >
85
85
</button >
@@ -255,6 +255,23 @@ function load() {
255
255
padding-right : 6px ;
256
256
}
257
257
258
+ .DocSearch-Button .DocSearch-Button-Key :first-child {
259
+ font-size : 1px ;
260
+ letter-spacing : -1px ;
261
+ color : transparent ;
262
+ }
263
+
264
+ .DocSearch-Button .DocSearch-Button-Key :first-child :after {
265
+ content : v-bind(metaKey);
266
+ font-size : 12px ;
267
+ letter-spacing : normal ;
268
+ color : var (--docsearch-muted-color );
269
+ }
270
+
271
+ .DocSearch-Button .DocSearch-Button-Key :first-child > * {
272
+ display : none ;
273
+ }
274
+
258
275
.dark .DocSearch-Footer {
259
276
border-top : 1px solid var (--vp-c-divider );
260
277
}
0 commit comments