Skip to content

Commit 8404fad

Browse files
committed
Add indicator for searchbar keybinding
1 parent 9e79dfe commit 8404fad

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

assets/__default/flexsearch.css

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,20 @@
33
font-size: 16px;
44
}
55

6+
#multi-page-nav .search .search-keybinding {
7+
float: right;
8+
width: 0;
9+
transform: translateX(-1em);
10+
color: #999;
11+
}
12+
13+
#multi-page-nav .search:focus-within .search-keybinding {
14+
display: none;
15+
}
16+
617
#multi-page-nav .search #search-input {
718
border: 1px solid #666;
8-
border-radius: 3px;
19+
border-radius: 3.2px;
920
color: #999;
1021
background-color: unset;
1122
height: 1.8rem;

src/search/flexsearch.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,13 @@ function inject_html!(parent)
125125
Dict("id" => "search-result-container", "class" => "suggestions hidden"),
126126
)
127127
push!(div.children, suggestions)
128+
keybinding = Gumbo.HTMLElement{:div}(
129+
[],
130+
div,
131+
Dict("class" => "search-keybinding"),
132+
)
133+
push!(keybinding.children, Gumbo.HTMLText(keybinding, "/"))
134+
push!(div.children, keybinding)
128135
end
129136

130137
function to_json_index(index::SearchIndex, file)

0 commit comments

Comments
 (0)