Skip to content

Commit 60bfd06

Browse files
committed
Fix show-page downloads button contrast
1 parent 29d40c2 commit 60bfd06

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

app/assets/stylesheets/uwm.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@
2222
color: $black;
2323
}
2424

25+
.downloads-sidebar .btn-primary,
26+
.downloads-sidebar .btn-primary:hover,
27+
.downloads-sidebar .btn-primary:focus,
28+
.downloads-sidebar .btn-primary:not(:disabled):not(.disabled):active,
29+
.downloads-sidebar .btn-primary:not(:disabled):not(.disabled).active,
30+
.downloads-sidebar .show > .btn-primary.dropdown-toggle {
31+
color: $black;
32+
}
33+
2534
.screen-reader-text {
2635
@include sr-only;
2736
}

test/system/accessibility_test.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,25 @@ def test_search_results_have_no_critical_accessibility_violations
1414

1515
assert_no_axe_violations
1616
end
17+
18+
def test_show_page_download_button_has_dark_text
19+
visit("/catalog/stanford-cz128vq0535")
20+
21+
assert page.has_selector?("#downloads-button")
22+
23+
styles = page.evaluate_script(<<~JS)
24+
(() => {
25+
const button = document.querySelector("#downloads-button");
26+
const computed = window.getComputedStyle(button);
27+
28+
return {
29+
color: computed.color,
30+
background_color: computed.backgroundColor
31+
};
32+
})()
33+
JS
34+
35+
assert_equal "rgb(0, 0, 0)", styles["color"]
36+
assert_equal "rgb(255, 189, 0)", styles["background_color"]
37+
end
1738
end

0 commit comments

Comments
 (0)