summaryrefslogtreecommitdiffstats
path: root/src/test/rustdoc-gui/headers-color.goml
blob: a47a9c8a14c1f07e4505729564490ebe7ea7c14e (plain)
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
// This test check for headers text and background colors for the different themes.
goto: file://|DOC_PATH|/test_docs/struct.Foo.html

// This is needed so that the text color is computed.
show-text: true

// Ayu theme
local-storage: {
    "rustdoc-theme": "ayu",
    "rustdoc-preferred-dark-theme": "ayu",
    "rustdoc-use-system-theme": "false",
}
reload:

assert-css: (
    ".impl",
    {"color": "rgb(197, 197, 197)", "background-color": "rgba(0, 0, 0, 0)"},
    ALL,
)
assert-css: (
    ".impl .code-header",
    {"color": "rgb(230, 225, 207)", "background-color": "rgb(15, 20, 25)"},
    ALL,
)

goto: file://|DOC_PATH|/test_docs/struct.Foo.html#impl-Foo
assert-css: (
    "#impl-Foo",
    {"color": "rgb(197, 197, 197)", "background-color": "rgba(255, 236, 164, 0.06)"},
)

goto: file://|DOC_PATH|/test_docs/struct.Foo.html#method.must_use
assert-css: (
    "#method\.must_use",
    {"color": "rgb(197, 197, 197)", "background-color": "rgba(255, 236, 164, 0.06)"},
    ALL,
)

goto: file://|DOC_PATH|/test_docs/index.html
assert-css: (".small-section-header a", {"color": "rgb(197, 197, 197)"}, ALL)

goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html
// We select headings (h2, h3, h...).
assert-css: (".docblock > :not(p) > a", {"color": "rgb(57, 175, 215)"}, ALL)

// Dark theme
local-storage: {
    "rustdoc-theme": "dark",
    "rustdoc-preferred-dark-theme": "dark",
    "rustdoc-use-system-theme": "false",
}
goto: file://|DOC_PATH|/test_docs/struct.Foo.html

assert-css: (
    ".impl",
    {"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
    ALL,
)
assert-css: (
    ".impl .code-header",
    {"color": "rgb(221, 221, 221)", "background-color": "rgb(53, 53, 53)"},
    ALL,
)

goto: file://|DOC_PATH|/test_docs/struct.Foo.html#impl-Foo
assert-css: (
    "#impl-Foo",
    {"color": "rgb(221, 221, 221)", "background-color": "rgb(73, 74, 61)"},
)

goto: file://|DOC_PATH|/test_docs/struct.Foo.html#method.must_use
assert-css: (
    "#method\.must_use",
    {"color": "rgb(221, 221, 221)", "background-color": "rgb(73, 74, 61)"},
    ALL,
)

goto: file://|DOC_PATH|/test_docs/index.html
assert-css: (".small-section-header a", {"color": "rgb(221, 221, 221)"}, ALL)

goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html
// We select headings (h2, h3, h...).
assert-css: (".docblock > :not(p) > a", {"color": "rgb(210, 153, 29)"}, ALL)

// Light theme
local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
reload:

goto: file://|DOC_PATH|/test_docs/struct.Foo.html

assert-css: (
    ".impl",
    {"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
    ALL,
)
assert-css: (
    ".impl .code-header",
    {"color": "rgb(0, 0, 0)", "background-color": "rgb(255, 255, 255)"},
    ALL,
)

goto: file://|DOC_PATH|/test_docs/struct.Foo.html#impl-Foo
assert-css: ("#impl-Foo", {"color": "rgb(0, 0, 0)", "background-color": "rgb(253, 255, 211)"})

goto: file://|DOC_PATH|/test_docs/struct.Foo.html#method.must_use
assert-css: (
    "#method\.must_use",
    {"color": "rgb(0, 0, 0)", "background-color": "rgb(253, 255, 211)"},
    ALL,
)

goto: file://|DOC_PATH|/test_docs/index.html
assert-css: (".small-section-header a", {"color": "rgb(0, 0, 0)"}, ALL)

goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html
// We select headings (h2, h3, h...).
assert-css: (".docblock > :not(p) > a", {"color": "rgb(56, 115, 173)"}, ALL)