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

Updating form field borders for better contrast #13131

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

krisztin
Copy link

@krisztin krisztin commented Feb 7, 2025

What? Why?

Closes: #12846

Border colours on forms did not have sufficient contrast. New contrast ratio using $dark-grey #2E3132 passes WCAG AA for user interface components.

Note: on top of the border change I've refactored (adjusted) a few of the inputs as with the new border it was obvious there were some size and border radius differences.

Screenshots of the new UI on this branch

Inputs and tomselects
Inputs and Tomselects

Select2
ofn_select2

Tags
ofn_tags

What should we test?

  1. All versions of input fields i.e. text, number, time etc. - any form should do, found a textarea under /admin/general_settings/edit
  2. Tomselect fields - Go to /admin/orders, both Status and Shipping method are tomselects
  3. Select2 fields - Go to /admin/order_cycles, both Involving and Schedule are select2
  4. Tag fields - Go to /admin/order_cycles and edit an order, the Tag field is at the bottom
  5. Find any custom form inputs that I may have missed.

Release notes

Changelog Category (reviewers may add a label for the release notes):

  • User facing changes

Documentation updates

Form related content does not seem to exist on the Wiki. Suggest adding a wiki entry under Design for Design styleguide: forms

1. Border colour did not have sufficient contrast. New contrast ratio
passes WCAG AA for Graphical Objects and user interface components.

2. New border variable to aid consistency and future maintanance.
Inputs include custom made ones such as tags, select2s and tom selects.
Some border radii were using mixins but not utilising it, hence they
are now variables.
@RachL
Copy link
Contributor

RachL commented Feb 7, 2025

Niiiiiice 😍

@rioug rioug added the user facing changes Thes pull requests affect the user experience label Feb 10, 2025
@rioug rioug self-requested a review February 10, 2025 01:03
Tags' rules are still coming from the old admin styles hence had to add
the new (admin_v3) border variable to the old one.
Has a hard coded colour value of #2e3132 as it has no access
to the new colours.
Copy link
Member

@dacook dacook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks for working through this task! Code changes look good to me.

Personally, I find the borders look too dark, and make the screen very busy. So I had a look at the accessibility checker and found that the minimum contrast required for input borders was 3:1 (#2E3132). Maybe that would look better? Although the example given has a 2px border, while we use a 1px border.

In short, I'm not an expert and so will seek more feedback from testers!

Copy link
Collaborator

@rioug rioug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @krisztin 🙏

@mkllnk
Copy link
Member

mkllnk commented Feb 11, 2025

Personally, I find the borders look too dark, and make the screen very busy.

The screen is very busy. But I don't think that "hiding" the important input fields is the solution. I find this new version much clearer and I think that it's just a matter of getting used to the new borders.

I reckon that ten years ago there was a trend to make things more smooth, rounded, blending in and beautiful. But now people are actually figuring out that harsh contrast has its benefit, too. It may not look as beautiful but it's more practical.

@krisztin
Copy link
Author

@dacook I've used #2E3132 because that was the only shade of grey(black) in the current palette that passed contrast requirements. Also, it's generally not a good idea to keep introducing new colours as they:

  • bloat the CSS and makes it less maintainable
  • from a design perspective the more colours you use the less cohesive a site looks like (although I suppose very few users could spot the difference between shades of grey)

One thing to note is that we are a bunch of relatively young people here who still have good enough sight (hopefully) and hence could have a preference for more "smooth" designs. In your 40s your presbyopia (age related eye sight decline) will really kick into gear at which point you'll be happy for some contrast on the internet 😅️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user facing changes Thes pull requests affect the user experience
Projects
Status: Test Ready 🧪
Development

Successfully merging this pull request may close these issues.

Back office UX colour accessibility
5 participants