Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tabbing highlights #177

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

Tabbing highlights #177

wants to merge 8 commits into from

Conversation

jaredbain
Copy link
Contributor

Fix Accessibility highlights when tabbing through home and fellow page

Fixes #133

@jaredbain jaredbain marked this pull request as ready for review July 8, 2022 16:46
@DaveSkender DaveSkender self-requested a review July 9, 2022 08:13
@@ -116,6 +116,12 @@
outline-color: color("primary-vivid");
outline-width: 8px;
}
&:focus-visible {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not exactly sure what's causing it, but there seems to be an extra tab action (two per box) that is weird.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll look into this

&:focus-visible {
@include u-bg("transparent");
outline-style: solid;
outline-color: color("primary-vivid");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the right color? To be consistent with the others?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may also want to try outline-offset: units(0.5); to be consistent with other buttons

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's probably some variable settings you can use here:

$theme-focus-color: "blue-40v" !default;
$theme-focus-offset: 0 !default;
$theme-focus-style: solid !default;
$theme-focus-width: 0.5 !default;

Ref: default settings

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this is the right color, I copied the exact styling that is already there for the original hover for the other buttons

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hover and focus may be different colors, not sure. I suspect our custom "primary-vivid" override is actually blue-50v, instead of the default blue-40v for focus; it's hard for me to ascertain.

image

@@ -110,7 +110,7 @@ <h3 class="twoline">Mentorship and <br class="display-none tablet:display-inline

<!-- impact -->
<div class="grid-row">
<div class="grid-col box-pane-button home-opportunity">
<div class="grid-col box-pane-button home-opportunity" tabindex="0">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems odd to need to force tabindex here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for divs you need to add tabindex in order for focus to work because by default, it is for elements such as , < button>, or anything that is usually interactive with the user.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yah, I think I remember struggling with this as it's not a standard HTML element. we do have the a element under it, but I don't think that's what receives the focus here.

<a class="usa-button" href="{{site.baseurl}}/opportunity/">

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can use tab index=“-1” on the a to skip the tab stop, but should add an aria-labelledby on the parent div, with reference back to the a child element, to keep a proper accessibility schema. Something to try.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this does fix the double tabbing however the div isn't redirecting to the other page because it is not the link element.

@DaveSkender
Copy link
Contributor

This one is weird. You might be able to get some help at this #uswds-public slack channel:
https://designsystem.digital.gov/about/community/

@chriskuang4 chriskuang4 marked this pull request as draft February 27, 2024 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tabbing highlights missing in some places
3 participants