Skip to content

Commit d907a6b

Browse files
rustdoc: Correctly handle long crate names on mobile
1 parent 5bd5d21 commit d907a6b

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

src/librustdoc/html/static/css/rustdoc.css

+1-6
Original file line numberDiff line numberDiff line change
@@ -1943,13 +1943,8 @@ in src-script.js and main.js
19431943
pixels to avoid overflowing the topbar when the user sets a bigger
19441944
font size. */
19451945
font-size: 24px;
1946-
}
1947-
1948-
.mobile-topbar h2 a {
1949-
display: block;
1950-
text-overflow: ellipsis;
1951-
overflow: hidden;
19521946
white-space: nowrap;
1947+
text-overflow: ellipsis;
19531948
}
19541949

19551950
.mobile-topbar .logo-container > img {

src/librustdoc/html/static/js/main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function setMobileTopbar() {
4545
const mobileTitle = document.createElement("h2");
4646
mobileTitle.className = "location";
4747
if (hasClass(document.querySelector(".rustdoc"), "crate")) {
48-
mobileTitle.innerText = `Crate ${window.currentCrate}`;
48+
mobileTitle.innerHTML = `Crate <a href="#">${window.currentCrate}</a>`;
4949
} else if (locationTitle) {
5050
mobileTitle.innerHTML = locationTitle.innerHTML;
5151
}

0 commit comments

Comments
 (0)