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.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | interdiff_3-10.txt | 631 bytes | kostyashupenko |
| #10 | 3219165-10.patch | 1.16 KB | kostyashupenko |
| #8 | active-styles.gif | 102.28 KB | ckrina |
| #5 | 3219165_after_screenshot.png | 89.69 KB | vikashsoni |
| #5 | 3219165_before_sceensot.png | 86.02 KB | vikashsoni |
Issue fork seven-3219165
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
Comment #2
kmonahan commentedComment #3
kmonahan commentedComment #4
kmonahan commentedComment #5
vikashsoni commented@kmonahan thanks for the patch
patch working fine and applying cleanly for me
Comment #6
msbtterswrth commentedReviewed and tested the patch today, works great! Thank you!
Comment #7
msbtterswrth commentedComment #8
ckrinaAdding "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-selectedis 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 definingtext-decoration: none;for.vertical-tabs__menu-item.is-selected a:focus .vertical-tabs__menu-item-title. So I would recommend to define both thecolorand thetext-decorationproperties with this same specificity.Moving it back to Needs Work for now.
Comment #9
ckrinaAdding some more info in the summary for context.
Comment #10
kostyashupenkoAs 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
Comment #11
ckrina@kostyashupenko I meant the underline and the color, but reviewing your patch I realized it only needed the
text-decorationproperty 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.Comment #12
lauriiiI'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.
Comment #13
ckrinaGood 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.
Comment #14
ckrinaI brought this issue into the Accessibility channel in slack and this was the feedback:
@mherchel
@mgifford
I would read this as a no need for the underline, as @lauriii suggests. Updating the issue summary accordingly.
Comment #17
longwaveThe 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.
Comment #18
avpadernoComment #19
avpadernoComment #20
avpadernoComment #22
avpadernoComment #23
avpadernoComment #26
avpadernoFor 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!