2022-09-16 11:22:23 -05:00
|
|
|
// This test checks links colors.
|
2024-04-05 14:38:55 -05:00
|
|
|
include: "utils.goml"
|
2023-04-11 12:11:34 -05:00
|
|
|
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],
|
2023-01-06 08:18:51 -06:00
|
|
|
block {
|
2024-04-05 14:38:55 -05:00
|
|
|
call-function: ("switch-theme", {"theme": |theme|})
|
2022-12-25 13:14:40 -06:00
|
|
|
// Checking results colors.
|
2023-01-06 08:18:51 -06:00
|
|
|
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.
|
2023-01-06 08:18:51 -06:00
|
|
|
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,
|
2023-01-06 08:18:51 -06:00
|
|
|
)
|
|
|
|
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,
|
2023-01-06 08:18:51 -06:00
|
|
|
)
|
|
|
|
},
|
2022-09-16 11:22:23 -05:00
|
|
|
)
|
|
|
|
|
2022-12-25 13:14:40 -06:00
|
|
|
call-function: (
|
|
|
|
"check-colors",
|
|
|
|
{
|
|
|
|
"theme": "ayu",
|
2023-08-08 09:55:28 -05:00
|
|
|
"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",
|
2023-08-08 09:55:28 -05:00
|
|
|
"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",
|
2023-08-08 09:55:28 -05:00
|
|
|
"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
|
|
|
)
|