This is a follow up from #2938194: Focus styles should meet accessibility guidelines in Umami theme

===
The coloured background of link focus in a sentence is a bit weak, and will not survive in Windows high contrast mode. An outline is preferable. outline-offset:1px can make it look a bit less crowded.
===

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

markconroy created an issue. See original summary.

mgifford’s picture

Issue tags: +keyboard focus

A screenshot would be nice.

smaz’s picture

markconroy’s picture

Issue summary: View changes
FileSize
62.18 KB

Hi @mikegifford,

Just checking in with you on this one. From my testing, we have outline styles left in place when people focus on a link. See here:
Umami link focussed state

When a use hovers on a link, we change from text-decoration: underline to text-decoration: none.

Is this enough to consider this issue fixed, or is there more you think we can achieve here?

markconroy’s picture

Issue tags: -dclondon +Nashville2018
markconroy’s picture

Status: Active » Needs work

It looks like we do have outline left in place, but it might be a nicer addition if we added outline-offset: 1px; to links, so they are less crowded when focussed.

Anyone feel like writing 1 line of css?

In core/profiles/demo_umami/themes/umami/css/base.css, change this:

a {
  color: #00836d;
  text-decoration: underline;
}
a:hover,
a:focus {
  background-color: #e6eee0;
  color: #444;
  text-decoration: none;
}

to this:

a {
  color: #00836d;
  text-decoration: underline;
}
a:hover,
a:focus {
  background-color: #e6eee0;
  color: #444;
  text-decoration: none;
  outline-offset: 1px;
}
dean-coakley’s picture

First time contributor.

Let me know what I did wrong @markconroy

I was unable to figure out how to give myself credit
EDIT: Looks like it worked

markconroy’s picture

Issue tags: +Novice

Hi Dean,

Thanks for very much for that, and welcome to Drupal contributing.

The code you have looks correct, but the patch you uploaded does not seem to be a patch file. It looks like it's a copy/paste of a git commit saved as a file with .patch at the end of it.

Here's a link to how to create a patch file - https://www.drupal.org/patch. I know it might seem like overkill for such a simple issue, but we try really hard to make sure we do things correctly - even on these novice issues - to make sure that you'll be able to do the same on more complex issues later.

Also, since we don't have regression testing built in for the frontend, it's helpful if you can provide a before and after screenshot. In this case, a screenshot of a link in a recipe/article body field, when it is normal, hovered, and focussed would be great.

If you can get that done, I'll review it again for you.

Thanks again.

swati.nuna’s picture

Hi,

I have added the patch file.
Please check.

markconroy’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
50.24 KB
50.79 KB
49.62 KB
50.07 KB

Thanks @swati.nuna,

This looks good to me. Marking as Reviewed and tested by the community (RTBC).

Committers - can you please make sure @deanc96 gets a credit for this issue as a first time contributor. Thanks.

Screenshots:
umami link current focus state
umami link current focus state

umami link focus state after patch
umami link focus state after patch

umami link current default state
umami link current default state

umami link current hovered state
umami link current hovered state

Status: Reviewed & tested by the community » Needs work
markconroy’s picture

Status: Needs work » Reviewed & tested by the community

Can this be committed?

The failing tests are false positives from the code being inside a media query.

lauriii’s picture

Title: coloured background of link focus in a sentence is a bit weak » Colored background of link focus in a sentence is a bit weak
Eli-T’s picture

kjay’s picture

On the basis this is RTBC'd for outline on focus being present and enhanced with an offset, this issue does seem good to go.

I tested across the browsers, including IE11 and up and it works as expected. We get the native browser outline on focus, though the effect of the offset seemed to have varying impact when subject to the browser's style of outline. Not a problem since offset is just an enhancement.

There is a consensus that link, hover, active and focus states need further design work in support of our accessibility goals and so we can follow that up in a separate issue but this one looks good to go to me.

  • lauriii committed daa1269 on 8.6.x
    Issue #2942490 by swati.nuna, deanc96, markconroy, Eli-T, kjay: Colored...
lauriii’s picture

Status: Reviewed & tested by the community » Fixed

Giving credit as well for @Eli-T for triaging the issue queue and @kjay for your feedback on the issue.

Committed daa1269 and pushed to 8.6.x. Also cherry-picked bcf7a53 and pushed to 8.5.x. Thanks! 🎉

  • lauriii committed 5673ed7 on 8.5.x
    Issue #2942490 by swati.nuna, deanc96, markconroy, Eli-T, kjay: Colored...
lauriii’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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