Skip to content

Commit 8714dd1

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 96afcaa commit 8714dd1

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

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

+2
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,7 @@ ul.block, .block li {
570570
display: block;
571571
padding: 0.25rem; /* 4px */
572572
margin-left: -0.25rem;
573+
margin-right: 0.25rem;
573574
}
574575

575576
.sidebar h2 {
@@ -593,6 +594,7 @@ ul.block, .block li {
593594
color: var(--sidebar-link-color);
594595
}
595596
.sidebar .current,
597+
.sidebar .current a,
596598
.sidebar a:hover:not(.logo-container) {
597599
background-color: var(--sidebar-current-link-background-color);
598600
}

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)