2024-03-27 08:19:17 -05:00
|
|
|
// Check that the targeted element has the expected styles.
|
2023-04-11 12:11:34 -05:00
|
|
|
go-to: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html#method.a_method"
|
2022-11-08 14:12:41 -06:00
|
|
|
show-text: true
|
|
|
|
|
|
|
|
// Confirming that the method is the target.
|
|
|
|
assert: "#method\.a_method:target"
|
|
|
|
|
|
|
|
define-function: (
|
|
|
|
"check-style",
|
|
|
|
(theme, background, border),
|
2023-01-06 08:18:51 -06:00
|
|
|
block {
|
2023-04-11 12:11:34 -05:00
|
|
|
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
|
2023-01-06 08:18:51 -06:00
|
|
|
reload:
|
|
|
|
assert-css: ("#method\.a_method:target", {
|
2022-11-08 14:12:41 -06:00
|
|
|
"background-color": |background|,
|
|
|
|
"border-right": "3px solid " + |border|,
|
2023-01-06 08:18:51 -06:00
|
|
|
})
|
|
|
|
},
|
2022-11-08 14:12:41 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
call-function: ("check-style", {
|
|
|
|
"theme": "ayu",
|
|
|
|
"background": "rgba(255, 236, 164, 0.06)",
|
|
|
|
"border": "rgba(255, 180, 76, 0.85)",
|
|
|
|
})
|
|
|
|
call-function: ("check-style", {
|
|
|
|
"theme": "dark",
|
2023-05-29 09:03:56 -05:00
|
|
|
"background": "#494a3d",
|
|
|
|
"border": "#bb7410",
|
2022-11-08 14:12:41 -06:00
|
|
|
})
|
|
|
|
call-function: ("check-style", {
|
|
|
|
"theme": "light",
|
2023-05-29 09:03:56 -05:00
|
|
|
"background": "#fdffd3",
|
|
|
|
"border": "#ad7c37",
|
2022-11-08 14:12:41 -06:00
|
|
|
})
|