File tree 2 files changed +11
-13
lines changed
src/client/theme-default/components
2 files changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -113,10 +113,19 @@ if (!__ALGOLIA__ && theme.value.offlineSearch) {
113
113
}
114
114
})
115
115
}
116
+
117
+ const metaKey = ref (` 'Meta' ` )
118
+
119
+ onMounted (() => {
120
+ // meta key detect (same logic as in @docsearch/js)
121
+ metaKey .value = / (Mac| iPhone| iPod| iPad)/ i .test (navigator .platform )
122
+ ? ` '⌘' `
123
+ : ` 'Ctrl' `
124
+ })
116
125
</script >
117
126
118
127
<template >
119
- <div class =" VPNavBarSearch" >
128
+ <div class =" VPNavBarSearch" :style = " { '--vp-meta-key': metaKey } " >
120
129
<template v-if =" theme .algolia " >
121
130
<VPAlgoliaSearchBox v-if =" loaded" :algolia =" theme.algolia" />
122
131
Original file line number Diff line number Diff line change 1
1
<script lang="ts" setup>
2
- import { onMounted , ref } from ' vue'
3
-
4
2
defineProps <{
5
3
placeholder: string
6
4
}>()
7
-
8
- const metaKey = ref (` 'Meta' ` )
9
-
10
- onMounted (() => {
11
- // meta key detect (same logic as in @docsearch/js)
12
- metaKey .value = / (Mac| iPhone| iPod| iPad)/ i .test (navigator .platform )
13
- ? ` '⌘' `
14
- : ` 'Ctrl' `
15
- })
16
5
</script >
17
6
18
7
<template >
@@ -210,7 +199,7 @@ onMounted(() => {
210
199
}
211
200
212
201
.DocSearch-Button .DocSearch-Button-Key :first-child :after {
213
- content : v-bind(metaKey );
202
+ content : var ( --vp-meta-key );
214
203
font-size : 12px ;
215
204
letter-spacing : normal ;
216
205
color : var (--docsearch-muted-color );
You can’t perform that action at this time.
0 commit comments