rust/tests/rustdoc-gui/links-color.goml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

99 lines
2.9 KiB
Plaintext
Raw Normal View History

2022-09-16 16:22:23 +00:00
// This test checks links colors.
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
2022-09-16 16:22:23 +00:00
// This is needed so that the text color is computed.
show-text: true
2022-12-25 19:14:40 +00:00
define-function: (
"check-colors",
(theme, mod, macro, struct, enum, trait, fn, type, union, keyword,
sidebar, sidebar_current, sidebar_current_background),
block {
set-local-storage: {
2022-12-25 19:14:40 +00:00
"rustdoc-theme": |theme|,
"rustdoc-use-system-theme": "false",
}
reload:
2022-12-25 19:14:40 +00:00
// Checking results colors.
assert-css: (".item-table .mod", {"color": |mod|}, ALL)
assert-css: (".item-table .macro", {"color": |macro|}, ALL)
assert-css: (".item-table .struct", {"color": |struct|}, ALL)
assert-css: (".item-table .enum", {"color": |enum|}, ALL)
assert-css: (".item-table .trait", {"color": |trait|}, ALL)
assert-css: (".item-table .fn", {"color": |fn|}, ALL)
assert-css: (".item-table .type", {"color": |type|}, ALL)
assert-css: (".item-table .union", {"color": |union|}, ALL)
assert-css: (".item-table .keyword", {"color": |keyword|}, ALL)
2022-12-25 19:14:40 +00:00
// Checking sidebar elements.
assert-css: (
2022-12-25 19:14:40 +00:00
".sidebar-elems a:not(.current)",
{"color": |sidebar|, "background-color": "rgba(0, 0, 0, 0)", "font-weight": "400"},
ALL,
)
assert-css: (
2022-12-25 19:14:40 +00:00
".sidebar-elems a.current",
{
"color": |sidebar_current|,
"background-color": |sidebar_current_background|,
"font-weight": "500",
},
ALL,
)
},
2022-09-16 16:22:23 +00:00
)
2022-12-25 19:14:40 +00:00
call-function: (
"check-colors",
{
"theme": "ayu",
"mod": "#39afd7",
"macro": "#a37acc",
"struct": "#ffa0a5",
"enum": "#ffa0a5",
"trait": "#39afd7",
"fn": "#fdd687",
"type": "#ffa0a5",
"union": "#ffa0a5",
"keyword": "#39afd7",
"sidebar": "#53b1db",
"sidebar_current": "#ffb44c",
"sidebar_current_background": "transparent",
2022-12-25 19:14:40 +00:00
},
2022-09-16 16:22:23 +00:00
)
2022-12-25 19:14:40 +00:00
call-function: (
"check-colors",
{
"theme": "dark",
"mod": "#d2991d",
"macro": "#09bd00",
"struct": "#2dbfb8",
"enum": "#2dbfb8",
"trait": "#b78cf2",
"fn": "#2bab63",
"type": "#2dbfb8",
"union": "#2dbfb8",
"keyword": "#d2991d",
"sidebar": "#fdbf35",
"sidebar_current": "#fdbf35",
"sidebar_current_background": "#444",
2022-12-25 19:14:40 +00:00
},
2022-09-16 16:22:23 +00:00
)
2022-12-25 19:14:40 +00:00
call-function: (
"check-colors",
{
"theme": "light",
"mod": "#3873ad",
"macro": "#068000",
"struct": "#ad378a",
"enum": "#ad378a",
"trait": "#6e4fc9",
"fn": "#ad7c37",
"type": "#ad378a",
"union": "#ad378a",
"keyword": "#3873ad",
"sidebar": "#356da4",
"sidebar_current": "#356da4",
"sidebar_current_background": "#fff",
2022-12-25 19:14:40 +00:00
},
2022-09-16 16:22:23 +00:00
)