forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlinks-color.goml
101 lines (98 loc) · 3.1 KB
/
links-color.goml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// This test checks links colors.
include: "utils.goml"
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
// This is needed so that the text color is computed.
show-text: true
// First we check the links of the different items.
define-function: (
"check-colors",
[theme, mod, macro, struct, enum, trait, fn, type, union, keyword,
sidebar, sidebar_current, sidebar_current_background],
block {
call-function: ("switch-theme", {"theme": |theme|})
// 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)
// Checking sidebar elements.
assert-css: (
".sidebar-elems li:not(.current) a",
{"color": |sidebar|, "background-color": "rgba(0, 0, 0, 0)", "font-weight": "400"},
ALL,
)
assert-css: (
".sidebar-elems li.current a",
{
"color": |sidebar_current|,
"background-color": |sidebar_current_background|,
"font-weight": "500",
},
ALL,
)
move-cursor-to: "dd a[href='long_code_block_link/index.html']"
assert-css: (
"dd a[href='long_code_block_link/index.html']",
{"text-decoration": "underline solid " + |mod|},
)
},
)
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",
},
)
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",
},
)
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",
},
)