Skip to content

Commit e0d72d0

Browse files
Rollup merge of rust-lang#87125 - GuillaumeGomez:ayu-code-color, r=notriddle
Fix Ayu theme <code> color Fixes rust-lang#87072 (the second regression). r? `@notriddle`
2 parents e932ba3 + 46b4b37 commit e0d72d0

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

src/librustdoc/html/static/css/themes/ayu.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ h4 {
3434
background: rgba(0, 0, 0, 0);
3535
}
3636

37-
code {
37+
.docblock code {
3838
color: #ffb454;
3939
}
4040
h3 > code, h4 > code, h5 > code {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// The ayu theme has a different color for the "<code>" tags in the doc blocks. We need to
2+
// check that the rule isn't applied on other "<code>" elements.
3+
goto: file://|DOC_PATH|/test_docs/enum.AnEnum.html
4+
// We need to show the text, otherwise the colors aren't "computed" by the web browser.
5+
show-text: true
6+
// We set the theme to ayu.
7+
local-storage: {"rustdoc-theme": "ayu", "rustdoc-preferred-dark-theme": "ayu", "rustdoc-use-system-theme": "false"}
8+
// We reload to get the text appearing and the theme applied.
9+
reload:
10+
11+
assert-css: (".docblock code", {"color": "rgb(255, 180, 84)"}, ALL)
12+
// It includes variants and the "titles" as well (for example: "impl RefUnwindSafe for AnEnum").
13+
assert-css: ("div:not(.docblock) > code", {"color": "rgb(197, 197, 197)"}, ALL)

src/test/rustdoc-gui/src/test_docs/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ pub fn check_list_code_block() {}
9696
#[doc(cfg(unix))]
9797
pub fn replaced_function() {}
9898

99+
/// Some doc with `code`!
99100
pub enum AnEnum {
100101
WithVariants { and: usize, sub: usize, variants: usize },
101102
}

0 commit comments

Comments
 (0)