From d907a6b8ed33f0cc332992ef330e099c9474faba Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 31 Jan 2024 14:34:29 +0100 Subject: rustdoc: Correctly handle long crate names on mobile --- src/librustdoc/html/static/css/rustdoc.css | 7 +------ src/librustdoc/html/static/js/main.js | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) (limited to 'src/librustdoc/html/static') diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 9c593aa85d9..899c4383986 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -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 { diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js index b46701b55ea..b26efb75ff6 100644 --- a/src/librustdoc/html/static/js/main.js +++ b/src/librustdoc/html/static/js/main.js @@ -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 ${window.currentCrate}`; } else if (locationTitle) { mobileTitle.innerHTML = locationTitle.innerHTML; } -- cgit 1.4.1-3-g733a5