2021-09-12 08:43:30 -05:00
|
|
|
// We check the background color on the jump to definition links in the source code page.
|
2022-10-07 13:17:05 -05:00
|
|
|
goto: "file://" + |DOC_PATH| + "/src/link_to_definition/lib.rs.html"
|
2021-09-12 08:43:30 -05:00
|
|
|
|
2022-10-23 08:40:56 -05:00
|
|
|
define-function: (
|
|
|
|
"check-background-color",
|
|
|
|
(theme, background_color),
|
2023-01-06 08:18:51 -06:00
|
|
|
block {
|
2022-10-23 08:40:56 -05:00
|
|
|
// Set the theme.
|
2023-01-06 08:18:51 -06:00
|
|
|
local-storage: { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false" }
|
2022-10-23 08:40:56 -05:00
|
|
|
// We reload the page so the local storage settings are being used.
|
2023-01-06 08:18:51 -06:00
|
|
|
reload:
|
|
|
|
assert-css: (
|
2022-10-23 08:40:56 -05:00
|
|
|
"body.source .example-wrap pre.rust a",
|
|
|
|
{"background-color": |background_color|},
|
|
|
|
ALL,
|
2023-01-06 08:18:51 -06:00
|
|
|
)
|
|
|
|
},
|
2021-12-12 11:28:58 -06:00
|
|
|
)
|
2021-09-12 08:43:30 -05:00
|
|
|
|
2022-10-23 08:40:56 -05:00
|
|
|
call-function: ("check-background-color", ("ayu", "rgb(51, 51, 51)"))
|
|
|
|
call-function: ("check-background-color", ("dark", "rgb(51, 51, 51)"))
|
|
|
|
call-function: ("check-background-color", ("light", "rgb(238, 238, 238)"))
|