]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-gui/sidebar-links-color.goml
Auto merge of #103691 - michaelwoerister:consistent-slice-and-str-cpp-like-debuginfo...
[rust.git] / src / test / rustdoc-gui / sidebar-links-color.goml
1 // This test checks links colors in sidebar before and after hover.
2 goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
3
4 // This is needed so that the text color is computed.
5 show-text: true
6
7 define-function: (
8     "check-colors",
9     (
10         theme, struct, struct_hover, struct_hover_background, enum, enum_hover,
11         enum_hover_background, union, union_hover, union_hover_background, trait, trait_hover,
12         trait_hover_background, fn, fn_hover, fn_hover_background, type, type_hover,
13         type_hover_background, keyword, keyword_hover, keyword_hover_background,
14     ),
15     [
16         ("local-storage", { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false" }),
17         ("reload"),
18         // Struct
19         ("assert-css", (
20             ".sidebar .block.struct a:not(.current)",
21             {"color": |struct|, "background-color": "rgba(0, 0, 0, 0)"},
22         )),
23         ("move-cursor-to", ".sidebar .block.struct a:not(.current)"),
24         ("assert-css", (
25             ".sidebar .block.struct a:hover",
26             {"color": |struct_hover|, "background-color": |struct_hover_background|},
27         )),
28         // Enum
29         ("assert-css", (
30             ".sidebar .block.enum a",
31             {"color": |enum|, "background-color": "rgba(0, 0, 0, 0)"},
32         )),
33         ("move-cursor-to", ".sidebar .block.enum a"),
34         ("assert-css", (
35             ".sidebar .block.enum a:hover",
36             {"color": |enum_hover|, "background-color": |enum_hover_background|},
37         )),
38         // Union
39         ("assert-css", (
40             ".sidebar .block.union a",
41             {"color": |union|, "background-color": "rgba(0, 0, 0, 0)"},
42         )),
43         ("move-cursor-to", ".sidebar .block.union a"),
44         ("assert-css", (
45             ".sidebar .block.union a:hover",
46             {"color": |union_hover|, "background-color": |union_hover_background|},
47         )),
48         // Trait
49         ("assert-css", (
50             ".sidebar .block.trait a",
51             {"color": |trait|, "background-color": "rgba(0, 0, 0, 0)"},
52         )),
53         ("move-cursor-to", ".sidebar .block.trait a"),
54         ("assert-css", (
55             ".sidebar .block.trait a:hover",
56             {"color": |trait_hover|, "background-color": |trait_hover_background|},
57         )),
58         // Function
59         ("assert-css", (
60             ".sidebar .block.fn a",
61             {"color": |fn|, "background-color": "rgba(0, 0, 0, 0)"},
62         )),
63         ("move-cursor-to", ".sidebar .block.fn a"),
64         ("assert-css", (
65             ".sidebar .block.fn a:hover",
66             {"color": |fn_hover|, "background-color": |fn_hover_background|},
67         )),
68         // Type definition
69         ("assert-css", (
70             ".sidebar .block.type a",
71             {"color": |type|, "background-color": "rgba(0, 0, 0, 0)"},
72         )),
73         ("move-cursor-to", ".sidebar .block.type a"),
74         ("assert-css", (
75             ".sidebar .block.type a:hover",
76             {"color": |type_hover|, "background-color": |type_hover_background|},
77         )),
78         // Keyword
79         ("assert-css", (
80             ".sidebar .block.keyword a",
81             {"color": |keyword|, "background-color": "rgba(0, 0, 0, 0)"},
82         )),
83         ("move-cursor-to", ".sidebar .block.keyword a"),
84         ("assert-css", (
85             ".sidebar .block.keyword a:hover",
86             {"color": |keyword_hover|, "background-color": |keyword_hover_background|},
87         )),
88     ]
89 )
90
91 call-function: (
92     "check-colors",
93     {
94         "theme": "ayu",
95         "struct": "rgb(83, 177, 219)",
96         "struct_hover": "rgb(255, 180, 76)",
97         "struct_hover_background": "rgba(0, 0, 0, 0)",
98         "enum": "rgb(83, 177, 219)",
99         "enum_hover": "rgb(255, 180, 76)",
100         "enum_hover_background": "rgba(0, 0, 0, 0)",
101         "union": "rgb(83, 177, 219)",
102         "union_hover": "rgb(255, 180, 76)",
103         "union_hover_background": "rgba(0, 0, 0, 0)",
104         "trait": "rgb(83, 177, 219)",
105         "trait_hover": "rgb(255, 180, 76)",
106         "trait_hover_background": "rgba(0, 0, 0, 0)",
107         "fn": "rgb(83, 177, 219)",
108         "fn_hover": "rgb(255, 180, 76)",
109         "fn_hover_background": "rgba(0, 0, 0, 0)",
110         "type": "rgb(83, 177, 219)",
111         "type_hover": "rgb(255, 180, 76)",
112         "type_hover_background": "rgba(0, 0, 0, 0)",
113         "keyword": "rgb(83, 177, 219)",
114         "keyword_hover": "rgb(255, 180, 76)",
115         "keyword_hover_background": "rgba(0, 0, 0, 0)",
116     }
117 )
118 call-function: (
119     "check-colors",
120     {
121         "theme": "dark",
122         "struct": "rgb(253, 191, 53)",
123         "struct_hover": "rgb(253, 191, 53)",
124         "struct_hover_background": "rgb(68, 68, 68)",
125         "enum": "rgb(253, 191, 53)",
126         "enum_hover": "rgb(253, 191, 53)",
127         "enum_hover_background": "rgb(68, 68, 68)",
128         "union": "rgb(253, 191, 53)",
129         "union_hover": "rgb(253, 191, 53)",
130         "union_hover_background": "rgb(68, 68, 68)",
131         "trait": "rgb(253, 191, 53)",
132         "trait_hover": "rgb(253, 191, 53)",
133         "trait_hover_background": "rgb(68, 68, 68)",
134         "fn": "rgb(253, 191, 53)",
135         "fn_hover": "rgb(253, 191, 53)",
136         "fn_hover_background": "rgb(68, 68, 68)",
137         "type": "rgb(253, 191, 53)",
138         "type_hover": "rgb(253, 191, 53)",
139         "type_hover_background": "rgb(68, 68, 68)",
140         "keyword": "rgb(253, 191, 53)",
141         "keyword_hover": "rgb(253, 191, 53)",
142         "keyword_hover_background": "rgb(68, 68, 68)",
143     }
144 )
145 call-function: (
146     "check-colors",
147     {
148         "theme": "light",
149         "struct": "rgb(53, 109, 164)",
150         "struct_hover": "rgb(53, 109, 164)",
151         "struct_hover_background": "rgb(255, 255, 255)",
152         "enum": "rgb(53, 109, 164)",
153         "enum_hover": "rgb(53, 109, 164)",
154         "enum_hover_background": "rgb(255, 255, 255)",
155         "union": "rgb(53, 109, 164)",
156         "union_hover": "rgb(53, 109, 164)",
157         "union_hover_background": "rgb(255, 255, 255)",
158         "trait": "rgb(53, 109, 164)",
159         "trait_hover": "rgb(53, 109, 164)",
160         "trait_hover_background": "rgb(255, 255, 255)",
161         "fn": "rgb(53, 109, 164)",
162         "fn_hover": "rgb(53, 109, 164)",
163         "fn_hover_background": "rgb(255, 255, 255)",
164         "type": "rgb(53, 109, 164)",
165         "type_hover": "rgb(53, 109, 164)",
166         "type_hover_background": "rgb(255, 255, 255)",
167         "keyword": "rgb(53, 109, 164)",
168         "keyword_hover": "rgb(53, 109, 164)",
169         "keyword_hover_background": "rgb(255, 255, 255)",
170     }
171 )