Skip to content

Commit

Permalink
Use open/closed colors for StateLabel (#3041)
Browse files Browse the repository at this point in the history
* Update StateLabel to open/closed colors

* Create .changeset/unlucky-books-sort.md

* test(vrt): update snapshots

* test(vrt): update snapshots

* Revert "test(vrt): update snapshots"

This reverts commit c53a8da.

* test(vrt): update snapshots

* test(e2e): add exceptions for dark_colorblind theme

---------

Co-authored-by: simurai <simurai@users.noreply.github.com>
Co-authored-by: Josh Black <joshblack@github.com>
Co-authored-by: joshblack <joshblack@users.noreply.github.com>
  • Loading branch information
4 people authored Mar 24, 2023
1 parent c67fb24 commit e5f1330
Show file tree
Hide file tree
Showing 36 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/unlucky-books-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Use open/closed colors for `StateLabel`
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions e2e/components/PageHeader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ test.describe('PageHeader', () => {
rules: {
'color-contrast': {
enabled:
theme !== 'dark_colorblind' &&
theme !== 'dark_dimmed' &&
theme !== 'light' &&
theme !== 'light_colorblind' &&
Expand Down Expand Up @@ -138,6 +139,7 @@ test.describe('PageHeader', () => {
rules: {
'color-contrast': {
enabled:
theme !== 'dark_colorblind' &&
theme !== 'dark_dimmed' &&
theme !== 'light' &&
theme !== 'light_colorblind' &&
Expand Down
2 changes: 1 addition & 1 deletion e2e/components/UnderlineNav.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ test.describe('UnderlineNav', () => {

// These themes currently have a contrast violation due to
// `StateLabel`
const denylist = new Set(['light', 'light_colorblind', 'light_tritanopia', 'dark_dimmed'])
const denylist = new Set(['light', 'light_colorblind', 'light_tritanopia', 'dark_colorblind', 'dark_dimmed'])

await expect(page).toHaveNoViolations({
rules: {
Expand Down
6 changes: 3 additions & 3 deletions src/StateLabel/StateLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@ const colorVariants = variant({
color: 'fg.onEmphasis',
},
pullClosed: {
backgroundColor: 'danger.emphasis',
backgroundColor: 'closed.emphasis',
color: 'fg.onEmphasis',
},
pullMerged: {
backgroundColor: 'done.emphasis',
color: 'fg.onEmphasis',
},
issueOpened: {
backgroundColor: 'success.emphasis',
backgroundColor: 'open.emphasis',
color: 'fg.onEmphasis',
},
pullOpened: {
backgroundColor: 'success.emphasis',
backgroundColor: 'open.emphasis',
color: 'fg.onEmphasis',
},
draft: {
Expand Down

0 comments on commit e5f1330

Please sign in to comment.