diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css index 9c5e3e8bfb2..5ee92cce655 100644 --- a/src/librustdoc/html/static/rustdoc.css +++ b/src/librustdoc/html/static/rustdoc.css @@ -759,25 +759,40 @@ a { .search-results.active { display: block; + /* prevent overhanging tabs from moving the first result */ + clear: both; } -.search-results .desc { +.search-results .desc > span { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; display: block; } -.search-results a { +.search-results > a { + display: block; + width: 100%; /* A little margin ensures the browser's outlining of focused links has room to display. */ margin-left: 2px; margin-right: 2px; - display: block; + border-bottom: 1px solid #aaa3; } -.result-name { +.search-results > a > div { + display: flex; + flex-flow: row wrap; +} + +.search-results .result-name, .search-results div.desc, .search-results .result-description { width: 50%; - float: left; +} +.search-results .result-name { + padding-right: 1em; +} + +.search-results .result-name > span { + display: inline-block; } .result-name span.primitive::after { @@ -1733,6 +1748,18 @@ details.undocumented[open] > summary::before { .search-container > div { width: calc(100% - 32px); } + + /* Display an alternating layout on tablets and phones */ + .search-results > a { + border-bottom: 1px solid #aaa9; + padding: 5px 0px; + } + .search-results .result-name, .search-results div.desc, .search-results .result-description { + width: 100%; + } + .search-results div.desc, .search-results .result-description { + padding-left: 2em; + } } @media print { diff --git a/src/librustdoc/html/static/search.js b/src/librustdoc/html/static/search.js index c95136d40d3..634e5fa5787 100644 --- a/src/librustdoc/html/static/search.js +++ b/src/librustdoc/html/static/search.js @@ -994,8 +994,8 @@ window.initSearch = function(rawSearchIndex) { ("" + item.alias + " - see ") : "") + item.displayPath + "" + - name + "