Skip to content

Commit 221cba3

Browse files
dns2utf8GuillaumeGomez
authored andcommitted
Implement staggered mobile layout
1 parent 5afa52b commit 221cba3

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

src/librustdoc/html/static/rustdoc.css

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,8 @@ a {
759759

760760
.search-results.active {
761761
display: block;
762+
/* prevent overhanging tabs from moving the first result */
763+
clear: both;
762764
}
763765

764766
.search-results .desc {
@@ -769,24 +771,24 @@ a {
769771
}
770772

771773
.search-results > a {
774+
display: block;
772775
/* A little margin ensures the browser's outlining of focused links has room to display. */
773776
margin-left: 2px;
774777
margin-right: 2px;
775-
display: block;
778+
border-bottom: 1px solid #aaa3;
776779
}
777780

778781
.search-results > a > div {
779782
display: flex;
783+
flex-flow: row wrap;
780784
}
781785

782786
.search-results > a > div > div {
783-
min-width: 50%;
784-
max-width: 50%;
785787
width: 50%;
786788
}
787789

788790
.result-name {
789-
padding-right: 10px;
791+
padding-right: 1em;
790792
}
791793

792794
.result-name > span {
@@ -1746,6 +1748,17 @@ details.undocumented[open] > summary::before {
17461748
.search-container > div {
17471749
width: calc(100% - 32px);
17481750
}
1751+
1752+
/* Display an alternating layout on tablets and phones */
1753+
.search-results > a {
1754+
border-bottom: 1px solid #aaa9;
1755+
}
1756+
.search-results > a > div > div {
1757+
width: 100%;
1758+
}
1759+
.search-results > a > div > div:nth-child(2) {
1760+
padding-left: 2em;
1761+
}
17491762
}
17501763

17511764
@media print {

0 commit comments

Comments
 (0)