Problem/Motivation

Similar to the issue reported in https://www.drupal.org/project/drupal/issues/2930508, the contrast ratio between the text and background color on inactive tabs is 4.42. It's close, but should be 4.5 or higher.

Steps to reproduce

1. Log into Drupal with the Seven admin theme selected
2. Go to any page using vertical tabs, like /admin/structure/types/manage/article
3. Run an accessibility checker. Observe that the inactive tabs have insufficient contrast.

Proposed resolution

Adjust the background color to be a little lighter, increasing contrast.
The color #f5f4ef comes from comment #15 in the related issue #2930508: Inactive tabs do not meet WCAG AA 1.4.3 for contrast, where the conversion from the RGB to hexadecimals is done for the Tabs background color and passes WCAG AA.

Issue fork seven-3219165

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

kmonahan created an issue. See original summary.

kmonahan’s picture

Issue summary: View changes
kmonahan’s picture

StatusFileSize
new786 bytes
new102.61 KB
new107.87 KB
kmonahan’s picture

Status: Active » Needs review
vikashsoni’s picture

StatusFileSize
new86.02 KB
new89.69 KB

@kmonahan thanks for the patch
patch working fine and applying cleanly for me

msbtterswrth’s picture

Reviewed and tested the patch today, works great! Thank you!

msbtterswrth’s picture

Status: Needs review » Reviewed & tested by the community
ckrina’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs work
Issue tags: +WCAG 143
StatusFileSize
new102.28 KB

Adding "wcag143" per comment #56 by @mgifford in the related issue.

I've manually tested it and I've found a very small issue that should be addressed for UX sake. When clicking into another tab the color&underline don't change right away. You have to click outside the active tab to get the right styles. Here's a GIF with the behavior I'm finding both on FF and Chrome:

The JS correctly changes when the tab is switched (the class is-selected is correctly applied right away), but the styles do not apply. It means the state of an element & the specificity used are interfering here: if you take a look to line 79&79 it is defining text-decoration: none; for .vertical-tabs__menu-item.is-selected a:focus .vertical-tabs__menu-item-title. So I would recommend to define both the color and the text-decoration properties with this same specificity.

Moving it back to Needs Work for now.

ckrina’s picture

Issue summary: View changes

Adding some more info in the summary for context.

kostyashupenko’s picture

Status: Needs work » Needs review
StatusFileSize
new1.16 KB
new631 bytes

As i understood title of the selected tab should be immediately underlined -> this was done now
But not clear about color @ckrina, can you please re-test and tell what's remaining? If still there are feedbacks, can you please explain for which state of tab styles should be changed? Thanks

Right now as i see user can easily recognize visually when he is on hover/focus state no matter if tab active or not

ckrina’s picture

@kostyashupenko I meant the underline and the color, but reviewing your patch I realized it only needed the text-decoration property changed because color is behaving correctly: it keeps the lighter color because it's focused, not because styles do not apply. So just the underline change should be enough.

lauriii’s picture

I'm not sure proposed solution is correct. I don't think we need to underline the title because there's already non-color indicators that the vertical tab is open because the selected vertical tab doesn't have right border. I think it would be enough to just fix the color contrast issue here.

ckrina’s picture

Good point. I assumed the solution was OK based on the feedback given by @mgifford to the proposal in comment #42 in the related issue for horizontal tabs, but the component behaves different so it might be good to get a clear direction on the best approach form an Accessibility maintainer.

ckrina’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: -Needs issue summary update

I brought this issue into the Accessibility channel in slack and this was the feedback:

The tabs act as buttons not as links. IMO it’s not normal to underline active buttons. But I’ll defer to whatever the maintainers suggest

@mherchel

I agree that underlining text in buttons is not normal or expected. But making sure that the content still can be read and meets contrast requirements is.That and making sure that there is sufficient distinction between on/off focus states.

@mgifford

I would read this as a no need for the underline, as @lauriii suggests. Updating the issue summary accordingly.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.1.10 (June 4, 2021) and Drupal 9.2.10 (November 24, 2021) were the last bugfix releases of those minor version series. Drupal 9 bug reports should be targeted for the 9.3.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.4.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.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should 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.

longwave’s picture

Project: Drupal core » Seven
Version: 9.4.x-dev » 1.0.0-alpha1
Component: Seven theme » Code

The Seven theme has been removed from Drupal 10 core. I confirmed that this issue only affects Seven and no other themes included with Drupal core, so I am moving this to the contributed Seven project.

avpaderno’s picture

Version: 1.0.0-alpha1 » 1.0.x-dev
Issue tags: -Needs accessibility review
avpaderno’s picture

Title: Seven inactive vertical tabs do not meet contrast requirements » Inactive vertical tabs do not meet contrast requirements
avpaderno’s picture

avpaderno’s picture

Status: Needs work » Needs review
Issue tags: -Needs merge request, -Needs reroll
avpaderno’s picture

  • avpaderno committed 21541437 on 1.0.x
    Issue #3219165: Inactive vertical tabs do not meet contrast requirements
    

  • avpaderno committed facf9ef9 on 2.0.x
    Issue #3219165: Inactive vertical tabs do not meet contrast requirements
    
avpaderno’s picture

Status: Needs review » Fixed

For the background, I used a color the theme already uses, which gives a contrast of 4.53:1. I did not underline the text, as suggest in comment #14.

Thank you!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.