]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-gui/headers-color.goml
Rollup merge of #92981 - RalfJung:const_ptr_offset_from, r=dtolnay
[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": "rgb(15, 20, 25)"},
23     ALL,
24 )
25
26 goto: file://|DOC_PATH|/test_docs/struct.Foo.html#impl
27 assert-css: (
28     "#impl",
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 assert-css: (".section-header a", {"color": "rgb(57, 175, 215)"}, ALL)
44
45 // Dark theme
46 local-storage: {
47     "rustdoc-theme": "dark",
48     "rustdoc-preferred-dark-theme": "dark",
49     "rustdoc-use-system-theme": "false",
50 }
51 goto: file://|DOC_PATH|/test_docs/struct.Foo.html
52
53 assert-css: (
54     ".impl",
55     {"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
56     ALL,
57 )
58 assert-css: (
59     ".impl .code-header",
60     {"color": "rgb(221, 221, 221)", "background-color": "rgb(53, 53, 53)"},
61     ALL,
62 )
63
64 goto: file://|DOC_PATH|/test_docs/struct.Foo.html#impl
65 assert-css: (
66     "#impl",
67     {"color": "rgb(221, 221, 221)", "background-color": "rgb(73, 74, 61)"},
68 )
69
70 goto: file://|DOC_PATH|/test_docs/struct.Foo.html#method.must_use
71 assert-css: (
72     "#method\.must_use",
73     {"color": "rgb(221, 221, 221)", "background-color": "rgb(73, 74, 61)"},
74     ALL,
75 )
76
77 goto: file://|DOC_PATH|/test_docs/index.html
78 assert-css: (".small-section-header a", {"color": "rgb(221, 221, 221)"}, ALL)
79
80 goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html
81 assert-css: (".section-header a", {"color": "rgb(210, 153, 29)"}, ALL)
82
83 // Light theme
84 local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
85 reload:
86
87 goto: file://|DOC_PATH|/test_docs/struct.Foo.html
88
89 assert-css: (
90     ".impl",
91     {"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
92     ALL,
93 )
94 assert-css: (
95     ".impl .code-header",
96     {"color": "rgb(0, 0, 0)", "background-color": "rgb(255, 255, 255)"},
97     ALL,
98 )
99
100 goto: file://|DOC_PATH|/test_docs/struct.Foo.html#impl
101 assert-css: ("#impl", {"color": "rgb(0, 0, 0)", "background-color": "rgb(253, 255, 211)"})
102
103 goto: file://|DOC_PATH|/test_docs/struct.Foo.html#method.must_use
104 assert-css: (
105     "#method\.must_use",
106     {"color": "rgb(0, 0, 0)", "background-color": "rgb(253, 255, 211)"},
107     ALL,
108 )
109
110 goto: file://|DOC_PATH|/test_docs/index.html
111 assert-css: (".small-section-header a", {"color": "rgb(0, 0, 0)"}, ALL)
112
113 goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html
114 assert-css: (".section-header a", {"color": "rgb(56, 115, 173)"}, ALL)