Skip to content

Commit 3b1a295

Browse files
Rollup merge of rust-lang#112937 - camelid:align-typenames, r=GuillaumeGomez
rustdoc: Align search results horizontally for easy scanning The recent PR rust-lang#110688 added info about an item's kind before its name in search results. However, because the kind and name are inline with no alignment, it's now hard to visually scan downward through the search results, looking at item names. This PR fixes that by horizontally aligning search results such that there are now two columns of information. r? `@GuillaumeGomez`
2 parents 43fe7b0 + 5f433f3 commit 3b1a295

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -891,8 +891,10 @@ so that we can apply CSS-filters to change the arrow color in themes */
891891
color: var(--search-results-grey-color);
892892
}
893893
.search-results .result-name .typename {
894+
display: inline-block;
894895
color: var(--search-results-grey-color);
895896
font-size: 0.875rem;
897+
width: 6.25rem;
896898
}
897899

898900
.popover {

src/librustdoc/html/static/js/search.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ const longItemTypes = [
5252
"enum variant",
5353
"macro",
5454
"primitive type",
55-
"associated type",
55+
"assoc type",
5656
"constant",
57-
"associated constant",
57+
"assoc const",
5858
"union",
5959
"foreign type",
6060
"keyword",

0 commit comments

Comments
 (0)