Skip to content

Commit 01fc131

Browse files
Clean up themes a bit more
1 parent ccb5595 commit 01fc131

File tree

6 files changed

+56
-146
lines changed

6 files changed

+56
-146
lines changed

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

+36
Original file line numberDiff line numberDiff line change
@@ -1165,6 +1165,42 @@ pre.rust .question-mark {
11651165
font-weight: bold;
11661166
}
11671167

1168+
pre.compile_fail,
1169+
pre.should_panic {
1170+
border-left: 2px solid var(--codeblock-error-color);
1171+
}
1172+
1173+
pre.ignore {
1174+
border-left: 2px solid var(--codeblock-ignore-color);
1175+
}
1176+
1177+
pre.compile_fail:hover, .information:hover + .example-wrap pre.compile_fail,
1178+
pre.should_panic:hover, .information:hover + .example-wrap pre.should_panic {
1179+
border-left: 2px solid var(--codeblock-error-hover-color);
1180+
}
1181+
1182+
pre.ignore:hover, .information:hover + .example-wrap pre.ignore {
1183+
border-left: 2px solid var(--codeblock-ignore-hover-color);
1184+
}
1185+
1186+
.tooltip.compile_fail,
1187+
.tooltip.should_panic {
1188+
color: var(--codeblock-error-color);
1189+
}
1190+
1191+
.tooltip.ignore {
1192+
color: var(--codeblock-ignore-color);
1193+
}
1194+
1195+
.information > .compile_fail:hover,
1196+
.information > .should_panic:hover {
1197+
color: var(--codeblock-error-hover-color);
1198+
}
1199+
1200+
.information > .ignore:hover {
1201+
color: var(--codeblock-ignore-hover-color);
1202+
}
1203+
11681204
a.test-arrow {
11691205
display: inline-block;
11701206
visibility: hidden;

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

+4-48
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ Original by Dempfi (https://github.com/dempfi/ayu)
2323
--copy-path-button-color: #fff;
2424
--copy-path-img-filter: invert(70%);
2525
--copy-path-img-hover-filter: invert(100%);
26+
--codeblock-error-hover-color: rgb(255, 0, 0);
27+
--codeblock-error-color: rgba(255, 0, 0, .5);
28+
--codeblock-ignore-hover-color: rgb(255, 142, 0);
29+
--codeblock-ignore-color: rgba(255, 142, 0, .6);
2630
}
2731

2832
.slider {
@@ -244,54 +248,6 @@ a.test-arrow:hover {
244248
border-right: 3px solid rgba(255, 180, 76, 0.85);
245249
}
246250

247-
pre.compile_fail {
248-
border-left: 2px solid rgba(255,0,0,.4);
249-
}
250-
251-
pre.compile_fail:hover, .information:hover + pre.compile_fail {
252-
border-left: 2px solid #f00;
253-
}
254-
255-
pre.should_panic {
256-
border-left: 2px solid rgba(255,0,0,.4);
257-
}
258-
259-
pre.should_panic:hover, .information:hover + pre.should_panic {
260-
border-left: 2px solid #f00;
261-
}
262-
263-
pre.ignore {
264-
border-left: 2px solid rgba(255,142,0,.6);
265-
}
266-
267-
pre.ignore:hover, .information:hover + pre.ignore {
268-
border-left: 2px solid #ff9200;
269-
}
270-
271-
.tooltip.compile_fail {
272-
color: rgba(255,0,0,.5);
273-
}
274-
275-
.information > .compile_fail:hover {
276-
color: #f00;
277-
}
278-
279-
.tooltip.should_panic {
280-
color: rgba(255,0,0,.5);
281-
}
282-
283-
.information > .should_panic:hover {
284-
color: #f00;
285-
}
286-
287-
.tooltip.ignore {
288-
color: rgba(255,142,0,.6);
289-
}
290-
291-
.information > .ignore:hover {
292-
color: #ff9200;
293-
}
294-
295251
.search-failed a {
296252
color: #39AFD7;
297253
}

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

+4-48
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
--copy-path-button-color: #999;
1919
--copy-path-img-filter: invert(50%);
2020
--copy-path-img-hover-filter: invert(65%);
21+
--codeblock-error-hover-color: rgb(255, 0, 0);
22+
--codeblock-error-color: rgba(255, 0, 0, .5);
23+
--codeblock-ignore-hover-color: rgb(255, 142, 0);
24+
--codeblock-ignore-color: rgba(255, 142, 0, .6);
2125
}
2226

2327
.slider {
@@ -194,54 +198,6 @@ a.test-arrow:hover{
194198
border-right: 3px solid #bb7410;
195199
}
196200

197-
pre.compile_fail {
198-
border-left: 2px solid rgba(255,0,0,.8);
199-
}
200-
201-
pre.compile_fail:hover, .information:hover + pre.compile_fail {
202-
border-left: 2px solid #f00;
203-
}
204-
205-
pre.should_panic {
206-
border-left: 2px solid rgba(255,0,0,.8);
207-
}
208-
209-
pre.should_panic:hover, .information:hover + pre.should_panic {
210-
border-left: 2px solid #f00;
211-
}
212-
213-
pre.ignore {
214-
border-left: 2px solid rgba(255,142,0,.6);
215-
}
216-
217-
pre.ignore:hover, .information:hover + pre.ignore {
218-
border-left: 2px solid #ff9200;
219-
}
220-
221-
.tooltip.compile_fail {
222-
color: rgba(255,0,0,.8);
223-
}
224-
225-
.information > .compile_fail:hover {
226-
color: #f00;
227-
}
228-
229-
.tooltip.should_panic {
230-
color: rgba(255,0,0,.8);
231-
}
232-
233-
.information > .should_panic:hover {
234-
color: #f00;
235-
}
236-
237-
.tooltip.ignore {
238-
color: rgba(255,142,0,.6);
239-
}
240-
241-
.information > .ignore:hover {
242-
color: #ff9200;
243-
}
244-
245201
.search-failed a {
246202
color: #0089ff;
247203
}

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

+4-48
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
--copy-path-button-color: #999;
1919
--copy-path-img-filter: invert(50%);
2020
--copy-path-img-hover-filter: invert(35%);
21+
--codeblock-error-hover-color: rgb(255, 0, 0);
22+
--codeblock-error-color: rgba(255, 0, 0, .5);
23+
--codeblock-ignore-hover-color: rgb(255, 142, 0);
24+
--codeblock-ignore-color: rgba(255, 142, 0, .6);
2125
}
2226

2327
.slider {
@@ -180,54 +184,6 @@ a.test-arrow:hover{
180184
border-right: 3px solid #AD7C37;
181185
}
182186

183-
pre.compile_fail {
184-
border-left: 2px solid rgba(255,0,0,.5);
185-
}
186-
187-
pre.compile_fail:hover, .information:hover + pre.compile_fail {
188-
border-left: 2px solid #f00;
189-
}
190-
191-
pre.should_panic {
192-
border-left: 2px solid rgba(255,0,0,.5);
193-
}
194-
195-
pre.should_panic:hover, .information:hover + pre.should_panic {
196-
border-left: 2px solid #f00;
197-
}
198-
199-
pre.ignore {
200-
border-left: 2px solid rgba(255,142,0,.6);
201-
}
202-
203-
pre.ignore:hover, .information:hover + pre.ignore {
204-
border-left: 2px solid #ff9200;
205-
}
206-
207-
.tooltip.compile_fail {
208-
color: rgba(255,0,0,.5);
209-
}
210-
211-
.information > .compile_fail:hover {
212-
color: #f00;
213-
}
214-
215-
.tooltip.should_panic {
216-
color: rgba(255,0,0,.5);
217-
}
218-
219-
.information > .should_panic:hover {
220-
color: #f00;
221-
}
222-
223-
.tooltip.ignore {
224-
color: rgba(255,142,0,.6);
225-
}
226-
227-
.information > .ignore:hover {
228-
color: #ff9200;
229-
}
230-
231187
.search-failed a {
232188
color: #3873AD;
233189
}

src/test/rustdoc-gui/code-tags.goml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// This test ensures that items and documentation code blocks are wrapped in <pre><code>
22
goto: file://|DOC_PATH|/test_docs/fn.foo.html
33
size: (1080, 600)
4-
// There should be three doc codeblocks
4+
// There should be four doc codeblocks.
55
// Check that their content is inside <pre><code>
6-
assert-count: (".example-wrap pre > code", 3)
6+
assert-count: (".example-wrap pre > code", 4)
77
// Check that function signature is inside <pre><code>
88
assert: "pre.rust.fn > code"
99

src/test/rustdoc-gui/src/test_docs/lib.rs

+6
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ use std::fmt;
2828
/// Let's say I'm just some text will ya?
2929
/// ```
3030
///
31+
/// A failing to run one:
32+
///
33+
/// ```should_panic
34+
/// panic!("tadam");
35+
/// ```
36+
///
3137
/// An inlined `code`!
3238
pub fn foo() {}
3339

0 commit comments

Comments
 (0)