Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix code blocks color in Ayu theme #88419

Merged
merged 2 commits into from
Aug 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/librustdoc/html/static/css/themes/ayu.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ h4 {
.code-header {
color: #e6e1cf;
}
pre > code {
.docblock pre > code, pre > code {
camelid marked this conversation as resolved.
Show resolved Hide resolved
color: #e6e1cf;
}
span code {
Expand Down
13 changes: 0 additions & 13 deletions src/test/rustdoc-gui/ayu-code-tag-colors.goml

This file was deleted.

30 changes: 30 additions & 0 deletions src/test/rustdoc-gui/code-color.goml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// The ayu theme has a different color for the "<code>" tags in the doc blocks. We need to
// check that the rule isn't applied on other "<code>" elements.
//
// While we're at it, we also check it for the other themes.
goto: file://|DOC_PATH|/test_docs/fn.foo.html
// If the text isn't displayed, the browser doesn't compute color style correctly...
show-text: true
// Set the theme to dark.
local-storage: {"rustdoc-theme": "dark", "rustdoc-preferred-dark-theme": "dark", "rustdoc-use-system-theme": "false"}
// We reload the page so the local storage settings are being used.
reload:

assert-css: (".docblock pre > code", {"color": "rgb(221, 221, 221)"}, ALL)
assert-css: (".docblock > p > code", {"color": "rgb(221, 221, 221)"}, ALL)

// Set the theme to ayu.
local-storage: {"rustdoc-theme": "ayu", "rustdoc-preferred-dark-theme": "ayu", "rustdoc-use-system-theme": "false"}
// We reload the page so the local storage settings are being used.
reload:

assert-css: (".docblock pre > code", {"color": "rgb(230, 225, 207)"}, ALL)
assert-css: (".docblock > p > code", {"color": "rgb(255, 180, 84)"}, ALL)

// Set the theme to light.
local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
// We reload the page so the local storage settings are being used.
reload:

assert-css: (".docblock pre > code", {"color": "rgb(0, 0, 0)"}, ALL)
assert-css: (".docblock > p > code", {"color": "rgb(0, 0, 0)"}, ALL)
2 changes: 2 additions & 0 deletions src/test/rustdoc-gui/src/test_docs/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ use std::fmt;
/// ```ignore (it's a test)
/// Let's say I'm just some text will ya?
/// ```
///
/// An inlined `code`!
pub fn foo() {}

/// Just a normal struct.
Expand Down