Problem/Motivation

Accessibility Insights report:

Element has insufficient color contrast of 2.55 (foreground color: #111111, background color: #545560, font size: 11.3pt (15.04px), font weight: normal). Expected contrast ratio of 4.5:1

Use background color: #7e7f90 and the original foreground color: #111111 to meet a contrast ratio of 4.79:1.

Snippet:

<a href="#main-content" class="visually-hidden focusable skip-link"> Skip to main content </a>

I didn't check against Gin.

WCAG: SC 1.4.3 Contrast (Minimum) (Level AA)

Steps to reproduce

  • Log in as admin.
  • Go to /admin/appearance.
  • Set Default Admin as the admin theme.
  • If it's not already appearing in dark mode, go to /admin/appearance/settings/default_admin, change "Appearance" to "Dark", and submit the form.
  • Press the TAB key until the skip link becomes focused and visible.
Expected

The text / background has sufficient contrast.

Actual

It has low contrast.

screenshot

Proposed resolution

Not sure.

The light mode skip link has a dark background with light text.

Maybe this one should have the opposite: light background with dark text.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3621109

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

kentr created an issue. See original summary.

kentr’s picture

Title: Dark mode skip link has too low color contrast » Dark mode skip link has low color contrast
kentr’s picture

Title: Dark mode skip link has low color contrast » Skip link in dark mode has low color contrast
Issue summary: View changes
rupeshghar’s picture

StatusFileSize
new114.73 KB
new114.93 KB
new1.65 KB

Corrected css rule which was affecting skip link color override. Please review patch and test.

AI-Generated: Yes (Used Claude to help generate the patch and reviewed/tested the output before submitting).
I had not read the policy and had reviewed the output but missed out on disclosure - will ensure to share this info from next time.

kentr’s picture

@rupeshghar thank you for your contribution.

Was the patch generated with an LLM? Please note that disclosure is required: Policy on the use of AI when contributing to Drupal.

kentr’s picture

Also, we don't use patches anymore. It needs to be in a merge request.

rupeshghar’s picture

Status: Active » Needs review

@kentr I have updated the previous comment and mention the usage of the AI but also have done the human review. the disclosure was missing which I will take care from next time.
I've also created an MR for this. Thanks

smustgrave’s picture

Status: Needs review » Needs work

MR has a pipeline issue that needs to be resolved first. And solution is adding back gin

mgifford’s picture

Why does the MR (or patch) still refer to Gin?

mherchel’s picture

Yeah, the MR doesn't look right. We should be using one of the semantic variables in https://www.drupal.org/docs/core-modules-and-themes/core-themes/default-... instead of using a .dark-mode class (which will eventually be phased out). We should also probably add in a border (using a semantic color variable).

mherchel’s picture

Jumping in here since we're evidently under a tight deadline to get to beta

mherchel’s picture

Status: Needs work » Needs review

This should be good to go.

smustgrave’s picture

Status: Needs review » Needs work

Background looks much better but the text is also white so can't see the words.

mherchel’s picture

Status: Needs work » Needs review

Fixed!

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Worked like a charm.

catch’s picture

This could use an 'after' screenshot.

smustgrave’s picture

StatusFileSize
new13.64 KB

@catch

after

  • catch committed 40967295 on 11.4.x
    fix: #3621109 Skip link in dark mode has low color contrast
    
    By: kentr...

  • catch committed bfd8d4f2 on 11.x
    fix: #3621109 Skip link in dark mode has low color contrast
    
    By: kentr...

  • catch committed 254a60c7 on main
    fix: #3621109 Skip link in dark mode has low color contrast
    
    By: kentr...
catch’s picture

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

Committed/pushed to main, 11.x and 11.4.x, 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.