Skip to content

Commit c54895b

Browse files
committed
Auto merge of rust-lang#86663 - fee1-dead:use-rustdoc-css, r=GuillaumeGomez
Use rustdoc.css for error index Closes rust-lang#86512.
2 parents 09d9b60 + 5072a47 commit c54895b

File tree

4 files changed

+19
-137
lines changed

4 files changed

+19
-137
lines changed

Diff for: src/bootstrap/doc.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -374,9 +374,15 @@ impl Step for Standalone {
374374
}
375375

376376
if filename == "not_found.md" {
377-
cmd.arg("--markdown-css").arg("https://doc.rust-lang.org/rust.css");
377+
cmd.arg("--markdown-css")
378+
.arg(format!("https://doc.rust-lang.org/rustdoc{}.css", &builder.version))
379+
.arg("--markdown-css")
380+
.arg("https://doc.rust-lang.org/rust.css");
378381
} else {
379-
cmd.arg("--markdown-css").arg("rust.css");
382+
cmd.arg("--markdown-css")
383+
.arg(format!("rustdoc{}.css", &builder.version))
384+
.arg("--markdown-css")
385+
.arg("rust.css");
380386
}
381387
builder.run(&mut cmd);
382388
}

Diff for: src/doc/rust.css

+8-132
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,23 @@
1-
/* See FiraSans-LICENSE.txt for the Fira Sans license. */
2-
@font-face {
3-
font-family: 'Fira Sans';
4-
font-style: normal;
5-
font-weight: 400;
6-
src: local('Fira Sans'),
7-
url("FiraSans-Regular.woff2") format("woff2"),
8-
url("FiraSans-Regular.woff") format('woff');
9-
font-display: swap;
10-
}
11-
@font-face {
12-
font-family: 'Fira Sans';
13-
font-style: normal;
14-
font-weight: 500;
15-
src: local('Fira Sans Medium'),
16-
url("FiraSans-Medium.woff2") format("woff2"),
17-
url("FiraSans-Medium.woff") format('woff');
18-
font-display: swap;
19-
}
20-
21-
/* See SourceSerif4-LICENSE.md for the Source Serif 4 license. */
22-
@font-face {
23-
font-family: 'Source Serif 4';
24-
font-style: normal;
25-
font-weight: 400;
26-
src: local('Source Serif 4'), url("SourceSerif4-Regular.ttf.woff") format('woff');
27-
font-display: swap;
28-
}
29-
@font-face {
30-
font-family: 'Source Serif 4';
31-
font-style: italic;
32-
font-weight: 400;
33-
src: local('Source Serif 4 Italic'), url("SourceSerif4-It.ttf.woff") format('woff');
34-
font-display: swap;
35-
}
36-
@font-face {
37-
font-family: 'Source Serif 4';
38-
font-style: normal;
39-
font-weight: 700;
40-
src: local('Source Serif 4 Bold'), url("SourceSerif4-Bold.ttf.woff") format('woff');
41-
font-display: swap;
42-
}
43-
44-
/* See SourceCodePro-LICENSE.txt for the Source Code Pro license. */
45-
@font-face {
46-
font-family: 'Source Code Pro';
47-
font-style: normal;
48-
font-weight: 400;
49-
/* Avoid using locally installed font because bad versions are in circulation:
50-
* see https://github.com/rust-lang/rust/issues/24355 */
51-
src: url("SourceCodePro-Regular.ttf.woff") format('woff');
52-
font-display: swap;
53-
}
54-
@font-face {
55-
font-family: 'Source Code Pro';
56-
font-style: italic;
57-
font-weight: 400;
58-
src: url("SourceCodePro-It.ttf.woff") format('woff');
59-
font-display: swap;
60-
}
61-
@font-face {
62-
font-family: 'Source Code Pro';
63-
font-style: normal;
64-
font-weight: 600;
65-
src: url("SourceCodePro-Semibold.ttf.woff") format('woff');
66-
font-display: swap;
67-
}
68-
69-
*:not(body) {
70-
-webkit-box-sizing: border-box;
71-
-moz-box-sizing: border-box;
72-
box-sizing: border-box;
73-
}
74-
751
/* General structure */
762

773
body {
78-
background-color: white;
794
margin: 0 auto;
805
padding: 0 15px;
81-
font-family: "Source Serif 4", Georgia, Times, "Times New Roman", serif;
826
font-size: 18px;
837
color: #333;
848
line-height: 1.428571429;
859

86-
-webkit-font-feature-settings: "kern", "liga";
87-
-moz-font-feature-settings: "kern", "liga";
88-
font-feature-settings: "kern", "liga";
10+
-webkit-box-sizing: unset;
11+
-moz-box-sizing: unset;
12+
box-sizing: unset;
8913
}
9014
@media (min-width: 768px) {
9115
body {
9216
max-width: 750px;
9317
}
9418
}
9519

