Skip to content

Commit 78a3276

Browse files
Improve hidden code lines display by changing their background to make them easier to spot
1 parent 1c7b851 commit 78a3276

File tree

5 files changed

+18
-1
lines changed

5 files changed

+18
-1
lines changed

src/librustdoc/html/highlight.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ fn write_code(
139139
)
140140
.highlight(&mut |highlight| {
141141
match highlight {
142-
Highlight::Token { text, class } => string(out, Escape(text), class, context_info),
142+
Highlight::Token { text, class } => string(out, Escape(text), class, &context_info),
143143
Highlight::EnterSpan { class } => enter_span(out, class),
144144
Highlight::ExitSpan => exit_span(out),
145145
};

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

+5
Original file line numberDiff line numberDiff line change
@@ -1257,6 +1257,11 @@ pre.rust {
12571257
-moz-tab-size: 4;
12581258
}
12591259

1260+
pre .data-hidden {
1261+
width: 100%;
1262+
display: block;
1263+
}
1264+
12601265
.search-failed {
12611266
text-align: center;
12621267
margin-top: 20px;

src/librustdoc/html/static/css/themes/ayu.css

+4
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ pre, .rustdoc.source .example-wrap {
5757
background-color: #191f26;
5858
}
5959

60+
pre .data-hidden {
61+
background-color: #313942;
62+
}
63+
6064
.sidebar {
6165
background-color: #14191f;
6266
}

src/librustdoc/html/static/css/themes/dark.css

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ pre, .rustdoc.source .example-wrap {
2828
background-color: #2A2A2A;
2929
}
3030

31+
pre .data-hidden {
32+
background-color: #373636;
33+
}
34+
3135
.sidebar {
3236
background-color: #505050;
3337
}

src/librustdoc/html/static/css/themes/light.css

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ pre, .rustdoc.source .example-wrap {
3030
background-color: #F5F5F5;
3131
}
3232

33+
pre .data-hidden {
34+
background-color: #E6E4E4;
35+
}
36+
3337
.sidebar {
3438
background-color: #F1F1F1;
3539
}

0 commit comments

Comments
 (0)