Skip to content

Implement staggered mobile layout #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 22 additions & 8 deletions src/librustdoc/html/static/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,8 @@ a {

.search-results.active {
display: block;
/* prevent overhanging tabs from moving the first result */
clear: both;
}

.search-results .desc {
Expand All @@ -769,27 +771,27 @@ 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;
}

.search-results > a > div {
display: flex;
flex-flow: row wrap;
}

.search-results > a > div > div {
min-width: 50%;
max-width: 50%;
.search-results .result-name, .search-results > a > div > div:nth-child(2), .search-results .result-description {
width: 50%;
}

.result-name {
padding-right: 10px;
.search-results .result-name {
padding-right: 1em;
}

.result-name > span {
.search-results .result-name > span {
display: inline-block;
}

Expand Down Expand Up @@ -1746,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 > a > div > div:nth-child(2), .search-results .result-description {
width: 100%;
}
.search-results > a > div > div:nth-child(2), .search-results .result-description {
padding-left: 2em;
}
}

@media print {
Expand Down