Creating issue from #1924112-5: Make sure tour toolbar button has :focus styling when tabbed to.

With the present look of the menu bar it is hard to see where you are as there is just a thin outline & link provided around the focused tab button.

I agree that often the browser doesn't do a very good job providing a visible outline of items on focus.

I recall though that the argument against specifically setting a bigger outline with Drupal forms in D7 was that this was something best managed by the browser itself. That if outlines aren't sufficiently highlighted in FF or Chrome then they should be fixed there rather than in the CMS.

Something like a different background color would be great, but right now there is also an underline & an outline in my tests so not sure how critical this is.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dcmouyard’s picture

Unless the focused state has been specifically designed, I usually just apply the same styling to :focus and :hover.

mgifford’s picture

@dcmouyard Agreed about :focus :hover generally being the same. Do you think that there needs to be either a more distinct outline or color difference in the menu buttons however?

mgifford’s picture

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

This should do the trick... It would have been so nice to have SASS or LESS for this, but...

mgifford’s picture

Realized that there was no reason to adjust the handle (as it doesn't show when you don't use your mouse), so back to:

.toolbar .toolbar-handle:hover {
  cursor: pointer;
}
mgifford’s picture

FileSize
24.01 KB
27.24 KB

screenshots with patch.

Top focus:
Top focus

Bottom focus:
Bottom Focus

mgifford’s picture

Issue tags: +Novice

This should be an easy patch to review for a novice.

liquid06’s picture

I'm a first-timer at the Austin sprint. I'll try reviewing this patch :)

liquid06’s picture

Patch applies cleanly, and this looks like it works well for improving the focus state by matching the hover state. In some browsers there's an outline, but when that's not present, the underline differentiates your location.

Here's some screenshots (all ubuntu):

opera, showing blue outline and underline

firefox, showing underline and dotted outline

chrome, showing underline and black outline

cilefen’s picture

@liquid06: An even better way to display screenshots to get noticed is to embed them in the issue summary.

liquid06’s picture

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

Installed 8.x,
Applied adding-focus-1929010-4.patch
Confirmed that active and hover elements are separated on menu items.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed ac9286a and pushed to 8.x. Thanks!

  • Commit ac9286a on 8.x by alexpott:
    Issue #1929010 by mgifford: Fixed Improve Contrast for onfocus Menu...

Status: Fixed » Closed (fixed)

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