refactor(a11y): add headings to call to action cards #799
+39
−36
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This refactors the cards in the CTA section (used on the home and about pages) to have headings (i.e.
<h3>elements) and improves the focus rings. The links are now within the cards rather than wrapping the cards. I’m using the tried and true trick of making an sub-element within the link to cover the card, but then usingz-indexto keep heading and paragraph text on top so it can be directly selected.For accessibility, this makes these call to action cards navigable (i.e. since they have headings AT can navigate to them) and the accessible names of the links are more focused (i.e. they don’t include the entire card’s contents).
Glad to receive feedback on my utility class name ordering.
Aside: eventually a
<Card>component (with a clickable variant) could be a good abstraction.