rustdoc: add test case for background color of the sidebar toggle button

This commit is contained in:
Michael Howell 2022-07-01 15:14:49 -07:00
parent a7c0c9f2bb
commit 26dccbf4cf
2 changed files with 28 additions and 1 deletions

View File

@ -418,7 +418,7 @@ nav.sub {
background-color: var(--sidebar-background-color);
}
#sidebar-toggle:hover, #sidebar-toggle > button:focus {
#sidebar-toggle > button:hover:hover, #sidebar-toggle > button:focus {
background-color: var(--sidebar-background-color-hover);
}

View File

@ -30,6 +30,15 @@ assert-css: (
"#source-sidebar .expand + .children a.selected",
{"color": "rgb(0, 0, 0)", "background-color": "rgb(255, 255, 255)"},
)
// Without hover or focus.
assert-css: ("#sidebar-toggle > button", {"background-color": "rgba(0, 0, 0, 0)"})
// With focus.
focus: "#sidebar-toggle > button"
assert-css: ("#sidebar-toggle > button", {"background-color": "rgb(224, 224, 224)"})
focus: ".search-input"
// With hover.
move-cursor-to: "#sidebar-toggle > button"
assert-css: ("#sidebar-toggle > button", {"background-color": "rgb(224, 224, 224)"})
// Without hover.
assert-css: (
"#source-sidebar .expand + .children > .files a:not(.selected)",
@ -62,6 +71,15 @@ assert-css: (
"#source-sidebar .expand + .children a.selected",
{"color": "rgb(221, 221, 221)", "background-color": "rgb(51, 51, 51)"},
)
// Without hover or focus.
assert-css: ("#sidebar-toggle > button", {"background-color": "rgba(0, 0, 0, 0)"})
// With focus.
focus: "#sidebar-toggle > button"
assert-css: ("#sidebar-toggle > button", {"background-color": "rgb(103, 103, 103)"})
focus: ".search-input"
// With hover.
move-cursor-to: "#sidebar-toggle > button"
assert-css: ("#sidebar-toggle > button", {"background-color": "rgb(103, 103, 103)"})
// Without hover.
assert-css: (
"#source-sidebar .expand + .children > .files a:not(.selected)",
@ -94,6 +112,15 @@ assert-css: (
"#source-sidebar .expand + .children a.selected",
{"color": "rgb(255, 180, 76)", "background-color": "rgb(20, 25, 31)"},
)
// Without hover or focus.
assert-css: ("#sidebar-toggle > button", {"background-color": "rgba(0, 0, 0, 0)"})
// With focus.
focus: "#sidebar-toggle > button"
assert-css: ("#sidebar-toggle > button", {"background-color": "rgba(70, 70, 70, 0.33)"})
focus: ".search-input"
// With hover.
move-cursor-to: "#sidebar-toggle > button"
assert-css: ("#sidebar-toggle > button", {"background-color": "rgba(70, 70, 70, 0.33)"})
// Without hover.
assert-css: (
"#source-sidebar .expand + .children > .files a:not(.selected)",