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

Primer CSS a11y #1116

Merged
merged 9 commits into from
Jul 1, 2020
Merged

Primer CSS a11y #1116

merged 9 commits into from
Jul 1, 2020

Conversation

simurai
Copy link
Contributor

@simurai simurai commented Jun 29, 2020

A few more accessibility improvements to the component refresh before releasing it as Primer CSS 15.0.0.

1. Increase contrast for $text-green

Before After
before after
green-500 green-600
#28a745 #22863a
Contrast ratio: 3.13 Contrast ratio: 4.63

2. Increase contrast for placeholders

Overriding the opacity: 0.54 to opacity: 1 will make sure the $text-gray-light is opaque and the contrast ratio should now be 4.82 (recommendation is 4.5). Improves https://github.com/github/github/issues/131894

Before After
Screenshot before Screenshot after
Contrast ratio: 2.06 Contrast ratio: 4.82

3. More accessible .Progress component

This makes sure the .Progress bar is visible when enabling custom colors in Firefox. Improves https://github.com/github/github/issues/131895. The transparent outline/border won't be visible by default. But when custom colors are enabled in Firefox, it will make the outline/border the same color as the text color. And they magically appear. ✨

Description Screenshot
Default Screenshot default
Before (invisible) Screenshot before
After Screenshot after

4. More accessible .State component

Same as above ☝️ .

Description Screenshot
Default Screenshot default
Before (invisible borders) Screenshot before
After Screenshot after

5. More accessible .Counter component

Same as above ☝️ .

Description Screenshot
Default Screenshot default
Before (invisible borders) Screenshot before
After Screenshot after

6. More accessible .diffstat component

Same as above ☝️ .

Description Screenshot
Default Screenshot default
Before (invisible) Screenshot before
After Screenshot after

7. More accessible .btn component when focused

Same as above ☝️ . Improves https://github.com/github/github/issues/131885

Description Screenshot
Default Screenshot default
Before (invisible focus state) Screenshot before
After Screenshot after

8. More accessible .UnderlineNav component

Same as above ☝️ .

Description Screenshot
Default Screenshot default
Before (almost invisible selected state) Screenshot before
After Screenshot after

@vercel
Copy link

vercel bot commented Jun 29, 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/8elhoc1su
✅ Preview: https://primer-css-git-next-10.primer.vercel.app

@vercel vercel bot temporarily deployed to Preview June 29, 2020 12:09 Inactive
@vercel vercel bot temporarily deployed to Preview June 29, 2020 13:18 Inactive
@vercel vercel bot temporarily deployed to Preview June 29, 2020 14:14 Inactive
@vercel vercel bot temporarily deployed to Preview July 1, 2020 03:01 Inactive
@vercel vercel bot temporarily deployed to Preview July 1, 2020 03:15 Inactive
@simurai simurai marked this pull request as ready for review July 1, 2020 03:23
@simurai simurai requested a review from auareyou July 1, 2020 03:24
@vercel vercel bot temporarily deployed to Preview July 1, 2020 04:27 Inactive
@vercel vercel bot temporarily deployed to Preview July 1, 2020 04:46 Inactive
@vercel vercel bot temporarily deployed to Preview July 1, 2020 05:55 Inactive
Copy link
Contributor

@auareyou auareyou left a comment

Choose a reason for hiding this comment

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

Love your solution for the changes graph! <3

@simurai simurai merged commit 085a84f into next Jul 1, 2020
@simurai simurai deleted the next-10 branch July 1, 2020 06:43
@simurai simurai changed the title Component refresh tweaks 10 Primer CSS a11y Jul 1, 2020
@simurai simurai mentioned this pull request Jul 2, 2020
7 tasks
@@ -29,6 +29,8 @@
&:focus {
text-decoration: none;
border-bottom-color: $border-gray-dark;
outline: 1px dotted transparent; // Support Firfox custom colors
Copy link
Contributor

Choose a reason for hiding this comment

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

@simurai doesn't adding outline-color: transparent to the :focus state break accessibility in all other browsers or when users don't use custom colors?

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.

3 participants