Skip to content

Commit

Permalink
rustdoc: simplify .search-results-title CSS
Browse files Browse the repository at this point in the history
By using `display: flex`, we still get the never-wrapping layout with
`#crate-search-div` maxing out and truncating its text. The title itself
winds up always filling its parent, but since `#crate-search` doesn't have
`flex-grow` set, it won't fill available space.
  • Loading branch information
notriddle committed Nov 23, 2022
1 parent 80b3c6d commit 2185f49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -785,8 +785,7 @@ table,
margin-top: 0;
white-space: nowrap;
/* flex layout allows shrinking the <select> appropriately if it becomes too large */
display: inline-flex;
max-width: 100%;
display: flex;
/* make things look like in a line, despite the fact that we're using a layout
with boxes (i.e. from the flex layout) */
align-items: baseline;
Expand Down
3 changes: 2 additions & 1 deletion src/test/rustdoc-gui/search-result-display.goml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ size: (900, 900)

// First we check the current width, height and position.
assert-css: ("#crate-search", {"width": "223px"})
assert-css: (".search-results-title", {"height": "44px", "width": "336px"})
assert-css: (".search-results-title", {"height": "44px", "width": "640px"})
assert-css: ("#search", {"width": "640px"})

// Then we update the text of one of the `<option>`.
text: (
Expand Down

0 comments on commit 2185f49

Please sign in to comment.