]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-gui/headers-color.goml
Rollup merge of #102507 - scottmcm:more-binary-search-docs, r=m-ou-se
[rust.git] / src / test / rustdoc-gui / headers-color.goml
1 // This test check for headers text and background colors for the different themes.
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 // Ayu theme
8 local-storage: {
9     "rustdoc-theme": "ayu",
10     "rustdoc-preferred-dark-theme": "ayu",
11     "rustdoc-use-system-theme": "false",
12 }
13 reload:
14
15 assert-css: (
16     ".impl",
17     {"color": "rgb(197, 197, 197)", "background-color": "rgba(0, 0, 0, 0)"},
18     ALL,
19 )
20 assert-css: (
21     ".impl .code-header",
22     {"color": "rgb(230, 225, 207)", "background-color": "rgba(0, 0, 0, 0)"},
23     ALL,
24 )
25
26 goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html#impl-Foo"
27 assert-css: (
28     "#impl-Foo",
29     {"color": "rgb(197, 197, 197)", "background-color": "rgba(255, 236, 164, 0.06)"},
30 )
31
32 goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html#method.must_use"
33 assert-css: (
34     "#method\.must_use",
35     {"color": "rgb(197, 197, 197)", "background-color": "rgba(255, 236, 164, 0.06)"},
36     ALL,
37 )
38
39 goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
40 assert-css: (".small-section-header a", {"color": "rgb(197, 197, 197)"}, ALL)
41
42 goto: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html"
43 // We select headings (h2, h3, h...).
44 assert-css: (".docblock > :not(p) > a", {"color": "rgb(57, 175, 215)"}, ALL)
45
46 // Dark theme
47 local-storage: {
48     "rustdoc-theme": "dark",
49     "rustdoc-preferred-dark-theme": "dark",
50     "rustdoc-use-system-theme": "false",
51 }
52 goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
53
54 assert-css: (
55     ".impl",
56     {"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
57     ALL,
58 )
59 assert-css: (
60     ".impl .code-header",
61     {"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
62     ALL,
63 )
64
65 goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html#impl-Foo"
66 assert-css: (
67     "#impl-Foo",
68     {"color": "rgb(221, 221, 221)", "background-color": "rgb(73, 74, 61)"},
69 )
70
71 goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html#method.must_use"
72 assert-css: (
73     "#method\.must_use",
74     {"color": "rgb(221, 221, 221)", "background-color": "rgb(73, 74, 61)"},
75     ALL,
76 )
77
78 goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
79 assert-css: (".small-section-header a", {"color": "rgb(221, 221, 221)"}, ALL)
80
81 goto: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html"
82 // We select headings (h2, h3, h...).
83 assert-css: (".docblock > :not(p) > a", {"color": "rgb(210, 153, 29)"}, ALL)
84
85 // Light theme
86 local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
87 reload:
88
89 goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
90
91 assert-css: (
92     ".impl",
93     {"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
94     ALL,
95 )
96 assert-css: (
97     ".impl .code-header",
98     {"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
99     ALL,
100 )
101
102 goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html#impl-Foo"
103 assert-css: ("#impl-Foo", {"color": "rgb(0, 0, 0)", "background-color": "rgb(253, 255, 211)"})
104
105 goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html#method.must_use"
106 assert-css: (
107     "#method\.must_use",
108     {"color": "rgb(0, 0, 0)", "background-color": "rgb(253, 255, 211)"},
109     ALL,
110 )
111
112 goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
113 assert-css: (".small-section-header a", {"color": "rgb(0, 0, 0)"}, ALL)
114
115 goto: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html"
116 // We select headings (h2, h3, h...).
117 assert-css: (".docblock > :not(p) > a", {"color": "rgb(56, 115, 173)"}, ALL)