Skip to content

Commit

Permalink
rustdoc: clean up sidebar link CSS
Browse files Browse the repository at this point in the history
Group `text-overflow: ellipses` along with `white-space: nowrap`. It makes
no sense to try to apply it to links with `overflow-wrap: anywhere`, because
it can't actually make ellipses when that's turned on.

Simplify the selector for the 25rem left padding on sidebar links, to match
up with the style for the container left padding that makes room for it.
  • Loading branch information
notriddle committed Nov 30, 2022
1 parent 24606de commit 3a61ab6
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -480,15 +480,11 @@ ul.block, .block li {
list-style: none;
}

.block a,
.sidebar h2 a,
.sidebar h3 a {
.sidebar-elems a,
.sidebar > h2 a {
display: block;
padding: 0.25rem;
padding: 0.25rem; /* 4px */
margin-left: -0.25rem;

text-overflow: ellipsis;
overflow: hidden;
}

.sidebar h2 {
Expand Down Expand Up @@ -522,6 +518,8 @@ ul.block, .block li {

.sidebar-elems .block li a {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}

.mobile-topbar {
Expand Down

0 comments on commit 3a61ab6

Please sign in to comment.