Skip to content

Commit

Permalink
Rollup merge of rust-lang#76126 - camelid:crate-list-font, r=Guillaum…
Browse files Browse the repository at this point in the history
…eGomez

Use "Fira Sans" for crate list font

Fira Sans is what's used for module lists and other item lists.
Previously, the default body font, "Source Serif Pro", was used for
crate lists, which didn't visually match other item lists.

@rustbot modify labels: T-rustdoc
  • Loading branch information
tmandry committed Sep 2, 2020
2 parents 34c8b7a + c86d249 commit 9a05582
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/librustdoc/html/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1062,12 +1062,13 @@ themePicker.onblur = handleThemeButtonsBlur;
let content = format!(
"<h1 class='fqn'>\
<span class='in-band'>List of all crates</span>\
</h1><ul class='mod'>{}</ul>",
</h1>\
<ul class='crate mod'>{}</ul>",
krates
.iter()
.map(|s| {
format!(
"<li><a class=\"mod\" href=\"{}index.html\">{}</a></li>",
"<li><a class=\"crate mod\" href=\"{}index.html\">{}</a></li>",
ensure_trailing_slash(s),
s
)
Expand Down
3 changes: 3 additions & 0 deletions src/librustdoc/html/static/themes/ayu.css
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ pre {
.content span.externcrate, .content span.mod, .content a.mod {
color: #acccf9;
}
.content ul.crate a.crate {
font: 16px/1.6 "Fira Sans";
}
.content span.struct, .content a.struct {
color: #ffa0a5;
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/rustdoc/index-page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

// @has foo/../index.html
// @has - '//span[@class="in-band"]' 'List of all crates'
// @has - '//ul[@class="mod"]//a[@href="foo/index.html"]' 'foo'
// @has - '//ul[@class="mod"]//a[@href="all_item_types/index.html"]' 'all_item_types'
// @has - '//ul[@class="crate mod"]//a[@href="foo/index.html"]' 'foo'
// @has - '//ul[@class="crate mod"]//a[@href="all_item_types/index.html"]' 'all_item_types'
pub struct Foo;

0 comments on commit 9a05582

Please sign in to comment.