When in high contrast mode, the toolbar icons should adapt to the theme.

Comments

mherchel created an issue. See original summary.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

mgifford’s picture

kentr’s picture

Claro has overrides for these. If they are only fixed in the toolbar module, the changes won't appear in Claro.

Perhaps the correct solution involves removing the Claro overrides.

kentr’s picture

StatusFileSize
new49.26 KB

Some of the icons also need attention for the "pressed" and / or "active link" states. Here's a screenshot.

@cwilcox808 said this RE forced-colors styling for the "pressed" state of the buttons:

For aria-pressed="true", you could maybe set border-color: Highlight;, buttons in that state wouldn't have a visual change on hover but focused buttons would still have the addition of the outline.

libbna’s picture

Hi,
I was able to reproduce the issue locally by switching to forced colors mode. In comment #6, @kentr suggested removing the Claro overrides. However, I had a follow-up question: if we remove those overrides, do we have alternative images or icons to use in their place? If not, what would we be replacing them with?

Would appreciate some clarification before proceeding. Thanks!

kentr’s picture

@libbna

In comment #6, @kentr suggested removing the Claro overrides. However, I had a follow-up question: if we remove those overrides, do we have alternative images or icons to use in their place? If not, what would we be replacing them with?

Now that Gin will replace Claro, I'd say disregard my suggestion in #6.

But just to clarify the thought behind it: I was suggesting removing the Claro overrides for these particular icons altogether so that the icons won't go back to being broken when the admin theme is Claro (i.e., with the Standard installation profile).

libbna’s picture

@kentr thanks for clarification but now how can we resolve this issue? Now that claro is being replaced, I guess we can replace the overrides too. No?

kentr’s picture

@libbna,

My thinking is that fixing the icons in the Toolbar module will still resolve the issue in any theme that doesn't override them.

Olivero doesn't AFAIK, so the changes will take effect on non-admin pages by default. And for Drupal CMS admin pages, the change will also appear there if Gin doesn't override the icons.

If there's a need to resolve the problem for Claro, it can be a separate issue that's specific to Claro.

kentr’s picture

I just learned that Gin inherits a lot of Claro code: #3530849: [META] Gin 6.x: Preparation for merging into core.

So, limiting this change to the Toolbar module may not solve the problem in Gin (if it exists at all). But I'm guessing that any change to Claro libraries for #3530849: [META] Gin 6.x: Preparation for merging into core is best done specifically as part of that effort so that it can be analyzed beforehand.

kentr’s picture

I incorrectly assumed that when not in Claro, the toolbar styles are provided by the Toolbar module.

It turns out that Claro overrides the toolbar styles even when it's not the default theme: #3070493: Introduce a mechanism to provide an alternate Claro design for the toolbar in the future.

If Claro is the admin theme and Olivero (or a random other theme) is the default theme, Claro will dictate the toolbar styles for the default theme also.

So, it looks like we do have to change both the Toolbar module and Claro for this issue.

kentr’s picture

Adding a suggestion:

#3090120: Improve accessibility semantics for Toolbar buttons with trays will hopefully result in the role="button" added by JavaScript instead of it being present in the initial markup.

If that issue lands before this is completed, it would be great to include here some CSS rule(s) based on role="button" that will set the system-color of toolbar buttons to ButtonText after they are processed by JavaScript.

Something along these lines:

@media (forced-colors: active) {
  .toolbar .toolbar-item[role="button"] {
    color: buttontext;
  }
  .toolbar .toolbar-item[role="button"]::before {
    /* Assuming background images are converted to mask images. */
    background-color: buttontext;
  }
}

There's related discussion here.

I do not recommend letting #3090120: Improve accessibility semantics for Toolbar buttons with trays block this issue, though.

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.

quietone’s picture

Status: Active » Postponed

The Toolbar Module was approved for removal in #3476882: [Policy] Move Toolbar module to contrib.

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 #3484850: [meta] Tasks to deprecate Toolbar module and the removal work in #3488828: [meta] Tasks to remove Toolbar module.

Toolbar will be moved to a contributed project before Drupal 12.0.0 is released.

quietone’s picture

Project: Drupal core » Toolbar
Version: main » 1.x-dev
Component: toolbar.module » Code
Status: Postponed » Active

Toolbar has moved to contrib