Skip to content

Commit 8f55b2e

Browse files
committed
add new panel that shows up when the search bar is hovered
1 parent f7a3547 commit 8f55b2e

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

src/librustdoc/html/static/css/rustdoc.css

+22
Original file line numberDiff line numberDiff line change
@@ -1669,6 +1669,28 @@ a.tooltip:hover::after {
16691669
font-weight: normal;
16701670
}
16711671

1672+
/* panel that only shows up during searches */
1673+
#search-focus-panel {
1674+
position: absolute;
1675+
display: none;
1676+
background-color: var(--main-background-color);
1677+
border-width: 1px;
1678+
border-color: var(--border-color);
1679+
border-style: solid;
1680+
padding: 3px;
1681+
text-wrap: nowrap;
1682+
z-index: 1;
1683+
top: 0;
1684+
}
1685+
1686+
rustdoc-search {
1687+
position: relative;
1688+
}
1689+
1690+
rustdoc-search:focus-within #search-focus-panel {
1691+
display: block;
1692+
}
1693+
16721694
#src-sidebar {
16731695
width: 100%;
16741696
overflow: auto;

src/librustdoc/html/static/js/storage.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,9 @@ class RustdocSearchElement extends HTMLElement {
277277
Settings
278278
</a>
279279
</div>
280-
<div id="search-focus-panel">
281-
example query goes here
282-
</div>
283280
</form>
284-
</nav>`;
281+
</nav>
282+
<div id="search-focus-panel">example query goes here</div>`;
285283
}
286284
}
287285
window.customElements.define("rustdoc-search", RustdocSearchElement);

0 commit comments

Comments
 (0)