civictechindex / CTI-website-frontend

Join a worldwide movement to catalog 
every open source 
civic tech project.
https://civictechindex.org
MIT License
30 stars 30 forks source link

Fix Contrast on Buttons to Pass Accessibility Threshold #1094

Closed mariastudnicka closed 2 years ago

mariastudnicka commented 2 years ago

Overview

Currently the buttons do not pass the threshold for proper contrast.They will need to have higher contrast for better visibility.

ladissi commented 2 years ago

@chalimar please provide update

  1. Progress
  2. Blockers
  3. Availability
  4. ETA
chalimar commented 2 years ago

Please see proposed changes in Accessibility Updates to button styling.

Screen Shot 2021-12-13 at 11 53 40 AM
bruceplai commented 2 years ago

@chalimar I'm still getting insufficient contrast notices from axe. The updated button text and background colors are 0F1D2F and 0A7A9E, correct?

bruceplai commented 2 years ago

image

chalimar commented 2 years ago

Hey @bruceplai

The two colors we are using for the button and its label should be the CTI Light Blue (#0D99C6) and CTI Dark Blue (#0F1D2F). The updated hex code for the darker shade of light blue (#0A7A9E) didn't pass accessibility on different colored backgrounds which Axe is picking up. Can we please change it back to (#0D99C6)?

Happy to connect in the meeting! Thank you so much!

bruceplai commented 2 years ago

@chalimar just following up from the discussion in the last meeting. The darker shade of blue (#0A7A9E) with white text seems to allow buttons to pass the contrast test. That'll be updated in the code soon. A separate issue will be opened for link and header link contrast (which I think can be fixed by using the same shade of blue). Thanks!

chalimar commented 2 years ago

Thank you @bruceplai, primary buttons in the design system have been updated to #0A7A9E to match with the new changes. Can I please get a copy of the button states when possible so I update the hex-codes in Figma? Thank you!

bruceplai commented 2 years ago

@chalimar for buttons, the opacity is updated during state changes. I'd have to see how that affects the actual hex color codes in the browser. Thanks

const defaultButtonSettings = {
  backgroundColor: LIGHT_BLUE_3,
  color: WHITE,
  '&$disabled': {
    backgroundColor: LIGHT_BLUE_3,
    color: WHITE,
    opacity: '0.50',
  },
  '&:hover': {
    backgroundColor: LIGHT_BLUE_3,
    opacity: '0.92',
  },
  '&:focus': {
    backgroundColor: LIGHT_BLUE_3,
    opacity: '0.76',
  },
  '&:active': {
    backgroundColor: LIGHT_BLUE_3,
    opacity: '0.68',
  },
};
bruceplai commented 2 years ago

@chalimar looks like the color value doesn't change with opacity updates. Can that be modeled in the figma?