Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[med] Color Contrast: Many Pages: Input controls grey border against adjacent white fails contrast #5521

Closed
ogumen opened this issue Sep 24, 2021 · 30 comments
Assignees
Labels
Design External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@ogumen
Copy link

ogumen commented Sep 24, 2021

Action Performed:

Prerequisite: user has created personal account and is logged into same.

  1. Using Chrome, open https://staging.new.expensify.com/
  2. Click on the new chat floating action icon button (+) in the left side panel and select 'New Group'
  3. In the 'New Group' side-panel overlay, inspect the contrast ratio of the light grey border around the search input field against the adjacent white background.

Expected Result:

The graphical information required to identify user interface components must have a contrast ratio of at least 3.00:1 against adjacent colors. In this case, the input field is visually identified by a light grey border that shows its position, size and lets users know where to click, tap, etc. The border color must have a contrast ratio greater that 3.00:1 against the adjacent white background.

Actual Result:

The light grey border (#ECECEC) against the adjacent white background (#FFFFFF) has a contrast ratio of 1.18:1, rendering it almost invisible (1.0:1).

HTML:
<input placeholder="Name, email, or phone number" autocapitalize="sentences" autocomplete="on" autocorrect="on" dir="auto" spellcheck="true" type="text" class="css-11aywtz r-tz77pi" value="" style="background-color: rgb(255, 255, 255);border-color: #ececec;border-radius: 8px;border-width: 1px;color: rgb(11, 27, 52);font-family: GTAmericaExp-Regular;font-size: 15px;height: 42px;padding: 10px 12px;vertical-align: middle;">

CSS:
element.style { background-color: rgb(255, 255, 255); border-color: #ececec; ... }

Other occurrences:

  1. The grey circle for custom checkboxes adjacent to contact names in the panel has the same color contrast ratio.
  2. Chat:
  • Search panel search field
  • Emoji panel search field
  • Chat Message field

Workaround:

No workaround

Area issue was found in:

Create new group overlay, Chat page

Failed WCAG checkpoints

1.4.11

User impact:

Many colorblind and other sight impaired users will not identify the area as a control and may not know where to click.

Suggested resolution:

Use a darker shade of grey for the border color, such as #919191, which will give a color contrast ratio of 3.15:1.

Platform:

Where is this issue occurring?

  • Web

Version Number:
**Reproducible in staging?:**Yes
Reproducible in production?:
Notes/Photos/Videos: Any additional supporting documentation
Issue reported by:
Bug5183162_Color_Contrast-Chat-Input_field_grey_border_against_adjacent_white_fails_contrast-Emoji
Bug5183162_Color_Contrast-Chat-Input_field_grey_border_against_adjacent_white_fails_contrast-Message_entry
Bug5183162_Color_Contrast-Chat-Input_field_grey_border_against_adjacent_white_fails_contrast-Search
Bug5183162_Color_Contrast-Create_New_Group-Custom_Checkbox_grey_border_against_adjacent_white_fails_contrast
Bug5183162_Color_Contrast-Create_New_Group-Input_field_grey_border_against_adjacent_white_fails_contrast

View all open jobs on GitHub

@ogumen ogumen added this to the Accessibility Audit milestone Sep 24, 2021
@shawnborton
Copy link
Contributor

Let's also add checkboxes to the list of inputs to update:
image

@shawnborton
Copy link
Contributor

@ogumen what is the minimum contrast ratio that we need here?

@flodnv
Copy link
Contributor

flodnv commented Sep 27, 2021

This should be as easy as just changing the border color to a new one, let's see if someone external will do this.

@flodnv flodnv added the External Added to denote the issue can be worked on by a contributor label Sep 27, 2021
@MelvinBot
Copy link

Triggered auto assignment to @kadiealexander (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@MelvinBot MelvinBot added the Daily KSv2 label Sep 27, 2021
@ogumen
Copy link
Author

ogumen commented Sep 27, 2021

@ogumen what is the minimum contrast ratio that we need here?

@shawnborton The minimum contrast ratio of the UI components should be at least 3.00:1.

@PrashantMangukiya
Copy link
Contributor

Proposed Solution

I did brief research on how border color applied to ui element. i.e. We have border: colors.gray2 within
src/styles/themes/default.js file that suppose to use for border to any ui element.

So we expect to change border: #919191 i.e. dark color. But as soon as we change border color it have side effect many places within ui because border is used as selected list color also as shown below screenshot.
Screenshot 2021-09-27 at 7 45 24 PM

As we need dark border for some input component. So we can go with this approach also. i.e. within src/styles/colors.js add one more color e.g. gray5: '#919191' and within src/styles/themes/default.js file add borderDark: colors.gray5 and thereafter we can apply borderDark to ui input component we need.

Other way is to update grey color to border: colors.gray2 --> border: colors.gray5 and correct correct color from selected list etc. where border is used. Not sure at present how many places border is used that suppose to not.

I think we can discuss and figure out which way is better to go with.

@shawnborton
Copy link
Contributor

Yeah I think the solution is as simple as just changing out the border color we use to a darker shade. That being said, I do think @Expensify/design should take a look at these accessibility issues altogether and chat about them quickly internally to make sure we are finding the right new colors to use in these situations. Going to assign to myself for now.

@shawnborton shawnborton self-assigned this Sep 27, 2021
@shawnborton shawnborton added Weekly KSv2 Design and removed Daily KSv2 External Added to denote the issue can be worked on by a contributor labels Sep 27, 2021
@Beamanator Beamanator self-assigned this Sep 28, 2021
@shawnborton
Copy link
Contributor

Started a conversation over in #accessibility about this

@shawnborton
Copy link
Contributor

shawnborton commented Sep 30, 2021

Okay so what I would recommend doing here... in colors.js we can modify our grays a bit:

    gray4: '#7D8B8F',

change that to

    gray4: '#8B979A',
    gray5: '#6B7880',

Then from there, you will want to make sure the border color in themes/default.js uses gray4. (updated here)

Bonus points if you want to update the supporting text/label color issue, which you could just update textSupporting to gray5

Bonus points if you want to tackle the icon color issue here too, which you could just update icon to use gray4 and it will pass contrast tests.

Let me know how all of that sounds!

@Beamanator Beamanator added the External Added to denote the issue can be worked on by a contributor label Sep 30, 2021
@MelvinBot
Copy link

Triggered auto assignment to @stephanieelliott (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@MelvinBot MelvinBot added Daily KSv2 and removed Weekly KSv2 labels Sep 30, 2021
@Beamanator
Copy link
Contributor

Adding External again since it looks like we're opening up to proposals again!

@PrashantMangukiya
Copy link
Contributor

Hi @shawnborton, I did quick test. i.e. within colors.js set gray4: '#8B979A' and within themes/default.js set border: colors.gray4 It looks like that border used in many components. e.g. within LHN also border color used as selected record.

I think we need to decide strategy how to approach this, because if we set border: colors.gray4 then it will affect many component look and feel as shown below screenshot.

Screenshot 2021-09-30 at 6 23 08 PM

At present trying to figure out best approach, finger crossed.

@shawnborton
Copy link
Contributor

Good points in the above.

That being said, the hover style for the chat row seems wrong - that should not be using the same color as borders, we have a specific variable for that: activeComponentBG: colors.gray2,

I think what I would recommend then is that we have two separate border variables in themes/default.js:

  • componentBorder - this is the border used for all UI components like inputs, etc. It uses gray4
  • accentBorder - this is the border used for things like the right edge of the chats list, the bottom border on the chat header area, as well as the small bar next to the + in the compose box.

@PrashantMangukiya
Copy link
Contributor

Temporary I set border: '#ff0000' i.e. red within themes/default.js to get the idea how many components using the border props from default.

Below are some screenshot that shows usage of border props from default.js, (this is not all list) but gives idea how many components need to update border props etc. Just sharing so it will help us during discussion.

Screenshot 2021-09-30 at 8 38 17 PM

Screenshot 2021-09-30 at 8 38 24 PM

Screenshot 2021-09-30 at 8 38 44 PM

Screenshot 2021-09-30 at 8 38 54 PM

Screenshot 2021-09-30 at 8 39 37 PM

@MelvinBot MelvinBot removed the Overdue label Oct 6, 2021
@shawnborton shawnborton removed their assignment Oct 7, 2021
@Beamanator
Copy link
Contributor

@PrashantMangukiya are you still interested in working on this issue? If so, can you submit an updated proposal?

@MelvinBot MelvinBot removed the Overdue label Oct 11, 2021
@PrashantMangukiya
Copy link
Contributor

@Beamanator thanks for the message. At present I am not ready to work on this issue. So it will be ok to handover others. Thanks.

@Beamanator
Copy link
Contributor

Thanks for the heads up @PrashantMangukiya !

@mateomorris
Copy link
Contributor

mateomorris commented Oct 11, 2021

Proposal

  • In colors.js: Change gray4 to #8B979A and add gray5: '#6B7880'

In default.js:

In styles.js: update sidebarLinkActive.backgroundColor from backgroundColor: themeColors.border to backgroundColor: themeColors.activeComponentBG

In styles.js, getReportActionContextMenuStyles.js, and getModalStyles, change every instance of themeColors.border to themeColors.accentBorder

Then in styles.js we can change all the inputs, dropdowns, and checkboxes to use themeColors.componentBorder:

  • expensiTextInputContainer
  • textInput
  • expensiPickerContainer
  • chatItemComposeBoxColor
  • textInputCompose
  • selectCircle
  • checkboxContainer

image

image

image

@MelvinBot MelvinBot added Weekly KSv2 Help Wanted Apply this label when an issue is open to proposals by contributors and removed Daily KSv2 labels Oct 12, 2021
@stephanieelliott
Copy link
Contributor

This is on Upwork here: https://www.upwork.com/jobs/~019b45fec6e1a6cdcc

@Beamanator
Copy link
Contributor

@mateomorris I think your proposal looks fantastic! I'll assign this to you, please feel free to submit a PR when you have a chance :)

@MelvinBot MelvinBot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 12, 2021
@parasharrajat
Copy link
Member

parasharrajat commented Oct 13, 2021

There is nothing much to review in the code, it's mostly about swapping the variable with correct values. So I would leave this to the CME to review. See More. cc: @Beamanator

Thanks.

@Beamanator
Copy link
Contributor

Sounds good, thanks for the heads up @parasharrajat 💪

@stephanieelliott
Copy link
Contributor

Hired on Upwork, thanks @mateomorris!

@Beamanator
Copy link
Contributor

Still under discussion in slack internally here

@MelvinBot MelvinBot removed the Overdue label Oct 22, 2021
@shawnborton
Copy link
Contributor

As discussed here, we're going to close the PR but we want to make sure @mateomorris gets paid for his work. @stephanieelliott can you go ahead and make sure Mateo gets paid and then we can close this one out? Thanks!

@stephanieelliott
Copy link
Contributor

Hey @mateomorris looks like you never accepted the offer we sent for this job. Will you accept in Upwork (should be able to find it here), then let me know so I can issue payment? Thanks!

@mateomorris
Copy link
Contributor

Thanks @stephanieelliott! Accepted

@stephanieelliott
Copy link
Contributor

All set and paid in Upwork. Thanks @mateomorris!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests

10 participants