Skip to content

Commit

Permalink
Improve hidden code lines display by changing their background to mak…
Browse files Browse the repository at this point in the history
…e them easier to spot
  • Loading branch information
GuillaumeGomez committed Sep 17, 2021
1 parent 1c7b851 commit 78a3276
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustdoc/html/highlight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ fn write_code(
)
.highlight(&mut |highlight| {
match highlight {
Highlight::Token { text, class } => string(out, Escape(text), class, context_info),
Highlight::Token { text, class } => string(out, Escape(text), class, &context_info),
Highlight::EnterSpan { class } => enter_span(out, class),
Highlight::ExitSpan => exit_span(out),
};
Expand Down
5 changes: 5 additions & 0 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -1257,6 +1257,11 @@ pre.rust {
-moz-tab-size: 4;
}

pre .data-hidden {
width: 100%;
display: block;
}

.search-failed {
text-align: center;
margin-top: 20px;
Expand Down
4 changes: 4 additions & 0 deletions src/librustdoc/html/static/css/themes/ayu.css
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ pre, .rustdoc.source .example-wrap {
background-color: #191f26;
}

pre .data-hidden {
background-color: #313942;
}

.sidebar {
background-color: #14191f;
}
Expand Down
4 changes: 4 additions & 0 deletions src/librustdoc/html/static/css/themes/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ pre, .rustdoc.source .example-wrap {
background-color: #2A2A2A;
}

pre .data-hidden {
background-color: #373636;
}

.sidebar {
background-color: #505050;
}
Expand Down
4 changes: 4 additions & 0 deletions src/librustdoc/html/static/css/themes/light.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ pre, .rustdoc.source .example-wrap {
background-color: #F5F5F5;
}

pre .data-hidden {
background-color: #E6E4E4;
}

.sidebar {
background-color: #F1F1F1;
}
Expand Down

0 comments on commit 78a3276

Please sign in to comment.