fix(pagination):improve focus style to meet WCAG 2.2 AA#1612
fix(pagination):improve focus style to meet WCAG 2.2 AA#1612dancormier merged 2 commits intodevelopfrom
Conversation
✅ Deploy Preview for stacks ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
giamir
left a comment
There was a problem hiding this comment.
Looks good to me. Great work 🎉
CGuindon
left a comment
There was a problem hiding this comment.
Visually, everything looks good, from other examples I'm seeing online I think we need Focus to land on the selected/active page number as well. In the preview, it skips over page 1 when I tab through the elements.
The current page is indicated by aria-current="page".
Unless I'm missing something...
I've added the focus style on the pagination item with |
|
@CGuindon I've update the pagination docs to include a linked selected pagination item and I've added the visually hidden "page" text inspired by the W3C design system:
|
|
@dancormier Would it be possible to add a test for this? So that any pagination buttons that are missing this piece in core would then show up in our automated tests list of issues with exact locations? (or am I dreaming to big) |
CGuindon
left a comment
There was a problem hiding this comment.
My question about the test is separate from the original ticket — everything from the requirements LGTM
Dreaming big is good! That said, I think automated accessibility testing may catch failures like It's pretty hard to enforce our components to be marked up exactly as we'd want in our consumer code unless they're using something like a razor or svelte component that handles the markup for the consumer. At some point, we'll probably want to work with Core to help design their accessibility tests broadly which may help with this, but I think this will probably need to be manual for the moment. |

Addresses STACKS-544
Technical notes
You'll notice that this PR achieves the focus style mainly with box-shadow:
This is because box-shadow tends to align more consistently. Additionally, a transparent outline is used to ensure that an outline doesn't render when expected but can still be rendered in forced-color modes (see https://blogs.windows.com/msedgedev/2020/09/17/styling-for-windows-high-contrast-with-new-standards-for-forced-colors/#gist105426765).