Skip to content

Commit 89e1fb3

Browse files
committed
rustdoc: fix the search-bar layout
Now with broader compatibility.
1 parent 67aca9c commit 89e1fb3

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/librustdoc/html/layout.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,13 @@ pub fn render<T: fmt::Default, S: fmt::Default>(
5858
5959
<nav class=\"sub\">
6060
<form class=\"search-form js-only\">
61-
<input class=\"search-input\" name=\"search\"
62-
autocomplete=\"off\"
63-
placeholder=\"Search documentation...\"
64-
type=\"search\" />
6561
<button class=\"do-search\">Search</button>
62+
<div class=\"search-container\">
63+
<input class=\"search-input\" name=\"search\"
64+
autocomplete=\"off\"
65+
placeholder=\"Search documentation...\"
66+
type=\"search\" />
67+
</div>
6668
</form>
6769
</nav>
6870

src/librustdoc/html/static/main.css

+5-1
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,14 @@ a {
233233
.content a.fn, .block a.current.fn { color: #8c6067; }
234234
.content .fnname { color: #8c6067; }
235235

236+
.search-container {
237+
padding-right: 10px;
238+
overflow: hidden;
239+
}
236240
.search-input {
237241
border: 2px solid #e9e9e9;
238242
border-radius: 2px;
239-
width: calc(100% - 66px);
243+
width: 100%;
240244
}
241245
.do-search {
242246
float: right;

0 commit comments

Comments
 (0)