Increase color contrast on links and buttons in staff interface

Bug #1991562 reported by Stephanie Leary
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned

Bug Description

Moving color contrast discussion from https://bugs.launchpad.net/evergreen/+bug/1960526/comments/8 since its parent bug is now closed, and this encompasses buttons as well as links.

Several of Bootstrap 4's default colors don't pass WCAG level AA tests, including the primary blue (#007bff) used for both links and buttons throughout the staff interface.

The link color proposed in #1960526 does pass level AAA checks on the main contrast checking tool, but doesn't pass the link contrast checker (https://webaim.org/resources/linkcontrastchecker/) because it lacks contrast with the body text color. Note that we need to test with #f7f7f7 as the background color, since this is used in tabs and tables.

Level AAA compliance is complicated, and introduces problems for people who don't have low vision. I think we should consider a separate high-contrast mode that could be set in user preferences for those who need it, and stick to Level AA compliance otherwise

I've put together a quick comparison of all four link and button colors that are currently failing automated accessibility tests: https://codepen.io/stephanieleary/pen/poVaPYq

The second set shows the minimum change needed to pass the Level AA tests, and the third set shows the nearest Bootstrap 5 tints (https://getbootstrap.com/docs/5.0/customize/color/#all-colors). I would recommend the Bootstrap 5 colors even though they are ever so slightly darker, since sticking to the defined palette will help us stay consistent.

I also threw in a button using the Evergreen brand color in the second set, but I'm leaning against adopting that color for green/success because it's so similar to the cyan/info color. If we want to use the Evergreen shade for buttons, we'll need to consider choosing a different color for btn-info.

If you agree on the Bootstrap 5 scheme, here's a patch: https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/sleary/a11y_btn

It does not include the optional text shadows; I plan to do a separate patch later to add subtle shadows to several parts of the interface where depth can be hard to perceive, like nav menus that drop down over dense text tables.

Revision history for this message
Galen Charlton (gmc) wrote :

Noting for anybody reading this that the Angular and ng-bootstrap upgrade proposed in bug 1982376 would force the issue of also upgrading to Bootstrap 5.

Revision history for this message
Stephanie Leary (stephanieleary) wrote :

Updated branch with pagination styles moved into the appropriate component and added styles for outlined buttons: https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/sleary/lp1991562-link-button-contrast

tags: added: pullrequest
Andrea Neiman (aneiman)
Changed in evergreen:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Stephanie Leary (stephanieleary) wrote :

Rebased for bug squashing.

Andrea Neiman (aneiman)
Changed in evergreen:
assignee: Stephanie Leary (stephanieleary) → nobody
Revision history for this message
Terran McCanna (tmccanna) wrote :

Stephanie, could you rebase this to current master, please? (I'm getting a conflict with other newly committed CSS.)

tags: added: needsrebase
Andrea Neiman (aneiman)
Changed in evergreen:
milestone: none → 3.next
Revision history for this message
Stephanie Leary (stephanieleary) wrote :

Rebased! Thanks, Terran.

tags: removed: needsrebase
Revision history for this message
Shula Link (slink-g) wrote :

Checked all the link and button contrast levels and they meet or exceed WCAG standards. Signed off here!

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=commit;h=9cd31140fc668d406e43a069755e6cb1fa31e4e6

tags: added: signedoff
Galen Charlton (gmc)
Changed in evergreen:
assignee: nobody → Galen Charlton (gmc)
milestone: 3.next → 3.10.1
Revision history for this message
Galen Charlton (gmc) wrote :

Tested and pushed down to rel_3_10. Thanks, Stephanie and Shula!

Changed in evergreen:
status: Confirmed → Fix Committed
assignee: Galen Charlton (gmc) → nobody
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.