Problem/Motivation
- The border of the contextual link button is rather light, in particular in light mode, where the background of the page is also white. The pencil icon appears on hover, but it still requires some cognitive effort to process that there is a button and that this button is clickable (See the table in https://docs.google.com/spreadsheets/d/1won35PxhRFexJYE8FmZ4DCNTo7xEAxC8... or contextual_links.xlsx.zip for more details).
- The label for the contextual link is redundant and missing a context most of the time. For example on the frontpage in Olivero for Drupal CMS you have in the rotor in VoiceOver eight entries with
Open configuration options, toggle button, two entries withOpen latest configuration options, toggle button, and three entries that provide a specific context:Open Primary tabs configuration options, toggle button,A celebration of Drupal and open-source contributions configuration options, toggle button, andOpen footer configuration options, toggle button. - In Forced Colors mode the contextual link buttons have no pen icon on hover, neither in Gin nor in Olivero. [#Icons are invisible]


Discussed and iterated on the issue with @mgifford, @the_g_bomb, @katannshaw, and @drupa11y
Steps to reproduce
- Check the contextual link buttons on either
admin/content/media-gridor on the frontpage in Olivero. For testing the issue in Forced Colors mode make sure that you’ve switched to dark mode before.
Proposed resolution
- Increase the color contrast for the border in light mode so it meets 3:1, so the button gets a higher affordance and gets easier noticed. Same for the dark mode, due to the thin border, the border looks kind of jagged (not sure if that is the right term in english) - it is simply not a clearly recognizable button.
- Add context to the button label for screenreader users.
- Consider showing the contextual button in the context of layout builder all the time: https://www.drupal.org/project/drupal/issues/3037742
- Ensure that the pen icon is shown in Forced Colors mode on hover (related to [#Several icons and images are invisible in Forced Colors mode])
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| contextual_link_light_mode.jpg | 20.25 KB | rkoller | |
| contextual_link_dark_mode.jpg | 18.63 KB | rkoller | |
| contextual_link_fcm.jpg | 21 KB | rkoller | |
| contextual_links.xlsx_.zip | 10.12 KB | rkoller |
Comments
Comment #2
rkollerComment #3
mgiffordOk, lets minimize the SVG and have it use the ButtonFace so it is more easily customizable
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="ButtonFace" d="M14.6 3 13 1.4a1 1 0 0 0-1.4 0l-1.3 1.4 3 3 1.2-1.3a1 1 0 0 0 0-1.4M5.2 13.6l-3-3 7-7 3 3zm-4.3 1c0 .3 0 .5.3.4l2-.7-1.6-1.6z"/></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path stroke="ButtonFace" stroke-width="3" d="m2.3 2.3 11.4 11.4m-11.4 0L13.7 2.3"/></svg>I think there will be better ways to do this, but just looking at the issue of the forced colors mode
There is some JS which is is hiding edit pen when the mouse isn't hovering over the form:
<form class="views-exposed-form" aria-label="Filter the contents of the Media view" data-drupal-selector="views-exposed-form-media-library-page" action="/admin/content/media-grid" method="get" id="views-exposed-form-media-library-page" accept-charset="UTF-8" data-once="exposed-form">It converts this:
to this:
<button class="trigger focusable" type="button" aria-pressed="false">Open configuration options</button>But it doesn't trigger for keyboard users (focus).
It should always be visible, especially in a high contrast mode.
Comment #4
mgiffordThis CSS is an issue in both Gin & Claro, so this isn't a Gin specific issue. The CSS works reasonably well in both.
Comment #5
mgiffordThis occurs in the media system, but not sure it is restricted to it.
Comment #6
quietone commentedIn Drupal core changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies. Thanks
Comment #8
kentr commentedIf I understand correctly, I'm inclined to say that this is a Gin / Default Admin issue.
The icon originates from the contextual module, but AFAICT it's (currently) overridden by Default Admin in
contextual_links.css.I think it's likely that the theme's dark mode will need an override by itself even if the light mode version is unified somehow.
Postponing based on #3582351: [Meta] Clean up CSS until the CSS restructure / refactor is done.
Comment #9
mgiffordI thought about moving this back to the Gin theme and then copying it so that it is also part of Core (and linking them), but just making it more visible for the Admin theme queue.
Leaving it in #3506302: [Meta] Improve the accessibility of the Gin theme
I also wonder if deleting CSS might be acceptable in the CSS cleanup.
Comment #10
kentr commented