File tree Expand file tree Collapse file tree 7 files changed +17
-40
lines changed
packages/@vuepress/plugin-search/src/client Expand file tree Collapse file tree 7 files changed +17
-40
lines changed Original file line number Diff line number Diff line change @@ -140,19 +140,7 @@ module.exports = {
140
140
141
141
You can customize the style of the search box via CSS variables:
142
142
143
- ` ` ` css
144
- : root {
145
- -- search- accent- color: #3eaf7c ;
146
- -- search- text- color: #2c3e50 ;
147
- -- search- border- color: #eaecef;
148
-
149
- -- search- item- text- color: #5d81a5 ;
150
- -- search- item- focus- bg- color: #f3f4f5;
151
-
152
- -- search- input- width: 8rem ;
153
- -- search- result- width: 20rem ;
154
- }
155
- ` ` `
143
+ @[code css](@vuepress/plugin-search/src/client/styles/vars.css)
156
144
157
145
## Components
158
146
Original file line number Diff line number Diff line change @@ -140,19 +140,7 @@ module.exports = {
140
140
141
141
你可以通过 CSS 变量来自定义搜索框的样式:
142
142
143
- ` ` ` css
144
- : root {
145
- -- search- accent- color: #3eaf7c ;
146
- -- search- text- color: #2c3e50 ;
147
- -- search- border- color: #eaecef;
148
-
149
- -- search- item- text- color: #5d81a5 ;
150
- -- search- item- focus- bg- color: #f3f4f5;
151
-
152
- -- search- input- width: 8rem ;
153
- -- search- result- width: 20rem ;
154
- }
155
- ` ` `
143
+ @[code css](@vuepress/plugin-search/src/client/styles/vars.css)
156
144
157
145
## 组件
158
146
Original file line number Diff line number Diff line change @@ -3,6 +3,9 @@ import { defineClientAppEnhance } from '@vuepress/client'
3
3
import { SearchBox } from './components/SearchBox'
4
4
import type { SearchBoxLocales } from './components/SearchBox'
5
5
6
+ import './styles/vars.css'
7
+ import './styles/search.css'
8
+
6
9
declare const __SEARCH_LOCALES__ : SearchBoxLocales
7
10
declare const __SEARCH_HOT_KEYS__ : string [ ]
8
11
declare const __SEARCH_MAX_SUGGESTIONS__ : number
Original file line number Diff line number Diff line change 9
9
useSearchSuggestions ,
10
10
useSuggestionsFocus ,
11
11
} from '../composables'
12
- import './SearchBox.css'
13
12
14
13
export type SearchBoxLocales = LocaleConfig < {
15
14
placeholder : string
Original file line number Diff line number Diff line change 1
- : root {
2
- --search-bg-color : # ffffff ;
3
- --search-accent-color : # 3eaf7c ;
4
- --search-text-color : # 2c3e50 ;
5
- --search-border-color : # eaecef ;
6
-
7
- --search-item-text-color : # 5d81a5 ;
8
- --search-item-focus-bg-color : # f3f4f5 ;
9
-
10
- --search-input-width : 8rem ;
11
- --search-result-width : 20rem ;
12
- }
13
-
14
1
.search-box {
15
2
display : inline-block;
16
3
position : relative;
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ : root {
2
+ --search-bg-color : # ffffff ;
3
+ --search-accent-color : # 3eaf7c ;
4
+ --search-text-color : # 2c3e50 ;
5
+ --search-border-color : # eaecef ;
6
+
7
+ --search-item-text-color : # 5d81a5 ;
8
+ --search-item-focus-bg-color : # f3f4f5 ;
9
+
10
+ --search-input-width : 8rem ;
11
+ --search-result-width : 20rem ;
12
+ }
You can’t perform that action at this time.
0 commit comments