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

feat: add keyboard focus styles #3011

Merged
merged 17 commits into from Jul 24, 2023
Merged

feat: add keyboard focus styles #3011

merged 17 commits into from Jul 24, 2023

Conversation

r3pwn
Copy link
Contributor

@r3pwn r3pwn commented Jul 18, 2023

Description

The Admin site does not currently have any kind of keyboard focus styles, meaning that tabbing through elements on a page may prove to be difficult for some users.

This PR aims to resolve that by adding keyboard focus styles for a majority of the components, as well as provides a couple incredibly minor bugfixes related to tab-based navigation:

  • prevents tabbing to a disabled Paginator/ClickableArrow by setting the disabled HTML attribute on it
  • prevents tabbing to the invisible textarea that CopyToClipboard uses internally

For users that do not use a keyboard to navigate the site, there is no perceivable change, as this approach utilizes the :focus-visible CSS pseudo-selector.

While it is more of a minor accessibility fix, this change relates to #1232

  • I have read and understand the CONTRIBUTING.md document in this repository

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

@AlessioGr AlessioGr self-assigned this Jul 21, 2023
@AlessioGr
Copy link
Member

Thank you for your PR! While reviewing it, I've noticed that the Dashboard Card outlines did not work. The issue was that the postcss-preset-env dependency was turning the &:focus:not(:focus-visible) into :focus:not(.focus-visible).

I went ahead and updated the postcss-preset-env dependency, which fixed this. Will continue my review of this PR to get this merged asap!

Copy link
Member

@AlessioGr AlessioGr left a comment

Choose a reason for hiding this comment

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

LGTM!

Before:

Screenshot.2023-07-24.at.16.41.56.mp4

After:

Screenshot.2023-07-24.at.16.43.45.mp4

@AlessioGr AlessioGr merged commit 080e619 into payloadcms:master Jul 24, 2023
4 checks passed
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.

None yet

2 participants