Problem/Motivation

I've opened that issue already over in the Gin queue: https://git.drupalcode.org/project/gin/-/work_items/3506311. Over the course of the last few days I was able to slowly catch up again after being out of the loop for the last few months except for my attendance in the weekly ux meetings.

The styling of primary and secondary local tasks in the Default Admin Theme has two main problems:

  1. Color contrast wise, it is not meeting WCAG2.2 SC1.4.11
  2. You have shapeshifting objects, which means the same objects, tabs in this case, that are looking completely different. Active primary tabs have a chip or button-like styling, while the non-active tabs are not visually connected; they are just connected by proximity. The secondary tab has a familiar design for tabs with a strong bottom border for the active secondary tab and a barely visible light thin bottom border connecting all the available secondary tabs.

That way the overall cognitive load is high:

the header of the default admin settings page in dark mode. the active primary local task with a chip layout and the secondary with a border at the bottom

A listing for the active primary local task, comparing the chip color against its background:

Blue:
light #dae3ff #fafaff 1.23:1 🚫
dark #353640 #1b1b1d 1.44:1 🚫

Light Blue
light #dde4f7 #fafaff 1.22:1 🚫
dark #33383f #1b1b1d 1.46:1 🚫

Dark Purple
light #e0d3f5 #faf8fd 1.35:1 🚫
dark #3e3440 #1b1b1d 1.44:1 🚫

Purple
light #e5d2ff #fcf8ff 1.33:1 🚫
dark #3e3140 #1b1b1d 1.41:1 🚫

Teal
light #d9e8e6 #f9fbfb 1.22:1 🚫
dark #2e3b3b #1b1b1d 1.48:1 🚫

Green
light #d8e7d9 #f9fbf8 1.23:1 🚫
dark #2f3a32 #1b1b1d 1.45:1 🚫

Pink
light #fadee5 #fffafa 1.22:1 🚫
dark #3f3139 #1b1b1d 1.41:1 🚫

Red
light #fbd9db #fff9f8 1.25:1 🚫
dark #3f3131 #1b1b1d 1.39:1 🚫

Orange
light #f7e1d9 #fffaf8 1.21:1 🚫
dark #3f332e #1b1b1d 1.42:1 🚫

Yellow
light #eee3d6 #fdfaf8 1.22:1 🚫
dark #3f372c #1b1b1d 1.46:1 🚫

Neutral
light #d5d5d5 #f7f7f7 1.37:1 🚫
dark #38383a #1b1b1d 1.47:1 🚫

Steps to reproduce

Go to /admin/appearance/settings/default_admin and switch between the light and dark mode and the available accent colors, and mind the visibility of the active primary local task.

Proposed resolution

Make sure that the chip for the active primary local task has a color contrast of at least 3:1 against the background in light and dark mode. The easiest fix might be to make the color of the chip for the active local task opaque instead of semi-transparent, while ensuring that the label of the chip has a color contrast of at least 4.5:1 against the background color of the chip for every accent color. Apply the chip styling for the active primary local task as well as the active secondary local task to remove the shapeshifting. @kentr came up with a mockup for tackling the shapeshifting in the context of #3590502: Move local tasks out of the more actions button into the content header on admin pages.

the header of the default admin settings page in dark mode. the active primary and secondary local task with a chip layout

Remaining tasks

Review

User interface changes

Just using one color to not overwhelm the summary

Before

After

3

Introduced terminology

NA

API changes

NA

Data model changes

NA

Release notes snippet

NA

Issue fork drupal-3636027

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

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

kentr changed the visibility of the branch 3636027-the-active-primary to hidden.

kentr’s picture

Assigned: Unassigned » kentr
kentr’s picture

Assigned: kentr » Unassigned
Status: Active » Needs review
StatusFileSize
new78.73 KB
new78.75 KB

Local task tabs and color mode selection control in light mode

Local task tabs and color mode selection control in dark mode

I used the color --admin-color-primary, which matches the blue border for an active vertical tab and the active Appearance setting.

It also matches buttons. If that's undesirable, then should be fixed in a follow up.

There is another color defined for the semantic "active" (--admin-color-primary-active), but it doesn't appear to be used anywhere. So, if the coloring for "active" is changed everywhere, probably best to set --admin-color-primary-active to the desired color and use the variable everywhere (in the followup).

The failing job (PHPStan) looks unrelated. In Slack @nicxvan said it's a known issue.

Some PHP tests didn't run, but CSS linting passed and this MR only has CSS changes so far.

kentr’s picture

Issue tags: +ai-ni

AI has not been intentionally used in the MR.

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

smustgrave’s picture

Rebased but 99% positive a CSS change didn't break phpstan.

But I tested without the MR and using colour contrast tool I see it passes?

smustgrave’s picture

Ignore those screenshots I grabbed them after the MR but when I went to grab the before I still got passing