Problem/Motivation

Followup for #2409559: User should be able to identify required fields from field listing. The issue introduced a few problems in regard to WCAG compliance - for the full usability review see #2409559-40: User should be able to identify required fields from field listing. The problems are:

  • The color (--color-gray-600 - #828388) used on the machine name and secondary text against the white background (#ffffff) results in a color contrast of 3.8:1. To comply with WCAG2.2 SC1.4.3 a color contrast of at least 4.5:1 is required.
  • The border color for the pill (--color-gray-300 - #c1c2c7) against the white background (#fff) has a color contrast of only 1.8:1. It is not a focusable interface component a user is directly interacting with, it only has an informational purpose, but the pill styling is there for a reason, to distinguish it from the machine name - so it is considered a meaningful graphic (*at a later date I've discussed the matter with @katannshaw). In consequence, to make sure that those pill components are recognizable, the contrast would have to be at least 3:1.

Steps to reproduce

Go to to a field list for a content type, for example admin/structure/types/manage/article/fields

Proposed resolution

  • Increase the color contrast for the machine name and the secondary text on the field type column to at least 4.5:1. The first shade of grey that would meet that requirement would be --color-gray-700 with #75767b.
  • Increase the color contrast for the pill border to at least 3:1. The first shade of grey that would meet that requirement would be --color-gray-500 with #919297.

Remaining tasks

User interface changes

Before
field list on the article content type

After
field list on the article content type

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3566280

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rkoller created an issue. See original summary.

rkoller’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new60.27 KB
new60.81 KB

A quick preliminary improvement until #3566810: Move the additional attributes in the field column on the field listings page to dedicate columns is getting worked on. I've used the lightest possible shade of grey that meets the minimum color contrast required. As outlined in the proposed resolution the secondary text color got changed from --color-gray-600 to --color-gray-700 to get to a color contrast of 4.5:1 against the white background. And the pill border changed from --color-gray-300 to --color-gray-500 to get the pill border to a color contrast of 3.1:1 against the white background.

PHPStan unit testes failed. but due to the fact that this is a css only change i am uncertain if that is related. css linting tests passed. so i set the issue to needs review.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative
StatusFileSize
new138.75 KB
new144.44 KB

Put my old 508 accessibility hat on

Without the patch I get this results

fail

With the patch

after

It passes AA which I believe is the requirement. Don't believe AAA is on the radar right now.

LGTM.

rkoller’s picture

yep it passes AA with the MR applied which was the goal. for AAA you would need 7:1 instead of 4.5:1. and for AAA you would also need 4.5:1 for the border of the pill. this MR is solely about AA. and that is what it does, changing the contrast for the secondary text from 3.8:1 to 4.5:1 and the contrast of the pil border from 1.8:1 to 3.1:1 - both the required minimum for AA

update: oh apologies. completely misread your comment :D i need more sleep.thank you for the review. (and eyes that work normally where i am able to read thoroughly and focused)

nod_ made their first commit to this issue’s fork.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

longwave’s picture

Version: main » 11.3.x-dev
Status: Reviewed & tested by the community » Fixed

Backported down to 11.3.x as an eligible bug fix. Doesn't apply cleanly to 10.6.x, if anyone feels strongly about backporting please open a new MR. Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • longwave committed 2738e006 on 11.3.x
    fix: #3566280 Color contrast issues on the field listings page
    
    By:...

  • longwave committed da199162 on 11.x
    fix: #3566280 Color contrast issues on the field listings page
    
    By:...

  • longwave committed 87c4b646 on main
    fix: #3566280 Color contrast issues on the field listings page
    
    By:...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.