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

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

96 lines
2.8 KiB
Plaintext
Raw Normal View History

2022-09-16 11:22:23 -05:00
// This test checks links colors.
include: "utils.goml"
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
2022-09-16 11:22:23 -05:00
// This is needed so that the text color is computed.
show-text: true
2022-12-25 13:14:40 -06:00
define-function: (
"check-colors",
2024-04-01 14:11:22 -05:00
[theme, mod, macro, struct, enum, trait, fn, type, union, keyword,
sidebar, sidebar_current, sidebar_current_background],
block {
call-function: ("switch-theme", {"theme": |theme|})
2022-12-25 13:14:40 -06: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 13:14:40 -06:00
// Checking sidebar elements.
assert-css: (
2023-09-07 20:45:24 -05:00
".sidebar-elems li:not(.current) a",
2022-12-25 13:14:40 -06:00
{"color": |sidebar|, "background-color": "rgba(0, 0, 0, 0)", "font-weight": "400"},
ALL,
)
assert-css: (
2023-09-07 20:45:24 -05:00
".sidebar-elems li.current a",
2022-12-25 13:14:40 -06:00
{
"color": |sidebar_current|,
"background-color": |sidebar_current_background|,
"font-weight": "500",
},
ALL,
)
},
2022-09-16 11:22:23 -05:00
)
2022-12-25 13:14:40 -06: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 13:14:40 -06:00
},
2022-09-16 11:22:23 -05:00
)
2022-12-25 13:14:40 -06: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 13:14:40 -06:00
},
2022-09-16 11:22:23 -05:00
)
2022-12-25 13:14:40 -06: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 13:14:40 -06:00
},
2022-09-16 11:22:23 -05:00
)