rustdoc: Correctly handle long crate names on mobile

This commit is contained in:
Guillaume Gomez 2024-01-31 14:34:29 +01:00
parent 5bd5d214ef
commit d907a6b8ed
2 changed files with 2 additions and 7 deletions

View file

@ -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 {

View file

@ -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;
}