From 8c27df6b066e3d26ee0199ad7928092a532fe0a3 Mon Sep 17 00:00:00 2001 From: Lukas Oppermann Date: Fri, 4 Oct 2024 13:58:40 +0200 Subject: [PATCH 1/5] testing --- src/tokens/base/color/dark/dark.json5 | 2 +- src/tokens/base/color/light/light.json5 | 20 +++++++++---------- .../color/light/patterns-light.json5 | 4 ++-- .../color/light/primitives-light.json5 | 6 +----- 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/src/tokens/base/color/dark/dark.json5 b/src/tokens/base/color/dark/dark.json5 index 44eb774c0..820d21620 100644 --- a/src/tokens/base/color/dark/dark.json5 +++ b/src/tokens/base/color/dark/dark.json5 @@ -309,7 +309,7 @@ }, }, '5': { - $value: '#238636', + $value: '#00873D', $type: 'color', $extensions: { 'org.primer.figma': { diff --git a/src/tokens/base/color/light/light.json5 b/src/tokens/base/color/light/light.json5 index 29e2e5230..380c653ae 100644 --- a/src/tokens/base/color/light/light.json5 +++ b/src/tokens/base/color/light/light.json5 @@ -264,7 +264,7 @@ }, green: { '0': { - $value: '#dafbe1', + $value: '#b1fccc', $type: 'color', $extensions: { 'org.primer.figma': { @@ -273,7 +273,7 @@ }, }, '1': { - $value: '#aceebb', + $value: '#34f980', $type: 'color', $extensions: { 'org.primer.figma': { @@ -282,7 +282,7 @@ }, }, '2': { - $value: '#6fdd8b', + $value: '#04dc5b', $type: 'color', $extensions: { 'org.primer.figma': { @@ -291,7 +291,7 @@ }, }, '3': { - $value: '#4ac26b', + $value: '#02c051', $type: 'color', $extensions: { 'org.primer.figma': { @@ -300,7 +300,7 @@ }, }, '4': { - $value: '#2da44e', + $value: '#00a347', $type: 'color', $extensions: { 'org.primer.figma': { @@ -309,7 +309,7 @@ }, }, '5': { - $value: '#1a7f37', + $value: '#00873D', $type: 'color', $extensions: { 'org.primer.figma': { @@ -318,7 +318,7 @@ }, }, '6': { - $value: '#116329', + $value: '#007034', $type: 'color', $extensions: { 'org.primer.figma': { @@ -327,7 +327,7 @@ }, }, '7': { - $value: '#044f1e', + $value: '#00612f', $type: 'color', $extensions: { 'org.primer.figma': { @@ -336,7 +336,7 @@ }, }, '8': { - $value: '#003d16', + $value: '#004d26', $type: 'color', $extensions: { 'org.primer.figma': { @@ -345,7 +345,7 @@ }, }, '9': { - $value: '#002d11', + $value: '#00381d', $type: 'color', $extensions: { 'org.primer.figma': { diff --git a/src/tokens/functional/color/light/patterns-light.json5 b/src/tokens/functional/color/light/patterns-light.json5 index 934d1ecff..19b94e664 100644 --- a/src/tokens/functional/color/light/patterns-light.json5 +++ b/src/tokens/functional/color/light/patterns-light.json5 @@ -772,7 +772,7 @@ scopes: ['bgColor'], }, }, - } + }, }, }, button: { @@ -2089,7 +2089,7 @@ underlineNav: { borderColor: { active: { - $value: '{base.color.coral.3}', + $value: '#FD794F', $type: 'color', $extensions: { 'org.primer.figma': { diff --git a/src/tokens/functional/color/light/primitives-light.json5 b/src/tokens/functional/color/light/primitives-light.json5 index 4ed7b0c12..64fa717fc 100644 --- a/src/tokens/functional/color/light/primitives-light.json5 +++ b/src/tokens/functional/color/light/primitives-light.json5 @@ -475,7 +475,7 @@ }, }, emphasis: { - $value: '{base.color.green.4}', + $value: '{base.color.green.5}', $type: 'color', $extensions: { 'org.primer.figma': { @@ -488,10 +488,6 @@ }, }, }, - mix: { - color: '{base.color.green.5}', - weight: 0.75, - }, }, }, open: { From fd8a30d32a34ebc91907ef42c09944d35f8792e5 Mon Sep 17 00:00:00 2001 From: Lukas Oppermann Date: Tue, 8 Oct 2024 12:12:22 +0200 Subject: [PATCH 2/5] update dark and light green scales --- src/tokens/base/color/dark/dark.json5 | 18 +++++++++--------- src/tokens/base/color/light/light.json5 | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/tokens/base/color/dark/dark.json5 b/src/tokens/base/color/dark/dark.json5 index 820d21620..2d8db36d5 100644 --- a/src/tokens/base/color/dark/dark.json5 +++ b/src/tokens/base/color/dark/dark.json5 @@ -264,7 +264,7 @@ }, green: { '0': { - $value: '#aff5b4', + $value: '#70e691', $type: 'color', $extensions: { 'org.primer.figma': { @@ -273,7 +273,7 @@ }, }, '1': { - $value: '#7ee787', + $value: '#1edc5a', $type: 'color', $extensions: { 'org.primer.figma': { @@ -282,7 +282,7 @@ }, }, '2': { - $value: '#56d364', + $value: '#13c351', $type: 'color', $extensions: { 'org.primer.figma': { @@ -291,7 +291,7 @@ }, }, '3': { - $value: '#3fb950', + $value: '#0cb64d', $type: 'color', $extensions: { 'org.primer.figma': { @@ -300,7 +300,7 @@ }, }, '4': { - $value: '#2ea043', + $value: '#048f3e', $type: 'color', $extensions: { 'org.primer.figma': { @@ -318,7 +318,7 @@ }, }, '6': { - $value: '#196c2e', + $value: '#005c2c', $type: 'color', $extensions: { 'org.primer.figma': { @@ -327,7 +327,7 @@ }, }, '7': { - $value: '#0f5323', + $value: '#004725', $type: 'color', $extensions: { 'org.primer.figma': { @@ -336,7 +336,7 @@ }, }, '8': { - $value: '#033a16', + $value: '#00331c', $type: 'color', $extensions: { 'org.primer.figma': { @@ -345,7 +345,7 @@ }, }, '9': { - $value: '#04260f', + $value: '#002918', $type: 'color', $extensions: { 'org.primer.figma': { diff --git a/src/tokens/base/color/light/light.json5 b/src/tokens/base/color/light/light.json5 index 380c653ae..d850777d2 100644 --- a/src/tokens/base/color/light/light.json5 +++ b/src/tokens/base/color/light/light.json5 @@ -264,7 +264,7 @@ }, green: { '0': { - $value: '#b1fccc', + $value: '#cbf6d7', $type: 'color', $extensions: { 'org.primer.figma': { @@ -273,7 +273,7 @@ }, }, '1': { - $value: '#34f980', + $value: '#8aefaa', $type: 'color', $extensions: { 'org.primer.figma': { @@ -282,7 +282,7 @@ }, }, '2': { - $value: '#04dc5b', + $value: '#16da5a', $type: 'color', $extensions: { 'org.primer.figma': { @@ -291,7 +291,7 @@ }, }, '3': { - $value: '#02c051', + $value: '#0cc051', $type: 'color', $extensions: { 'org.primer.figma': { @@ -300,7 +300,7 @@ }, }, '4': { - $value: '#00a347', + $value: '#05a347', $type: 'color', $extensions: { 'org.primer.figma': { @@ -318,7 +318,7 @@ }, }, '6': { - $value: '#007034', + $value: '#007036', $type: 'color', $extensions: { 'org.primer.figma': { @@ -327,7 +327,7 @@ }, }, '7': { - $value: '#00612f', + $value: '#006132', $type: 'color', $extensions: { 'org.primer.figma': { @@ -336,7 +336,7 @@ }, }, '8': { - $value: '#004d26', + $value: '#004d2a', $type: 'color', $extensions: { 'org.primer.figma': { @@ -345,7 +345,7 @@ }, }, '9': { - $value: '#00381d', + $value: '#003821', $type: 'color', $extensions: { 'org.primer.figma': { From f3c5026146a40dda0fcd582e0282af3a1a4d282c Mon Sep 17 00:00:00 2001 From: Lukas Oppermann Date: Tue, 8 Oct 2024 13:08:37 +0200 Subject: [PATCH 3/5] update workflow --- .github/workflows/a11y-contrast.yml | 46 +++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/.github/workflows/a11y-contrast.yml b/.github/workflows/a11y-contrast.yml index 36aaeaea4..460753f02 100644 --- a/.github/workflows/a11y-contrast.yml +++ b/.github/workflows/a11y-contrast.yml @@ -110,9 +110,28 @@ jobs: repo: context.repo.repo }); + const possibleTitles = [ + '❌ light:', + '❌ light_high_contrast:', + '❌ light_colorblind:', + '❌ light_tritanopia:', + '❌ dark:', + '❌ dark_dimmed:', + '❌ dark_high_contrast:', + '❌ dark_colorblind:', + '❌ dark_tritanopia:' + ] + + // get comments of token issues + const currentComments = comments.filter(comment => possibleTitles.some(titleStart => comment.body.includes(titleStart))); + for (const {title, body} of results) { // get token issue - const tokenCheckComment = comments.filter(comment => comment.body.includes(title)); + const titleStart = title.substring(0, title.indexOf(':') + 1); + // remove from currentComments + + // + const tokenCheckComment = comments.filter(comment => comment.body.includes(titleStart)); const outputBody = `${title}\n\n${body}\n\n→ Details` // if token issue exists, update it @@ -136,6 +155,17 @@ jobs: } } + // if token issue exists, update it + if(currentComments.length > 0) { + await currentComments.map(comment => { + github.rest.issues.deleteComment({ + comment_id: comment.id, + owner: context.repo.owner, + repo: context.repo.repo, + }) + }) + } + Fail_action_on_contrast_failing: needs: build name: Fail action on contrast failing @@ -164,8 +194,20 @@ jobs: repo: context.repo.repo }); + const possibleTitles = [ + '❌ light:', + '❌ light_high_contrast:', + '❌ light_colorblind:', + '❌ light_tritanopia:', + '❌ dark:', + '❌ dark_dimmed:', + '❌ dark_high_contrast:', + '❌ dark_colorblind:', + '❌ dark_tritanopia:' + ] + // get token issue - const tokenCheckComment = comments.filter(comment => comment.body.includes('## Design Token Contrast Check')); + const tokenCheckComment = comments.filter(comment => possibleTitles.some(titleStart => comment.body.includes(titleStart))); // if token issue exists, update it if(tokenCheckComment.length > 0) { From 2ef12bc931b42d12a11a3374259c6e72a87c7c78 Mon Sep 17 00:00:00 2001 From: Lukas Oppermann Date: Tue, 8 Oct 2024 13:12:55 +0200 Subject: [PATCH 4/5] use green.6 for fgColor-success --- src/tokens/functional/color/light/primitives-light.json5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tokens/functional/color/light/primitives-light.json5 b/src/tokens/functional/color/light/primitives-light.json5 index 64fa717fc..152d88e27 100644 --- a/src/tokens/functional/color/light/primitives-light.json5 +++ b/src/tokens/functional/color/light/primitives-light.json5 @@ -136,7 +136,7 @@ }, }, success: { - $value: '{base.color.green.5}', + $value: '{base.color.green.6}', $type: 'color', $extensions: { 'org.primer.figma': { From 0f0a6e821d67509d6e0e1c6cf5084cd651b470b7 Mon Sep 17 00:00:00 2001 From: Lukas Oppermann Date: Tue, 8 Oct 2024 13:19:58 +0200 Subject: [PATCH 5/5] fix comments --- .github/workflows/a11y-contrast.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/a11y-contrast.yml b/.github/workflows/a11y-contrast.yml index 460753f02..9b56ce4b8 100644 --- a/.github/workflows/a11y-contrast.yml +++ b/.github/workflows/a11y-contrast.yml @@ -123,13 +123,13 @@ jobs: ] // get comments of token issues - const currentComments = comments.filter(comment => possibleTitles.some(titleStart => comment.body.includes(titleStart))); + let currentComments = comments.filter(comment => possibleTitles.some(titleStart => comment.body.includes(titleStart))); for (const {title, body} of results) { // get token issue const titleStart = title.substring(0, title.indexOf(':') + 1); // remove from currentComments - + currentComments = currentComments.filter(comment => !comment.body.includes(titleStart)); // const tokenCheckComment = comments.filter(comment => comment.body.includes(titleStart)); const outputBody = `${title}\n\n${body}\n\n→ Details` @@ -158,6 +158,7 @@ jobs: // if token issue exists, update it if(currentComments.length > 0) { await currentComments.map(comment => { + console.log('deleting comment', comment.id, comment) github.rest.issues.deleteComment({ comment_id: comment.id, owner: context.repo.owner,