Skip to content

Commit

Permalink
Rollup merge of rust-lang#112937 - camelid:align-typenames, r=Guillau…
Browse files Browse the repository at this point in the history
…meGomez

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`
  • Loading branch information
GuillaumeGomez authored Jun 24, 2023
2 parents 43fe7b0 + 5f433f3 commit 3b1a295
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -891,8 +891,10 @@ so that we can apply CSS-filters to change the arrow color in themes */
color: var(--search-results-grey-color);
}
.search-results .result-name .typename {
display: inline-block;
color: var(--search-results-grey-color);
font-size: 0.875rem;
width: 6.25rem;
}

.popover {
Expand Down
4 changes: 2 additions & 2 deletions src/librustdoc/html/static/js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ const longItemTypes = [
"enum variant",
"macro",
"primitive type",
"associated type",
"assoc type",
"constant",
"associated constant",
"assoc const",
"union",
"foreign type",
"keyword",
Expand Down

0 comments on commit 3b1a295

Please sign in to comment.