Problem/Motivation

Followup for #3438477: High contrast mode needs some more refinement

In regular mode the Skip to main content link has a clearly visible focus outline plus the background has a dark gray background inverting the regular white background making the skip link a clearly discernible element in focus:

the skip to main content link in regular mode

In forced color mode the Skip to main content link has the same black background as the page plus it is missing a visible focus outline - the skip to element is barely recognizable that it is showing up nor that it is in focus in the first place.

the skip to main content link in forced color mode

Steps to reproduce

@mherchel provided a video how to activate the forced color mode in chromium based browsers like chrome or edge: https://www.youtube.com/watch?v=v4dTY4__F6U . after activating forced color mode simply press the tab key on for example admin/content

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3565271

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
rkoller’s picture

Title: The skip to main content link is missing a visible focus outline » The skip to main content link is missing a visible focus outline in forced color mode
Issue tags: +forced colors
mgifford’s picture

Thanks for testing in forced colors mode @rkoller it often gets missed and is often quite easy to ensure is supported.

avani.bhut made their first commit to this issue’s fork.

avanibhut2706’s picture

StatusFileSize
new5.61 KB

@rkoller I’ve opened a merge request for this : https://git.drupalcode.org/project/drupal/-/merge_requests/14245

The update improves the visibility of the “Skip to main content” link in dark and forced-color modes. I’ve also added screenshots for reference.
Please review and let me know if any changes are needed.

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.

avanibhut2706’s picture

Status: Active » Needs review
dcam’s picture

Olivero has the exact same problem. Just my opinion, but I think the scope should be expanded to include it too. But for what it's worth, the MR worked as advertised for Claro.

rkoller’s picture

Status: Needs review » Needs work
StatusFileSize
new29.93 KB
new30.97 KB
new25.05 KB

at first apologies @avanibhut2706 for the late reply, the notification for this issue slipped through. :( and thank you for working on the MR! I've taken a look at MR14245, a few observations:

Looking at the screenshot in #7 the newly darkish "dirty" outline color makes me wonder what settings are you using in the render tab in chrome or edge? is it possible that you have checked the "enable automatic dark mode" checkbox? that causes some odd color display. it is necessary to either:

  • leave the "enable automatic dark mode" checkbox unticked, choose prefers-color-scheme: dark on the emulate CSS media feature prefers-color-scheme, forced -color:active on emulate CSS media feature forced-colors and prefers-contrast:more on Emulate CSS medai feature prefers-contras
  • or within the edge settings (in chrome i am not sure if those exist) go to Appearance and within the Page colors section choose one of the themes in the page colors select.

I went with the first approach for testing and get:

the header of the content list page with the skip to main content link in focus in forced color mode

that way it doesnt really look like an outline but rather sort of a background color plus it uses a different system color than for the focus (check out mr-skip.mp4). from my perspective it would be enough to simply show the focus outline in the system color of blue with the same width like for the rest of the focusable items.

re @dcam good point. i thought i would have already created a dedicated issue for olivero but after rechecking i have not. so yeah that needs the visible focus outline as well thank you! and yeah that could happen within this issue as well, no objection. except olivero probably needs some additional thought and adjustments. for one in olivero the skip link spans across the entire horizontal viewport as a black bar in regular mode. that is probably not necessary in forced color mode and the visual presentation of the skip link could be handled like in claro, after the bar isnt visible anyway. the only problem that needs also some adjustment in general is the position of the skip to link on user profile pages:

the user profile page in forced color mode with the focus on the skip to main content link shifted underneath the top bar

rkoller’s picture

oh and one more thing. while reviewing i've already noticed a few regressions in forced color mode in general since i last worked on #3438477: High contrast mode needs some more refinement that recently got in. none of those were related to the skip link. so i was worried recent commits had introduced already regressions (but i havent looked at the diff itself only did an initial manual test). so after finishing my comment ive checked out the main branch and i wanted to dig in when those regressions got introduced but they were gone again. so i looked a bit closer at the diff of this MR and it looks like the scope is a bit broad and it is breaking many other elements on the page in forced color mode:

@media (forced-colors: active) {
    border: solid 1px transparent;
    background: linktext;
}
quietone’s picture

Status: Needs work » Postponed

The Claro theme was approved for removal in #3576460: [policy, no patch] Deprecate and remove Claro.

This is Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.

The deprecation work is in #3576668: [meta] Tasks to deprecate Claro and the removal work in #3584638: [meta] Tasks to remove the Claro theme.

smustgrave’s picture

Project: Drupal core » Claro
Version: main » 3.0.x-dev
Component: Claro theme » Code
Status: Postponed » Needs work

Claro has moved to contrib