Skip to content

Commit 2185f49

Browse files
committed
rustdoc: simplify .search-results-title CSS
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.
1 parent 80b3c6d commit 2185f49

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -785,8 +785,7 @@ table,
785785
margin-top: 0;
786786
white-space: nowrap;
787787
/* flex layout allows shrinking the <select> appropriately if it becomes too large */
788-
display: inline-flex;
789-
max-width: 100%;
788+
display: flex;
790789
/* make things look like in a line, despite the fact that we're using a layout
791790
with boxes (i.e. from the flex layout) */
792791
align-items: baseline;

src/test/rustdoc-gui/search-result-display.goml

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ size: (900, 900)
2222

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

2728
// Then we update the text of one of the `<option>`.
2829
text: (

0 commit comments

Comments
 (0)