Skip to content

Use ARIA attributes for states#1006

Merged
simurai merged 14 commits intorelease-14.2.0from
aria-selected
Jan 23, 2020
Merged

Use ARIA attributes for states#1006
simurai merged 14 commits intorelease-14.2.0from
aria-selected

Conversation

@simurai
Copy link
Contributor

@simurai simurai commented Dec 26, 2019

This PR:

  • Adds support for [aria-selected=true] Applies .selected styles to [aria-selected=true] #982
  • Adds support for [aria-current=page]
  • Adds support to use <button> elements for the UnderlineNav f63d53c
  • Updates the docs to only use aria attributes instead of the .selected and .current classes.
  • A few other docs improvements and clean up.

A typical change looks like this:

&.selected,
+ &[aria-selected=true]
{...}

- <a class="UnderlineNav-item selected">
+ <a class="UnderlineNav-item" aria-selected="true">

So it's still possible to use the .selected class for now, but not encouraged anymore.

And by only using [aria-current] as selector, it allows the value to also be true, like in aria-current="true" in case it's not a "page" and used for changing tabs without navigating to a new URL.


Closes #790

@vercel
Copy link

vercel bot commented Dec 26, 2019

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

🔍 Inspect: https://zeit.co/primer/primer-css/5dctfligo
✅ Preview: https://primer-css-git-aria-selected.primer.now.sh

@vercel vercel bot temporarily deployed to Preview December 26, 2019 12:58 Inactive
Applies .selected styles to [aria-selected=true]
@vercel vercel bot temporarily deployed to Preview December 26, 2019 13:19 Inactive
@vercel vercel bot temporarily deployed to Preview December 27, 2019 02:40 Inactive
@simurai simurai marked this pull request as ready for review December 27, 2019 02:54
@simurai simurai mentioned this pull request Jan 3, 2020
2 tasks
Copy link
Member

@jonrohan jonrohan left a comment

Choose a reason for hiding this comment

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

Feels good to support more aria-selected and aria-current 👍

@simurai simurai changed the base branch from master to release-14.2.0 January 23, 2020 04:34
@vercel vercel bot temporarily deployed to Preview January 23, 2020 04:46 Inactive
@simurai simurai merged commit e016bea into release-14.2.0 Jan 23, 2020
@simurai simurai deleted the aria-selected branch January 23, 2020 04:55
@simurai simurai mentioned this pull request Jan 23, 2020
8 tasks
@simurai simurai mentioned this pull request Jan 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants