Skip to content

Commit 9e79dfe

Browse files
committed
Improve search js and css
1 parent 7a1982d commit 9e79dfe

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

assets/__default/flexsearch.css

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@
1111
height: 1.8rem;
1212
font-family: Glober;
1313
width: 20em;
14+
font-size: 14px;
15+
padding: 0 8px;
1416
}
1517

1618
#multi-page-nav .search #search-input::placeholder {
1719
color: #999;
20+
opacity: 1;
1821
}
1922

2023
#multi-page-nav .search:focus-within #search-input {
@@ -24,6 +27,11 @@
2427
color: #000;
2528
}
2629

30+
.theme--documenter-dark #multi-page-nav .search:focus-within #search-input {
31+
background-color: #202227;
32+
color: #eee;
33+
}
34+
2735
#multi-page-nav .search:focus-within .suggestions {
2836
display: block;
2937
}
@@ -49,6 +57,16 @@
4957
overflow-y: auto;
5058
}
5159

60+
.theme--documenter-dark #multi-page-nav .suggestions {
61+
background: #2e3138;
62+
border: 1px solid #5e6d6f;
63+
}
64+
65+
.theme--documenter-dark #multi-page-nav .suggestion a:hover,
66+
.theme--documenter-dark #multi-page-nav .suggestion a:focus {
67+
background-color: #202227;
68+
}
69+
5270
#multi-page-nav .suggestions .suggestion {
5371
line-height: 1.4;
5472
border-radius: 4px;
@@ -66,7 +84,7 @@
6684
}
6785

6886
#multi-page-nav .suggestion a:hover,
69-
.suggestion a:focus {
87+
#multi-page-nav .suggestion a:focus {
7088
background-color: #eee;
7189
}
7290

assets/__default/flexsearch_integration.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
registerSearchListener()
156156

157157
document.body.addEventListener('keydown', ev => {
158-
if (ev.key === '/') {
158+
if (document.activeElement === document.body && (ev.key === '/' || ev.key === 's')) {
159159
document.getElementById('search-input').focus()
160160
ev.preventDefault()
161161
}

assets/__default/stork_integration.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// custom search widget
22
(function() {
33
function initialize() {
4-
stork.register("multidocumenter", "/stork.st")
4+
stork.register('multidocumenter', '/stork.st')
55

66
document.body.addEventListener('keydown', ev => {
7-
if (ev.key === '/') {
7+
if (document.activeElement === document.body && (ev.key === '/' || ev.key === 's')) {
88
document.getElementById('search-input').focus()
99
ev.preventDefault()
1010
}

0 commit comments

Comments
 (0)