Skip to content

Commit dc3db00

Browse files
committed
rustdoc: add margin between scrollbar/resizer and links
This makes it easier to interact with these things without accidentally dragging a link around.
1 parent fcb9b92 commit dc3db00

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,7 @@ ul.block, .block li {
561561
display: block;
562562
padding: 0.25rem; /* 4px */
563563
margin-left: -0.25rem;
564+
margin-right: 0.25rem;
564565
}
565566

566567
.sidebar h2 {

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -476,11 +476,11 @@ function preLoadCss(cssUrl) {
476476
const current_page = document.location.href.split("/").pop();
477477
const link = document.createElement("a");
478478
link.href = path;
479-
if (path === current_page) {
480-
link.className = "current";
481-
}
482479
link.textContent = name;
483480
const li = document.createElement("li");
481+
if (path === current_page) {
482+
li.className = "current";
483+
}
484484
li.appendChild(link);
485485
ul.appendChild(li);
486486
}
@@ -613,12 +613,12 @@ function preLoadCss(cssUrl) {
613613
for (const crate of window.ALL_CRATES) {
614614
const link = document.createElement("a");
615615
link.href = window.rootPath + crate + "/index.html";
616-
if (window.rootPath !== "./" && crate === window.currentCrate) {
617-
link.className = "current";
618-
}
619616
link.textContent = crate;
620617

621618
const li = document.createElement("li");
619+
if (window.rootPath !== "./" && crate === window.currentCrate) {
620+
li.className = "current";
621+
}
622622
li.appendChild(link);
623623
ul.appendChild(li);
624624
}

0 commit comments

Comments
 (0)