forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#133636 - GuillaumeGomez:sans-serif, r=rustdoc [rustdoc] Add sans-serif font setting Fixes rust-lang#52449. This PR adds a new setting introducing the possibility to switch to a sans-serif font (`Fira Sans`) for the text. Can be tested [here](https://rustdoc.crud.net/imperio/sans-serif/std/index.html). cc ```@rust-lang/rustdoc-frontend``` r? ```@notriddle```
- Loading branch information
Showing
17 changed files
with
117 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,7 +92,7 @@ SPDX-FileCopyrightText = "2015 Anders Kaseorg <[email protected]>" | |
SPDX-License-Identifier = "MIT" | ||
|
||
[[annotations]] | ||
path = "src/librustdoc/html/static/fonts/FiraSans**" | ||
path = "src/librustdoc/html/static/fonts/Fira**" | ||
precedence = "override" | ||
SPDX-FileCopyrightText = ["2014, Mozilla Foundation", "2014, Telefonica S.A."] | ||
SPDX-License-Identifier = "OFL-1.1" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Ensures that the font serif change is working as expected. | ||
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html" | ||
|
||
// By default, it should be the serif fonts. | ||
store-value: (serif_font, '"Source Serif 4", NanumBarunGothic, serif') | ||
store-value: (serif_code_font, '"Source Code Pro", monospace') | ||
assert-css: ("body", {"font-family": |serif_font|}) | ||
assert-css: ("p code", {"font-family": |serif_code_font|}) | ||
|
||
// We now switch to the sans serif font | ||
click: "#settings-menu" | ||
wait-for: "#sans-serif-fonts" | ||
click: "#sans-serif-fonts" | ||
|
||
store-value: (font, '"Fira Sans", sans-serif') | ||
store-value: (code_font, '"Fira Mono", monospace') | ||
assert-css: ("body", {"font-family": |font|}) | ||
assert-css: ("p code", {"font-family": |code_font|}) | ||
|
||
// Reloading the page to ensure it is loaded correctly. | ||
reload: | ||
assert-css: ("body", {"font-family": |font|}) | ||
assert-css: ("p code", {"font-family": |code_font|}) | ||
|
||
// We switch back to the serif font | ||
click: "#settings-menu" | ||
wait-for: "#sans-serif-fonts" | ||
click: "#sans-serif-fonts" | ||
|
||
assert-css: ("body", {"font-family": |serif_font|}) | ||
assert-css: ("p code", {"font-family": |serif_code_font|}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters