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