@@ -4,7 +4,7 @@ show-text: true
4
4
5
5
define-function: (
6
6
"check-colors",
7
- (theme),
7
+ (theme, background, color, border ),
8
8
[
9
9
// Setting the theme.
10
10
("local-storage", {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}),
@@ -30,6 +30,25 @@ define-function: (
30
30
".docblock .example-wrap.compile_fail",
31
31
{"border-left": "2px solid rgb(255, 0, 0)"},
32
32
)),
33
+ ("assert-css", (
34
+ ".docblock .example-wrap.compile_fail .tooltip::after",
35
+ {
36
+ "content": '"This example deliberately fails to compile"',
37
+ "text-align": "center",
38
+ "padding": "5px 3px 3px",
39
+ "background-color": |background|,
40
+ "color": |color|,
41
+ "border": "1px solid " + |border|,
42
+ },
43
+ )),
44
+ ("assert-css", (
45
+ ".docblock .example-wrap.compile_fail .tooltip::before",
46
+ {
47
+ "border-width": "5px",
48
+ "border-style": "solid",
49
+ "border-color": "rgba(0, 0, 0, 0) " + |background| + " rgba(0, 0, 0, 0) rgba(0, 0, 0, 0)",
50
+ },
51
+ )),
33
52
34
53
// should_panic block
35
54
("assert-css", (
@@ -51,6 +70,25 @@ define-function: (
51
70
".docblock .example-wrap.should_panic",
52
71
{"border-left": "2px solid rgb(255, 0, 0)"},
53
72
)),
73
+ ("assert-css", (
74
+ ".docblock .example-wrap.should_panic .tooltip::after",
75
+ {
76
+ "content": '"This example panics"',
77
+ "text-align": "center",
78
+ "padding": "5px 3px 3px",
79
+ "background-color": |background|,
80
+ "color": |color|,
81
+ "border": "1px solid " + |border|,
82
+ },
83
+ )),
84
+ ("assert-css", (
85
+ ".docblock .example-wrap.should_panic .tooltip::before",
86
+ {
87
+ "border-width": "5px",
88
+ "border-style": "solid",
89
+ "border-color": "rgba(0, 0, 0, 0) " + |background| + " rgba(0, 0, 0, 0) rgba(0, 0, 0, 0)",
90
+ },
91
+ )),
54
92
55
93
// ignore block
56
94
("assert-css", (
@@ -72,9 +110,43 @@ define-function: (
72
110
".docblock .example-wrap.ignore",
73
111
{"border-left": "2px solid rgb(255, 142, 0)"},
74
112
)),
113
+ ("assert-css", (
114
+ ".docblock .example-wrap.ignore .tooltip::after",
115
+ {
116
+ "content": '"This example is not tested"',
117
+ "text-align": "center",
118
+ "padding": "5px 3px 3px",
119
+ "background-color": |background|,
120
+ "color": |color|,
121
+ "border": "1px solid " + |border|,
122
+ },
123
+ )),
124
+ ("assert-css", (
125
+ ".docblock .example-wrap.ignore .tooltip::before",
126
+ {
127
+ "border-width": "5px",
128
+ "border-style": "solid",
129
+ "border-color": "rgba(0, 0, 0, 0) " + |background| + " rgba(0, 0, 0, 0) rgba(0, 0, 0, 0)",
130
+ },
131
+ )),
75
132
],
76
133
)
77
134
78
- call-function: ("check-colors", ("ayu"))
79
- call-function: ("check-colors", ("dark"))
80
- call-function: ("check-colors", ("light"))
135
+ call-function: ("check-colors", {
136
+ "theme": "ayu",
137
+ "background": "rgb(49, 69, 89)",
138
+ "color": "rgb(197, 197, 197)",
139
+ "border": "rgb(92, 103, 115)",
140
+ })
141
+ call-function: ("check-colors", {
142
+ "theme": "dark",
143
+ "background": "rgb(0, 0, 0)",
144
+ "color": "rgb(255, 255, 255)",
145
+ "border": "rgb(224, 224, 224)",
146
+ })
147
+ call-function: ("check-colors", {
148
+ "theme": "light",
149
+ "background": "rgb(253, 255, 211)",
150
+ "color": "rgb(255, 255, 255)",
151
+ "border": "rgb(224, 224, 224)",
152
+ })
0 commit comments