Skip to content
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

Rustdoc UI fixes #81592

Merged
merged 3 commits into from
Feb 1, 2021
Merged
Show file tree
Hide file tree
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
9 changes: 0 additions & 9 deletions src/librustdoc/html/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1688,15 +1688,6 @@ function defocusSearchBar() {

search.innerHTML = output;
showSearchResults(search);
var tds = search.getElementsByTagName("td");
var td_width = 0;
if (tds.length > 0) {
td_width = tds[0].offsetWidth;
}
var width = search.offsetWidth - 40 - td_width;
onEachLazy(search.getElementsByClassName("desc"), function(e) {
e.style.width = width + "px";
});
initSearchNav();
var elems = document.getElementById("titles").childNodes;
elems[0].onclick = function() { printTab(0); };
Expand Down
4 changes: 2 additions & 2 deletions src/librustdoc/html/static/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -1424,7 +1424,7 @@ h4 > .notable-traits {
margin-left: 0px;
}

#main {
#main, #search {
margin-top: 45px;
padding: 0;
}
Expand Down Expand Up @@ -1578,7 +1578,7 @@ h4 > .notable-traits {
}
}

@media (max-width: 416px) {
@media (max-width: 464px) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels like a hacky solution to me, what if the width is slightly smaller or larger? Ideally we would want something to do with dynamic width like calc but that would also make stuff more complicated.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It actually depends on the min width of the search input mostly. ;)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than that, on mobile, once you click on the menu, the body jumps off, that behavior looks weird.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean the body jumping down when you click the hamburger? That appears to be a nightly regression, it doesn't happen on the stable docs.

#titles, #titles > button {
height: 73px;
}
Expand Down