Skip to content

Commit ac2e563

Browse files
committed
Don't override the user's fonts
This patch is similar in spirit to rust-lang/blog.rust-lang.org#263, though it's also less invasive; it removes the specific font overrides in style.css so that the browser will use the user's configured fonts. The net result of the change is that the page will look less "uniform" across different browsers, OSes, and devices, but the overall aesthetic should be preserved. It also means that user preferences are respected, and that legibility is improved for users with particular font needs, or on platforms that sometimes gets confused about how to render fonts nicely (ehrm, Linux).
1 parent 32102ce commit ac2e563

File tree

1 file changed

+13
-19
lines changed

1 file changed

+13
-19
lines changed

templates/style.scss

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11

2-
// FONTS
3-
$font-family-sans: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
4-
$font-family-serif: "Source Serif Pro",Georgia,Times,"Times New Roman",serif;
5-
$font-family-mono: "Source Code Pro", Menlo, Monaco, Consolas, "DejaVu Sans Mono", Inconsolata, monospace;
6-
7-
82
// COLORS - Guess what?
93
$color-standard: #000; // pure black
104
$color-url: #4d76ae; // blue
@@ -33,7 +27,7 @@ $media-xl: "screen and (min-width: 80em)";
3327

3428
html, button, input, select, textarea,
3529
.pure-g [class *= "pure-u"] {
36-
font-family: $font-family-sans;
30+
font-family: sans-serif;
3731
color: $color-standard;
3832
}
3933

@@ -44,12 +38,12 @@ html, button, input, select, textarea,
4438
}
4539

4640
.description {
47-
font-family: $font-family-serif;
41+
font-family: serif;
4842
}
4943

5044
// rustdoc overrides
5145
div.rustdoc {
52-
font-family: $font-family-serif;
46+
font-family: serif;
5347
padding: 10px 15px 20px 15px;
5448

5549
.sidebar {
@@ -94,7 +88,7 @@ body.blur > div.rustdoc > :not(#help) {
9488

9589
body {
9690
text-align: center;
97-
font: 16px/1.4 $font-family-sans;
91+
font: 16px/1.4 sans-serif;
9892
}
9993

10094
pre {
@@ -186,7 +180,7 @@ div.nav-container {
186180
width: 350px;
187181

188182
p.description {
189-
font-family: $font-family-sans;
183+
font-family: sans-serif;
190184
font-size: 0.8em;
191185
color: #777; // color from pure
192186
padding: .5em 1em;
@@ -322,7 +316,7 @@ div.recent-releases-container {
322316
}
323317

324318
.description {
325-
font-family: $font-family-serif;
319+
font-family: serif;
326320
font-weight: normal;
327321
@media #{$media-sm} {
328322
font-size: 1em;
@@ -475,7 +469,7 @@ div.package-page-container {
475469
div.package-details {
476470
padding: 0 1em;
477471

478-
font-family: $font-family-serif;
472+
font-family: serif;
479473

480474
a {
481475
color: $color-url;
@@ -486,7 +480,7 @@ div.package-page-container {
486480
}
487481

488482
h1, h2, h3, h4, h5, h6 {
489-
font-family: $font-family-sans;
483+
font-family: sans-serif;
490484
}
491485

492486
h1:first-child,
@@ -516,7 +510,7 @@ div.package-page-container {
516510
}
517511

518512
th {
519-
font-family: $font-family-sans;
513+
font-family: sans-serif;
520514
font-weight: 500;
521515
}
522516

@@ -561,7 +555,7 @@ div.cratesfyi-package-container {
561555
padding: 15px 0 0 14px;
562556
}
563557
div.description {
564-
font-family: $font-family-serif;
558+
font-family: serif;
565559
margin: 0;
566560
padding: 0 0 15px 14px;
567561

@@ -640,7 +634,7 @@ div.cratesfyi-package-container-rustdoc {
640634

641635

642636
div.warning {
643-
font-family: $font-family-sans;
637+
font-family: sans-serif;
644638
border-radius: 4px;
645639
background-color: lighten($color-type, 45%);
646640
padding: .4em 1em;
@@ -699,7 +693,7 @@ footer {
699693

700694

701695
.about {
702-
font-family: $font-family-serif;
696+
font-family: serif;
703697
padding: .4em 1em;
704698
a {
705699
color: $color-url;
@@ -711,7 +705,7 @@ footer {
711705
margin-bottom: 10px;
712706
}
713707
thead tr th {
714-
font-family: $font-family-sans;
708+
font-family: sans-serif;
715709
font-weight: 500;
716710
}
717711
strong {

0 commit comments

Comments
 (0)