Skip to content

Commit

Permalink
rustdoc: Correctly handle long crate names on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jan 31, 2024
1 parent 5bd5d21 commit d907a6b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -1943,13 +1943,8 @@ in src-script.js and main.js
pixels to avoid overflowing the topbar when the user sets a bigger
font size. */
font-size: 24px;
}

.mobile-topbar h2 a {
display: block;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}

.mobile-topbar .logo-container > img {
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function setMobileTopbar() {
const mobileTitle = document.createElement("h2");
mobileTitle.className = "location";
if (hasClass(document.querySelector(".rustdoc"), "crate")) {
mobileTitle.innerText = `Crate ${window.currentCrate}`;
mobileTitle.innerHTML = `Crate <a href="#">${window.currentCrate}</a>`;
} else if (locationTitle) {
mobileTitle.innerHTML = locationTitle.innerHTML;
}
Expand Down

0 comments on commit d907a6b

Please sign in to comment.