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

Accessible Progress #1089

Merged
merged 2 commits into from
May 21, 2020
Merged

Accessible Progress #1089

merged 2 commits into from
May 21, 2020

Conversation

simurai
Copy link
Contributor

@simurai simurai commented May 19, 2020

This PR improves accessibility of the Progress component by adding a 2px gap between multiple values.

Before After
img-2020-05-19-14 47 01@2x img-2020-05-19-13 41 02@2x

Why

This makes it easier to see different values that have similar colors.

Alternatives

If there are a lot of very small values, like 0.1%, they might not be visible and it just shows some empty space towards the end:

img-2020-05-19-14 28 18@2x

An option would be to show every value with a min-width of 2px. So that they all show up. Downside it that it makes the values look different than they actually are, so for now this is not included in this PR.

img-2020-05-19-13 30 03@2x

API changes

  • .Progress-item class needs to be added for Progress with multiple values

Closes #1079

@simurai simurai requested review from jonrohan, a team and emilybrick and removed request for a team May 19, 2020 05:39
@vercel
Copy link

vercel bot commented May 19, 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/primer/primer-css/7u3agv9e7
✅ Preview: https://primer-css-git-accessible-progress.primer.now.sh

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.

Implementation wise 👍🏻

I like the idea of the min-width on the sections, but I'd be curious to what @emilybrick thinks.

.Progress-item + .Progress-item {
// stylelint-disable-next-line primer/spacing
margin-left: 2px;
}
Copy link
Member

Choose a reason for hiding this comment

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

I like how simple this solution is. If only we could do flex gap now. 😩

Copy link
Contributor

@emilybrick emilybrick left a comment

Choose a reason for hiding this comment

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

🌼

@simurai simurai changed the base branch from master to release-14.4.0 May 21, 2020 06:52
@simurai simurai merged commit 4a534ba into release-14.4.0 May 21, 2020
@simurai simurai deleted the accessible-progress branch May 21, 2020 06:52
@simurai simurai mentioned this pull request May 21, 2020
5 tasks
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.

Multi-value progress bar isn't accessible
3 participants