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

Fix: Focus accessibility issue for CategoryListItem component's Anchor #34

Merged
merged 2 commits into from
Jul 13, 2021
Merged

Fix: Focus accessibility issue for CategoryListItem component's Anchor #34

merged 2 commits into from
Jul 13, 2021

Conversation

stevescruz
Copy link
Collaborator

@stevescruz stevescruz commented Sep 25, 2020

Commit message

NOTE: this commit helps fix #33

-Anchor now has a white outline to guarantee compliance with a11y (accessibility)
guidelines.
-Altered the transition CSS property in Tech to explicitly define that the transition
will only happen to the background color. This prevents a transition from triggering on
a non desirable circumstance such as now with the outline.

-According to the WCAG 2.1 guideline 2.4.7 the Focus must be Visible.
-Why? Because it helps people with motor impairments and people with
attention limitation or short term memory limitations understand visually
determine the component on which keyboard operations will interact at any
point in time.

Category List Item Anchor's focus before the fix

home page's category-list-item anchor does not have a visual indicator when it is focused

When the user utilizes tab on the keyboard he does not have any visual indicator that the CategoryListItem component's anchor is focused.

Category List Item bug

home page's category-list-item anchor has a white outline when it is focused but there is empty space between the anchor's outline and its child div

To solve the issue we can give a white outline to category-list-item's anchor when it is focused but this generates a bug: there is empty space between the anchor's outline and its child div.

the empty space is caused because the margin was set on the child div instead of the anchor

The empty space is caused because the margin was set on the child div instead of the anchor. I solved this by moving the margin to the anchor element and setting the display to inline-block so margins can affect it.

Coincidentally it also makes sense to set the margin on the outer element instead of the inner element as it reduces the possibility of collapsed margin happening between the Anchor and the child div in the future.

Category List Item Anchor's focus after the fix

home page's category-list-item anchor has a white outline as a visual indicator when it is focused

When the user utilizes tab on the keyboard he has a white outline as a visual indicator that the CategoryListItem component's anchor is focused.

@vercel
Copy link

vercel bot commented Sep 25, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/lorenalgm/dev/6t26tgxjc
✅ Preview: https://dev-git-fork-stevescruz-fix-accessibility-outline-buttons.lorenalgm.vercel.app

[Deployment for f1a4182 failed]

…ocus

NOTE: this commit helps fix #33

-Anchor now has a white outline to guarantee compliance with a11y (accessibility)
guidelines.
-Moved the margin from the inner content (Tech) to the outer content (Anchor).
-Altered the transition CSS property in Tech to explicitly define that the transition
will only happen to the background color. This prevents a transition from triggering on
a non desirable circunstance.

-According to the WCAG 2.1 guideline 2.4.7 the Focus must be Visible.
-Why? Because it helps people with motor impairments and people with
attention limitation or short term memory limitations understand visually
determine the component on which keyboard operations will interact at any
point in time.
@stevescruz stevescruz changed the base branch from master to develop September 27, 2020 00:53
@ramos-ph ramos-ph merged commit beb973b into Lorenalgm:develop Jul 13, 2021
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.

Fix: Home Section - Accessibility - Compliance with WCGA 2.1 - Focus Visible
3 participants