Skip to content

Commit 36f815b

Browse files
committed
Remove intermediate font specs
This is a (much) more constrained version of #54772 that also aims at improving the situation in #34681. It removes any font specifications that are not the "official" rustdoc font, and instead relies on the browser to provide the fallback font if the official on is not available. On Linux systems, this is particularly important, as fonts like Helvetica, Arial, and Times often look pretty bad since they're pulled from extracted MS fonts. A specification like `serif` or `sans-serif` lets the browser instead choose a good font.
1 parent 8315b11 commit 36f815b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/librustdoc/html/static/rustdoc.css

+5-5
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
/* General structure and fonts */
7171

7272
body {
73-
font: 16px/1.4 "Source Serif Pro", Georgia, Times, "Times New Roman", serif;
73+
font: 16px/1.4 "Source Serif Pro", serif;
7474
margin: 0;
7575
position: relative;
7676
padding: 10px 15px 20px 15px;
@@ -114,7 +114,7 @@ h3.impl, h3.method, h3.type {
114114
h1, h2, h3, h4,
115115
.sidebar, a.source, .search-input, .content table :not(code)>a,
116116
.collapse-toggle, div.item-list .out-of-band {
117-
font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
117+
font-family: "Fira Sans", sans-serif;
118118
}
119119

120120
ol, ul {
@@ -133,7 +133,7 @@ summary {
133133
}
134134

135135
code, pre {
136-
font-family: "Source Code Pro", Menlo, Monaco, Consolas, "DejaVu Sans Mono", Inconsolata, monospace;
136+
font-family: "Source Code Pro", monospace;
137137
white-space: pre-wrap;
138138
}
139139
.docblock code, .docblock-short code {
@@ -415,7 +415,7 @@ h4 > code, h3 > code, .invisible > code {
415415
}
416416
#main > .since {
417417
top: inherit;
418-
font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
418+
font-family: "Fira Sans", sans-serif;
419419
}
420420

421421
.content table:not(.table-display) {
@@ -1338,7 +1338,7 @@ h3.important {
13381338
kbd {
13391339
display: inline-block;
13401340
padding: 3px 5px;
1341-
font: 15px "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
1341+
font: 15px monospace;
13421342
line-height: 10px;
13431343
vertical-align: middle;
13441344
border: solid 1px;

0 commit comments

Comments
 (0)