Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Gauravmahlawat created an issue. See original summary.

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

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

mherchel’s picture

Category: Support request » Bug report
Priority: Normal » Minor
Issue tags: +Accessibility

The current contrast ratio on hover is 4.15. This is less than the 4.5 that WCAG mandates. But, I'm not sure if that applies on hover. I'd love for someone with more knowledge on this to jump in.

bnjmnm’s picture

FileSize
263.55 KB

It is necessary to adhere to contrast requirements on hover, but there's a potential simple solution as what you have is absurdly close to meeting the specification already.

If the button font size was bumped from font-size: 1.125rem to 1.167rem, this can unambiguously pass requirements as it would make the font 14pt, which at bold qualifies as large scale. That means it would only need the 3:1 minimum contrast requirement. This is basically bumping it from 18px to 18.667 px.

As you can see it's not a particularly noticeable change, but one that contrast checking tools will certainly notice. Tweaking the padding could even keep the button at the same size if that's a priority.

If this sounds like an acceptable solution, cool! If there are concerns we can explore other stuff.

xjm’s picture

Priority: Minor » Major

Definitely major as this is explicitly part of the core gate.

xjm’s picture

Issue tags: +Olivero stable blocker

This is a stable blocker.

mherchel’s picture

Discussed this at last night's core accessibility meeting.

@andrewmacpherson said he would prefer to keep the contrast above 4.5 (as opposed to adjusting the font-size, which would be technically compliant). He said the easiest solution is simply to remove the hover state.

mherchel’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
1.42 KB

Went over this with @jwitkowski79. We agreed that we should have a hover state. However the --color--blue-20 was the darkest shade of blue that we have defined and the only that passes the 4.5 contrast ratio.

So, we created a new variable: --color--blue-10: #0f6292;, and use that.

mherchel’s picture

This patch also updates the border color on hover so it corresponds with the background color.

Tugboat preview at https://3211616-button-hover-2-5bosyggdwlylc4ej0ez5dnxekmphlqoz.tugboat.qa/

mherchel’s picture

Accidentally attached the same patch twice.

rikki_iki’s picture

Status: Needs review » Reviewed & tested by the community

New colour has contrast of 6.59 and shows a visible hover effect. Marking RTBC.

jwitkowski79’s picture

@mherchel: The button hover looks good and is implemented correctly based on our discussion

ckrina’s picture

I've just reviewed and it's working as expected:

The colors are applied as expected with the desired contrast, and the code looks fine too.

lauriii’s picture

Posted before and after screenshots.

mherchel’s picture

  • lauriii committed 672b00f on 9.3.x
    Issue #3211616 by mherchel, Gauravmahlawat, lauriii, bnjmnm, ckrina, xjm...
lauriii’s picture

Version: 9.3.x-dev » 9.2.x-dev
Status: Reviewed & tested by the community » Fixed

Committed 5683c33 and pushed to 9.3.x. Also cherry-picked to 9.2.x because Olivero is experimental. Thanks!

  • lauriii committed a3034ec on 9.2.x
    Issue #3211616 by mherchel, Gauravmahlawat, lauriii, bnjmnm, ckrina, xjm...

Status: Fixed » Closed (fixed)

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