-
Notifications
You must be signed in to change notification settings - Fork 44
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
Update inactive button text color to meet contrast on inactive button bg color #778
Conversation
🦋 Changeset detectedLatest commit: 8eb9fb8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Variables changed--- base/dist/scss/colors/_dark.scss 2023-11-21 16:57:26.858330129 +0000
+++ dist/scss/colors/_dark.scss 2023-11-21 16:57:13.838306441 +0000
@@ -258,3 +258,3 @@
--color-btn-inactive-bg: #21262d;
- --color-btn-inactive-text: #7d8590;
+ --color-btn-inactive-text: #8b949e;
--color-underlinenav-icon: #6e7681;
--- base/dist/scss/colors/_dark_high_contrast.scss 2023-11-21 16:57:26.870330181 +0000
+++ dist/scss/colors/_dark_high_contrast.scss 2023-11-21 16:57:13.846306445 +0000
@@ -258,3 +258,3 @@
--color-btn-inactive-bg: #272b33;
- --color-btn-inactive-text: #f0f3f6;
+ --color-btn-inactive-text: #bdc4cc;
--color-underlinenav-icon: #f0f3f6;
--- base/dist/scss/colors/_light.scss 2023-11-21 16:57:26.838330040 +0000
+++ dist/scss/colors/_light.scss 2023-11-21 16:57:13.814306430 +0000
@@ -258,3 +258,3 @@
--color-btn-inactive-bg: #eaeef2;
- --color-btn-inactive-text: #656d76;
+ --color-btn-inactive-text: #57606a;
--color-underlinenav-icon: #6e7781;
--- base/dist/scss/colors/_light_high_contrast.scss 2023-11-21 16:57:26.846330076 +0000
+++ dist/scss/colors/_light_high_contrast.scss 2023-11-21 16:57:13.822306434 +0000
@@ -258,3 +258,3 @@
--color-btn-inactive-bg: #e7ecf0;
- --color-btn-inactive-text: #0e1116;
+ --color-btn-inactive-text: #4b535d;
--color-underlinenav-icon: #66707b; |
Design Token Contrast Check
|
contrastPair | pass | contrastRatio | minimumContrastRatio |
---|---|---|---|
fg.default vs. canvas.default | ✅ | 15.79:1 | 4.5:1 |
fg.muted vs. canvas.default | ✅ | 5.24:1 | 4.5:1 |
fg.subtle vs. canvas.default | ✅ | 4.54:1 | 4.5:1 |
fg.default vs. canvas.subtle | ✅ | 14.83:1 | 4.5:1 |
fg.muted vs. canvas.subtle | ✅ | 4.92:1 | 4.5:1 |
fg.default vs. canvas.inset | ✅ | 14.83:1 | 4.5:1 |
fg.muted vs. canvas.inset | ✅ | 4.92:1 | 4.5:1 |
fg.default vs. accent.fg | ✅ | 3.04:1 | 3:1 |
fg.default vs. fg.muted | ✅ | 3.01:1 | 3:1 |
fg.default vs. accent.subtle | ✅ | 13.88:1 | 4.5:1 |
fg.default vs. success.subtle | ✅ | 14.19:1 | 4.5:1 |
fg.default vs. open.subtle | ✅ | 14.19:1 | 4.5:1 |
fg.default vs. danger.subtle | ✅ | 13.77:1 | 4.5:1 |
fg.default vs. closed.subtle | ✅ | 13.77:1 | 4.5:1 |
fg.default vs. attention.subtle | ✅ | 14.65:1 | 4.5:1 |
fg.default vs. severe.subtle | ✅ | 14.26:1 | 4.5:1 |
fg.default vs. done.subtle | ✅ | 14.21:1 | 4.5:1 |
fg.default vs. sponsors.subtle | ✅ | 14.24:1 | 4.5:1 |
accent.fg vs. canvas.default | ✅ | 5.19:1 | 4.5:1 |
accent.fg vs. canvas.subtle | ✅ | 4.87:1 | 4.5:1 |
accent.fg vs. canvas.inset | ✅ | 4.87:1 | 4.5:1 |
success.fg vs. canvas.default | ✅ | 5.07:1 | 4.5:1 |
success.fg vs. canvas.subtle | ✅ | 4.77:1 | 4.5:1 |
success.fg vs. canvas.inset | ✅ | 4.77:1 | 4.5:1 |
open.fg vs. canvas.default | ✅ | 5.07:1 | 4.5:1 |
open.fg vs. canvas.subtle | ✅ | 4.77:1 | 4.5:1 |
open.fg vs. canvas.inset | ✅ | 4.77:1 | 4.5:1 |
danger.fg vs. canvas.default | ✅ | 5.24:1 | 4.5:1 |
danger.fg vs. canvas.subtle | ✅ | 4.92:1 | 4.5:1 |
danger.fg vs. canvas.inset | ✅ | 4.92:1 | 4.5:1 |
closed.fg vs. canvas.default | ✅ | 5.24:1 | 4.5:1 |
closed.fg vs. canvas.subtle | ✅ | 4.92:1 | 4.5:1 |
closed.fg vs. canvas.inset | ✅ | 4.92:1 | 4.5:1 |
attention.fg vs. canvas.default | ✅ | 4.86:1 | 4.5:1 |
attention.fg vs. canvas.subtle | ✅ | 4.57:1 | 4.5:1 |
attention.fg vs. canvas.inset | ✅ | 4.57:1 | 4.5:1 |
severe.fg vs. canvas.default | ✅ | 5.03:1 | 4.5:1 |
severe.fg vs. canvas.subtle | ✅ | 4.72:1 | 4.5:1 |
severe.fg vs. canvas.inset | ✅ | 4.72:1 | 4.5:1 |
done.fg vs. canvas.default | ✅ | 5.04:1 | 4.5:1 |
done.fg vs. canvas.subtle | ✅ | 4.73:1 | 4.5:1 |
done.fg vs. canvas.inset | ✅ | 4.73:1 | 4.5:1 |
sponsors.fg vs. canvas.default | ✅ | 5.04:1 | 4.5:1 |
sponsors.fg vs. canvas.subtle | ✅ | 4.73:1 | 4.5:1 |
sponsors.fg vs. canvas.inset | ✅ | 4.73:1 | 4.5:1 |
accent.fg vs. accent.subtle | ✅ | 4.56:1 | 4.5:1 |
success.fg vs. success.subtle | ✅ | 4.56:1 | 4.5:1 |
open.fg vs. open.subtle | ✅ | 4.56:1 | 4.5:1 |
danger.fg vs. danger.subtle | ✅ | 4.57:1 | 4.5:1 |
closed.fg vs. closed.subtle | ✅ | 4.57:1 | 4.5:1 |
attention.fg vs. attention.subtle | ✅ | 4.51:1 | 4.5:1 |
severe.fg vs. severe.subtle | ✅ | 4.54:1 | 4.5:1 |
done.fg vs. done.subtle | ✅ | 4.53:1 | 4.5:1 |
sponsors.fg vs. sponsors.subtle | ✅ | 4.55:1 | 4.5:1 |
accent.fg vs. fg.default | ✅ | 3.04:1 | 3:1 |
success.fg vs. fg.default | ✅ | 3.11:1 | 3:1 |
open.fg vs. fg.default | ✅ | 3.11:1 | 3:1 |
danger.fg vs. fg.default | ✅ | 3.01:1 | 3:1 |
closed.fg vs. fg.default | ✅ | 3.01:1 | 3:1 |
attention.fg vs. fg.default | ✅ | 3.24:1 | 3:1 |
severe.fg vs. fg.default | ✅ | 3.13:1 | 3:1 |
done.fg vs. fg.default | ✅ | 3.13:1 | 3:1 |
sponsors.fg vs. fg.default | ✅ | 3.13:1 | 3:1 |
fg.onEmphasis vs. neutral.emphasis | ✅ | 4.54:1 | 4.5:1 |
fg.onEmphasis vs. neutral.emphasisPlus | ✅ | 14.65:1 | 4.5:1 |
fg.onEmphasis vs. accent.emphasis | ✅ | 5.19:1 | 4.5:1 |
fg.onEmphasis vs. success.emphasis | ✅ | 4.51:1 | 4.5:1 |
fg.onEmphasis vs. open.emphasis | ✅ | 4.51:1 | 4.5:1 |
fg.onEmphasis vs. danger.emphasis | ✅ | 5.35:1 | 4.5:1 |
fg.onEmphasis vs. closed.emphasis | ✅ | 5.35:1 | 4.5:1 |
fg.onEmphasis vs. attention.emphasis | ✅ | 4.86:1 | 4.5:1 |
fg.onEmphasis vs. severe.emphasis | ✅ | 5.03:1 | 4.5:1 |
fg.onEmphasis vs. done.emphasis | ✅ | 5.04:1 | 4.5:1 |
fg.onEmphasis vs. sponsors.emphasis | ✅ | 5.04:1 | 4.5:1 |
control.borderColor.emphasis vs. canvas.default | ✅ | 3.28:1 | 3:1 |
control.borderColor.emphasis vs. canvas.subtle | ✅ | 3.08:1 | 3:1 |
dark
: ❌ 9 checks failed
Show results table for theme: dark
contrastPair | pass | contrastRatio | minimumContrastRatio |
---|---|---|---|
fg.default vs. canvas.default | ✅ | 16.01:1 | 4.5:1 |
fg.muted vs. canvas.default | ✅ | 5.07:1 | 4.5:1 |
fg.subtle vs. canvas.default | ❌ | 4.11:1 | 4.5:1 |
fg.default vs. canvas.subtle | ✅ | 14.63:1 | 4.5:1 |
fg.muted vs. canvas.subtle | ✅ | 4.63:1 | 4.5:1 |
fg.default vs. canvas.inset | ✅ | 17.37:1 | 4.5:1 |
fg.muted vs. canvas.inset | ✅ | 5.5:1 | 4.5:1 |
fg.default vs. accent.fg | ✅ | 3.17:1 | 3:1 |
fg.default vs. fg.muted | ✅ | 3.15:1 | 3:1 |
fg.default vs. accent.subtle on canvas.default | ✅ | 14.34:1 | 4.5:1 |
fg.default vs. accent.subtle on canvas.subtle | ✅ | 12.91:1 | 4.5:1 |
fg.default vs. success.subtle on canvas.default | ✅ | 13.44:1 | 4.5:1 |
fg.default vs. success.subtle on canvas.subtle | ✅ | 12:1 | 4.5:1 |
fg.default vs. open.subtle on canvas.default | ✅ | 13.44:1 | 4.5:1 |
fg.default vs. open.subtle on canvas.subtle | ✅ | 12:1 | 4.5:1 |
fg.default vs. danger.subtle on canvas.default | ✅ | 14.59:1 | 4.5:1 |
fg.default vs. danger.subtle on canvas.subtle | ✅ | 13.2:1 | 4.5:1 |
fg.default vs. closed.subtle on canvas.default | ✅ | 13.64:1 | 4.5:1 |
fg.default vs. closed.subtle on canvas.subtle | ✅ | 12.34:1 | 4.5:1 |
fg.default vs. attention.subtle on canvas.default | ✅ | 13.4:1 | 4.5:1 |
fg.default vs. attention.subtle on canvas.subtle | ✅ | 12.08:1 | 4.5:1 |
fg.default vs. severe.subtle on canvas.default | ✅ | 14.45:1 | 4.5:1 |
fg.default vs. severe.subtle on canvas.subtle | ✅ | 13.03:1 | 4.5:1 |
fg.default vs. done.subtle on canvas.default | ✅ | 14.28:1 | 4.5:1 |
fg.default vs. done.subtle on canvas.subtle | ✅ | 12.85:1 | 4.5:1 |
fg.default vs. sponsors.subtle on canvas.default | ✅ | 14.4:1 | 4.5:1 |
fg.default vs. sponsors.subtle on canvas.subtle | ✅ | 12.98:1 | 4.5:1 |
accent.fg vs. canvas.default | ✅ | 5.05:1 | 4.5:1 |
accent.fg vs. canvas.subtle | ✅ | 4.61:1 | 4.5:1 |
accent.fg vs. canvas.inset | ✅ | 5.48:1 | 4.5:1 |
success.fg vs. canvas.default | ✅ | 7.44:1 | 4.5:1 |
success.fg vs. canvas.subtle | ✅ | 6.8:1 | 4.5:1 |
success.fg vs. canvas.inset | ✅ | 8.08:1 | 4.5:1 |
open.fg vs. canvas.default | ✅ | 7.44:1 | 4.5:1 |
open.fg vs. canvas.subtle | ✅ | 6.8:1 | 4.5:1 |
open.fg vs. canvas.inset | ✅ | 8.08:1 | 4.5:1 |
danger.fg vs. canvas.default | ✅ | 5.64:1 | 4.5:1 |
danger.fg vs. canvas.subtle | ✅ | 5.16:1 | 4.5:1 |
danger.fg vs. canvas.inset | ✅ | 6.12:1 | 4.5:1 |
closed.fg vs. canvas.default | ✅ | 5.64:1 | 4.5:1 |
closed.fg vs. canvas.subtle | ✅ | 5.16:1 | 4.5:1 |
closed.fg vs. canvas.inset | ✅ | 6.12:1 | 4.5:1 |
attention.fg vs. canvas.default | ✅ | 7.49:1 | 4.5:1 |
attention.fg vs. canvas.subtle | ✅ | 6.85:1 | 4.5:1 |
attention.fg vs. canvas.inset | ✅ | 8.13:1 | 4.5:1 |
severe.fg vs. canvas.default | ✅ | 5.61:1 | 4.5:1 |
severe.fg vs. canvas.subtle | ✅ | 5.13:1 | 4.5:1 |
severe.fg vs. canvas.inset | ✅ | 6.09:1 | 4.5:1 |
done.fg vs. canvas.default | ✅ | 5.64:1 | 4.5:1 |
done.fg vs. canvas.subtle | ✅ | 5.15:1 | 4.5:1 |
done.fg vs. canvas.inset | ✅ | 6.12:1 | 4.5:1 |
sponsors.fg vs. canvas.default | ✅ | 5.62:1 | 4.5:1 |
sponsors.fg vs. canvas.subtle | ✅ | 5.14:1 | 4.5:1 |
sponsors.fg vs. canvas.inset | ✅ | 6.1:1 | 4.5:1 |
accent.fg vs. accent.subtle on canvas.default | ✅ | 4.52:1 | 4.5:1 |
success.fg vs. success.subtle on canvas.default | ✅ | 6.25:1 | 4.5:1 |
success.fg vs. success.subtle on canvas.subtle | ✅ | 5.58:1 | 4.5:1 |
open.fg vs. open.subtle on canvas.default | ✅ | 6.25:1 | 4.5:1 |
open.fg vs. open.subtle on canvas.subtle | ✅ | 5.58:1 | 4.5:1 |
danger.fg vs. danger.subtle on canvas.default | ✅ | 5.14:1 | 4.5:1 |
danger.fg vs. danger.subtle on canvas.subtle | ✅ | 4.65:1 | 4.5:1 |
closed.fg vs. closed.subtle on canvas.default | ✅ | 4.81:1 | 4.5:1 |
attention.fg vs. attention.subtle on canvas.default | ✅ | 6.27:1 | 4.5:1 |
attention.fg vs. attention.subtle on canvas.subtle | ✅ | 5.65:1 | 4.5:1 |
severe.fg vs. severe.subtle on canvas.default | ✅ | 5.06:1 | 4.5:1 |
severe.fg vs. severe.subtle on canvas.subtle | ✅ | 4.57:1 | 4.5:1 |
done.fg vs. done.subtle on canvas.default | ✅ | 5.03:1 | 4.5:1 |
done.fg vs. done.subtle on canvas.subtle | ✅ | 4.52:1 | 4.5:1 |
sponsors.fg vs. sponsors.subtle on canvas.default | ✅ | 5.06:1 | 4.5:1 |
sponsors.fg vs. sponsors.subtle on canvas.subtle | ✅ | 4.56:1 | 4.5:1 |
accent.fg vs. fg.default | ✅ | 3.17:1 | 3:1 |
success.fg vs. fg.default | ❌ | 2.14:1 | 3:1 |
open.fg vs. fg.default | ❌ | 2.14:1 | 3:1 |
danger.fg vs. fg.default | ❌ | 2.83:1 | 3:1 |
closed.fg vs. fg.default | ❌ | 2.83:1 | 3:1 |
attention.fg vs. fg.default | ❌ | 2.13:1 | 3:1 |
severe.fg vs. fg.default | ❌ | 2.85:1 | 3:1 |
done.fg vs. fg.default | ❌ | 2.83:1 | 3:1 |
sponsors.fg vs. fg.default | ❌ | 2.84:1 | 3:1 |
fg.onEmphasis vs. neutral.emphasis | ✅ | 4.59:1 | 4.5:1 |
fg.onEmphasis vs. neutral.emphasisPlus | ✅ | 4.59:1 | 4.5:1 |
fg.onEmphasis vs. accent.emphasis | ✅ | 4.63:1 | 4.5:1 |
fg.onEmphasis vs. success.emphasis | ✅ | 4.63:1 | 4.5:1 |
fg.onEmphasis vs. open.emphasis | ✅ | 4.63:1 | 4.5:1 |
fg.onEmphasis vs. danger.emphasis | ✅ | 4.6:1 | 4.5:1 |
fg.onEmphasis vs. closed.emphasis | ✅ | 4.6:1 | 4.5:1 |
fg.onEmphasis vs. attention.emphasis | ✅ | 4.64:1 | 4.5:1 |
fg.onEmphasis vs. severe.emphasis | ✅ | 4.65:1 | 4.5:1 |
fg.onEmphasis vs. done.emphasis | ✅ | 4.6:1 | 4.5:1 |
fg.onEmphasis vs. sponsors.emphasis | ✅ | 4.57:1 | 4.5:1 |
control.borderColor.emphasis vs. canvas.default | ✅ | 3.31:1 | 3:1 |
control.borderColor.emphasis vs. canvas.subtle | ✅ | 3.02:1 | 3:1 |
fgColor-muted
with the v8 valuefg.muted
with the v8 value for fgColor-muted
It looks like we might need to update |
Unless we don't care about Current I think instead we should just use a custom color for the inactive button text tokens. What do you think? |
yes, you are right. I missed the 3:1 contrast between default and muted, sorry. In this case we should go ahead and just create custom component token here. |
fg.muted
with the v8 value for fgColor-muted
Design Token Diff
|
This appears to be stuck on the "check for changeset" check. Merging because I can manually confirm that there is a changeset: https://github.com/primer/primitives/pull/778/files#diff-747c9a1a38a77edc5f5c05e85a844a1257bdb73d6d184dd21d97136a3b1e9a51 |
Summary
Update inactive button text color in light and dark mode to ensure we're meeting the contrast ratio minimum against the inactive button's background color.
List of notable changes:
What should reviewers focus on?
Steps to test:
Supporting resources (related issues, external links, etc):
The former
fg.muted
value just barely fails the contrast ratio check when used ongray.1
: https://github.com/primer/react/actions/runs/6893293489/job/18752536079?pr=3812Contributor checklist:
Reviewer checklist: