@@ -48,23 +48,35 @@ compare-elements-position-near: (".block.keyword li:nth-child(1)", ".mobile-topb
48
48
49
49
// Now checking the background color of the sidebar.
50
50
show-text: true
51
- local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": "dark"}
52
- reload:
53
51
54
- // Open the sidebar menu.
55
- click: ".sidebar-menu-toggle"
56
- assert-css: (".sidebar", {"background-color": "rgb(80, 80, 80)", "color": "rgb(221, 221, 221)"})
57
-
58
- local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": "ayu"}
59
- reload:
60
-
61
- // Open the sidebar menu.
62
- click: ".sidebar-menu-toggle"
63
- assert-css: (".sidebar", {"background-color": "rgb(20, 25, 31)", "color": "rgb(197, 197, 197)"})
52
+ define-function: (
53
+ "check-colors",
54
+ (theme, color, background),
55
+ [
56
+ ("local-storage", {"rustdoc-use-system-theme": "false", "rustdoc-theme": |theme|}),
57
+ ("reload"),
64
58
65
- local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": "light"}
66
- reload:
59
+ // Open the sidebar menu.
60
+ ("click", ".sidebar-menu-toggle"),
61
+ ("assert-css", (".sidebar", {
62
+ "background-color": |background|,
63
+ "color": |color|,
64
+ })),
65
+ ],
66
+ )
67
67
68
- // Open the sidebar menu.
69
- click: ".sidebar-menu-toggle"
70
- assert-css: (".sidebar", {"background-color": "rgb(245, 245, 245)", "color": "rgb(0, 0, 0)"})
68
+ call-function: ("check-colors", {
69
+ "theme": "ayu",
70
+ "color": "rgb(197, 197, 197)",
71
+ "background": "rgb(20, 25, 31)",
72
+ })
73
+ call-function: ("check-colors", {
74
+ "theme": "dark",
75
+ "color": "rgb(221, 221, 221)",
76
+ "background": "rgb(80, 80, 80)",
77
+ })
78
+ call-function: ("check-colors", {
79
+ "theme": "light",
80
+ "color": "rgb(0, 0, 0)",
81
+ "background": "rgb(245, 245, 245)",
82
+ })
0 commit comments