A11y requires that we have affordances for what is in focus but it does not mandate that we use the browser default focus style.

In many instances the browser default clashes with seven theme and toolbar in ways that are obtrusive and incongruous and in some cases actually impede usability.

One example: Button toolbar handle

toolbar

Something like this would be better:

better

Here's the CSS that I altered in inspector to get that.

button.toolbar-icon.toolbar-handle:focus {
  outline: none;
  border-bottom: 2px solid #66AAFF;
  background: #f5f5f5;
}

Vertical tabs and fieldsets are also a problem. I will follow up with images of those.

Comments

tkoleary’s picture

Issue summary: View changes
StatusFileSize
new55.17 KB
sqndr’s picture

Issue summary: View changes
tkoleary’s picture

Issue summary: View changes
StatusFileSize
new36.87 KB
tkoleary’s picture

Issue summary: View changes
tkoleary’s picture

Issue summary: View changes
tkoleary’s picture

Issue summary: View changes
tkoleary’s picture

Issue summary: View changes
tkoleary’s picture

Issue summary: View changes

@sqndr thx!

mgifford’s picture

Issue tags: +keyboard focus

That can add a really nice effect for sure.

sqndr’s picture

@tkoleary: I wanted to add the code as a code block but I was a little fast ;) Looks like a nice improvement!

sqndr’s picture

StatusFileSize
new40.87 KB

Even the Insert Image modal gets this outline (using Chrome, Mac)

lewisnyman’s picture

Issue tags: +frontend, +CSS
lewisnyman’s picture

I like this issue, I would rather we didn't use the bright blue border at the bottom though, only because it looks a bit weird when that section is expanded and we have used that elsewhere as a visual indicator for active elements.

tkoleary’s picture

@LewisNyman

Good point. Do you think the background color is enough?

lewisnyman’s picture

@tkoleary I would be happy with that, as long as @mgifford is also happy.

mgifford’s picture

That should be just fine. Thanks @LewisNyman - looking forward to seeing the patch.

emma.maria’s picture

Assigned: Unassigned » emma.maria
Issue tags: +Drupalaton 2014
emma.maria’s picture

Version: 8.0-alpha12 » 8.0.x-dev
Assigned: emma.maria » Unassigned
Status: Needs work » Needs review
StatusFileSize
new405 bytes
new29.96 KB
new28.49 KB

I have added the background colour solution for the button focus styles and they now look lovely.

See screenshots below.

Collapsed with button in focus.

Open with button in focus.

Will there still be follow up of fixes for fieldsets and vertical tabs as mentioned in the issue summary? Otherwise I have completed all the work needed so far.

lewisnyman’s picture

Component: Seven theme » toolbar.module
Status: Needs review » Needs work
  1. +++ b/core/themes/seven/css/style.css
    @@ -1581,3 +1581,13 @@ details.fieldset-no-legend {
    + * Focus styles for Seven
    

    This comment is a little vague, because this is the Seven theme.

  2. +++ b/core/themes/seven/css/style.css
    @@ -1581,3 +1581,13 @@ details.fieldset-no-legend {
    +button.toolbar-icon:focus {
    

    We probably don't need the button element in the selector

  3. +++ b/core/themes/seven/css/style.css
    @@ -1581,3 +1581,13 @@ details.fieldset-no-legend {
    +}
    +
    +
    

    Once too many spaces here

Finally, this seems like the kind of styling that should be the same across themes, different behaviour on Seven vs Bartik would be strange. Moving this into the toolbar module. I think toolbar.theme.css is the correct file.

emma.maria’s picture

StatusFileSize
new285.46 KB
new512 bytes

I have moved the code to toolbar.icons.css where the styles for the toolbar icons live. The comment is gone as a result plus I replicated the selector used (.toolbar .toolbar-icon.toolbar-handle) and placed the focus styles underneath them to make sure it is targeted properly.

Updated screenshot with dev tools debugging...

emma.maria’s picture

Status: Needs work » Needs review
mgifford’s picture

Status: Needs review » Reviewed & tested by the community

That looks like it will work fine...

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +TCDrupal 2014

I think we should tackle all the focus issues with toolbar in one patch so it is consistent.

lewisnyman’s picture

Thanks Alex, this needs an issue summary update to show all the focus problems we are fixing.

kirkkala’s picture

Here are 2 examples (with patches) for only toolbar icon focus styles as suggested in the ticket.

kirkkala’s picture

Status: Needs work » Needs review
StatusFileSize
new2.71 KB
new35.72 KB

Revised a bit and paid attention to the toolbar link focuses as well when tabbing through elements.

Patch adds nicer focus effect and indents the subitems keeping the element full width for nicer focus underlining.

Balneum’s picture

The elements underlining focus border should be on the left side of the element and the highlighting color (grey) should be the same darkness in both cases (when the element and the sub-category arrow is highlighted). The focus border should work with the same logic with both navigations (top navigation and side navigation).

kirkkala’s picture

StatusFileSize
new2.67 KB

#27 makes sense, moved highlighting border to left of element for both top & side menu, added darker background on focus. Focus is more subtle now.

kirkkala’s picture

Screenshots to #28 for keeping track what the patch does.








tkoleary’s picture

@kirkkala Nicely done. I think that ties in really well with other seven styles.

lewisnyman’s picture

Status: Needs review » Reviewed & tested by the community

I'm happy with these changes and the code looks good.

Good work!

herom’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new38.97 KB
new19.93 KB
new1.02 KB
new2.92 KB

I noticed two issues on the RTL version:

This is with the fixed RTL:

lauriii’s picture

Status: Needs review » Reviewed & tested by the community

Tested this manually and it seems to work. We have screenshots also attached here so this should be ready.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Dang, that looks MUCH better.

Committed and pushed to 8.x. Thanks!

  • webchick committed a77de62 on 8.0.x
    Issue #2295761 by herom, kirkkala, emma.maria, tkoleary: Less generic...
tkoleary’s picture

@webchick Thank you. I am crying tears of joy. :)

Status: Fixed » Closed (fixed)

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