96-
h1, h2, h3, h4, h5, h6, nav, #versioninfo {
97-
font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
98-
}
99-
h1, h2, h3, h4, h5, h6 {
100-
color: black;
20+
h2, h3, h4, h5, h6 {
10121
font-weight: 400;
10222
line-height: 1.1;
10323
}
@@ -107,13 +27,15 @@ h1, h2, h3 {
10727
}
10828
h1 {
10929
margin-bottom: 20px;
30+
line-height: 1.1;
11031
}
11132
h4, h5, h6 {
11233
margin-top: 12px;
11334
margin-bottom: 10px;
11435
padding: 5px 10px;
11536
}
11637
h5, h6 {
38+
color: black;
11739
text-decoration: underline;
11840
}
11941

@@ -138,6 +60,7 @@ h3 {
13860
}
13961
h4 {
14062
font-size: 22px;
63+
border-bottom: none;
14164
}
14265
h5 {
14366
font-size: 20px;
@@ -208,19 +131,15 @@ a:hover, a:active {
208131
h1 a:link, h1 a:visited, h2 a:link, h2 a:visited,
209132
h3 a:link, h3 a:visited, h4 a:link, h4 a:visited,
210133
h5 a:link, h5 a:visited {color: black;}
211-
h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover,
212-
h5 a:hover {text-decoration: none;}
213134

214135
/* Code */
215136

216137
pre, code {
217-
font-family: "Source Code Pro", Menlo, Monaco, Consolas, "DejaVu Sans Mono", monospace;
218138
word-wrap: break-word;
219139
}
220140
pre {
221141
border-left: 2px solid #eee;
222142
white-space: pre-wrap;
223-
padding: 14px;
224143
padding-right: 0;
225144
margin: 20px 0;
226145
font-size: 15px;
@@ -244,19 +163,6 @@ a > code {
244163
color: #8D1A38;
245164
}
246165

247-
/* Code highlighting */
248-
pre.rust .kw { color: #8959A8; }
249-
pre.rust .kw-2, pre.rust .prelude-ty { color: #4271AE; }
250-
pre.rust .number, pre.rust .string { color: #718C00; }
251-
pre.rust .self, pre.rust .bool-val, pre.rust .prelude-val,
252-
pre.rust .attribute, pre.rust .attribute .ident { color: #C82829; }
253-
pre.rust .comment { color: #8E908C; }
254-
pre.rust .doccomment { color: #4D4D4C; }
255-
pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999F; }
256-
pre.rust .lifetime { color: #B76514; }
257-
258-
/* The rest */
259-
260166
#versioninfo {
261167
text-align: center;
262168
margin: 0.5em;
@@ -298,9 +204,6 @@ blockquote p:last-child {
298204
margin-bottom: 0;
299205
}
300206

301-
ul, ol {
302-
padding-left: 25px;
303-
}
304207
ul ul, ol ul, ul ol, ol ol {
305208
margin-bottom: 0;
306209
}
@@ -355,22 +258,8 @@ table th {
355258

356259
/* Code snippets */
357260

358-
.example-wrap { position: relative; }
359-
pre.rust { position: relative; }
360261
a.test-arrow {
361-
background-color: rgba(78, 139, 202, 0.2);
362-
display: inline-block;
363-
position: absolute;
364-
color: #f5f5f5;
365-
padding: 5px 10px 5px 10px;
366-
border-radius: 5px;
367-
font-size: 130%;
368-
top: 5px;
369-
right: 5px;
370-
}
371-
a.test-arrow:hover{
372-
background-color: #4e8bca;
373-
text-decoration: none;
262+
color: #f5f5f5
374263
}
375264

376265
.unstable-feature {
@@ -439,19 +328,6 @@ a.test-arrow:hover{
439328
position: relative;
440329
}
441330

442-
.information {
443-
position: absolute;
444-
left: -25px;
445-
margin-top: 7px;
446-
z-index: 1;
447-
}
448-
449-
.tooltip {
450-
position: relative;
451-
display: inline-block;
452-
cursor: pointer;
453-
}
454-
455331
.tooltip .tooltiptext {
456332
width: 120px;
457333
display: none;

Diff for: src/librustdoc/html/static/themes/light.css

+2-3
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,6 @@ a.result-keyword:focus { background-color: #f99650; }
159159
.content .fnname { color: #9a6e31; }
160160
.content span.keyword, .content a.keyword, .block a.current.keyword { color: #de5249; }
161161

162-
pre.rust .comment { color: #8E908C; }
163-
pre.rust .doccomment { color: #4D4D4C; }
164-
165162
nav:not(.sidebar) {
166163
border-bottom-color: #e0e0e0;
167164
}
@@ -252,6 +249,8 @@ pre.rust .kw-2, pre.rust .prelude-ty { color: #4271AE; }
252249
pre.rust .number, pre.rust .string { color: #718C00; }
253250
pre.rust .self, pre.rust .bool-val, pre.rust .prelude-val,
254251
pre.rust .attribute, pre.rust .attribute .ident { color: #C82829; }
252+
pre.rust .comment { color: #8E908C; }
253+
pre.rust .doccomment { color: #4D4D4C; }
255254
pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999F; }
256255
pre.rust .lifetime { color: #B76514; }
257256
pre.rust .question-mark {

Diff for: src/tools/error_index_generator/main.rs

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ impl Formatter for HTMLFormatter {
6767
<title>Rust Compiler Error Index</title>
6868
<meta charset="utf-8">
6969
<!-- Include rust.css after light.css so its rules take priority. -->
70+
<link rel="stylesheet" type="text/css" href="rustdoc{suffix}.css"/>
7071
<link rel="stylesheet" type="text/css" href="light{suffix}.css"/>
7172
<link rel="stylesheet" type="text/css" href="rust.css"/>
7273
<style>

0 commit comments

Comments
 (0)