Skip to content

Commit 9e10b71

Browse files
update dark and light green scales
1 parent 028ad8e commit 9e10b71

File tree

5 files changed

+67
-49
lines changed

5 files changed

+67
-49
lines changed

.github/workflows/a11y-contrast.yml

Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@ jobs:
4747
const results = require('./color-contrast-check.json');
4848
const faildChecks = results.reduce((acc, {failingContrast}) => acc + failingContrast, 0);
4949
50+
5051
// prepare outputs for all failed themes
5152
const failedResults = results.filter(themeResults => themeResults.failingContrast > 0).map(({theme, failingContrast, markdownTable}) => ({
52-
title: `# ❌ \`${theme}\`: ${failingContrast} checks failed`,
53+
title: `# ❌ \`${theme}\`: ${failingContrast} checks failed`,
5354
body: `${markdownTable}`
55+
identifier: `<!-- contrast check --><!-- Theme: ${theme} -->`
5456
}))
5557
5658
// prepare summary body
@@ -101,6 +103,7 @@ jobs:
101103
with:
102104
script: |
103105
const results = ${{ steps.check-results.outputs.failedResults }}
106+
104107
const WORKFLOW_SUMMARY_URL = `https://github.com/${{env.GITHUB_REPOSITORY}}/actions/runs/${{env.GITHUB_RUN_ID}}`
105108
106109
// get comments
@@ -110,30 +113,47 @@ jobs:
110113
repo: context.repo.repo
111114
});
112115
113-
for (const {title, body} of results) {
114-
// get token issue
115-
const tokenCheckComment = comments.filter(comment => comment.body.includes(title));
116-
const outputBody = `${title}\n\n${body}\n\n<a href="${WORKFLOW_SUMMARY_URL}">→ Details</a>`
116+
// get comments of token issues
117+
let currentComments = comments.filter(comment => possibleTitles.some(titleStart => comment.body.includes(titleStart)));
117118
118-
// if token issue exists, update it
119-
if(tokenCheckComment.length > 0) {
120-
await github.rest.issues.updateComment({
121-
comment_id: tokenCheckComment[0].id,
119+
// get token issue
120+
const tokenCheckComment = comments.filter(comment => comment.body.includes("<!-- contrast check -->"));
121+
122+
// if token issue exists, update it
123+
if(tokenCheckComment.length > 0) {
124+
for (const comment of tokenCheckComment) {
125+
await github.rest.issues.deleteComment({
126+
comment_id: comment.id,
122127
owner: context.repo.owner,
123128
repo: context.repo.repo,
124-
body: outputBody
125129
})
126130
}
131+
}
132+
133+
for (const {title, body, indentifier} of results) {
134+
// get token issue
135+
136+
const outputBody = `${title}\n\n${body}\n\n<a href="${WORKFLOW_SUMMARY_URL}">→ Details</a>${indentifier}`
127137
128138
// if token issue does not exist, create it
129-
else {
130-
await github.rest.issues.createComment({
131-
issue_number: context.issue.number,
139+
await github.rest.issues.createComment({
140+
issue_number: context.issue.number,
141+
owner: context.repo.owner,
142+
repo: context.repo.repo,
143+
body: outputBody
144+
})
145+
}
146+
147+
// if token issue exists, update it
148+
if(currentComments.length > 0) {
149+
await currentComments.map(comment => {
150+
console.log('deleting comment', comment.id, comment)
151+
github.rest.issues.deleteComment({
152+
comment_id: comment.id,
132153
owner: context.repo.owner,
133154
repo: context.repo.repo,
134-
body: outputBody
135155
})
136-
}
156+
})
137157
}
138158
139159
Fail_action_on_contrast_failing:
@@ -165,15 +185,17 @@ jobs:
165185
});
166186
167187
// get token issue
168-
const tokenCheckComment = comments.filter(comment => comment.body.includes('## Design Token Contrast Check'));
188+
const tokenCheckComment = comments.filter(comment => comment.body.includes("<!-- contrast check -->"));
169189
170190
// if token issue exists, update it
171191
if(tokenCheckComment.length > 0) {
172-
await github.rest.issues.deleteComment({
173-
comment_id: tokenCheckComment[0].id,
174-
owner: context.repo.owner,
175-
repo: context.repo.repo,
176-
})
192+
for (const comment of tokenCheckComment) {
193+
await github.rest.issues.deleteComment({
194+
comment_id: comment.id,
195+
owner: context.repo.owner,
196+
repo: context.repo.repo,
197+
})
198+
}
177199
}
178200
179201
// remove summary

src/tokens/base/color/dark/dark.json5

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@
264264
},
265265
green: {
266266
'0': {
267-
$value: '#aff5b4',
267+
$value: '#70e691',
268268
$type: 'color',
269269
$extensions: {
270270
'org.primer.figma': {
@@ -273,7 +273,7 @@
273273
},
274274
},
275275
'1': {
276-
$value: '#7ee787',
276+
$value: '#1edc5a',
277277
$type: 'color',
278278
$extensions: {
279279
'org.primer.figma': {
@@ -282,7 +282,7 @@
282282
},
283283
},
284284
'2': {
285-
$value: '#56d364',
285+
$value: '#13c351',
286286
$type: 'color',
287287
$extensions: {
288288
'org.primer.figma': {
@@ -291,7 +291,7 @@
291291
},
292292
},
293293
'3': {
294-
$value: '#3fb950',
294+
$value: '#0cb64d',
295295
$type: 'color',
296296
$extensions: {
297297
'org.primer.figma': {
@@ -300,7 +300,7 @@
300300
},
301301
},
302302
'4': {
303-
$value: '#2ea043',
303+
$value: '#048f3e',
304304
$type: 'color',
305305
$extensions: {
306306
'org.primer.figma': {
@@ -309,7 +309,7 @@
309309
},
310310
},
311311
'5': {
312-
$value: '#238636',
312+
$value: '#00873D',
313313
$type: 'color',
314314
$extensions: {
315315
'org.primer.figma': {
@@ -318,7 +318,7 @@
318318
},
319319
},
320320
'6': {
321-
$value: '#196c2e',
321+
$value: '#005c2c',
322322
$type: 'color',
323323
$extensions: {
324324
'org.primer.figma': {
@@ -327,7 +327,7 @@
327327
},
328328
},
329329
'7': {
330-
$value: '#0f5323',
330+
$value: '#004725',
331331
$type: 'color',
332332
$extensions: {
333333
'org.primer.figma': {
@@ -336,7 +336,7 @@
336336
},
337337
},
338338
'8': {
339-
$value: '#033a16',
339+
$value: '#00331c',
340340
$type: 'color',
341341
$extensions: {
342342
'org.primer.figma': {
@@ -345,7 +345,7 @@
345345
},
346346
},
347347
'9': {
348-
$value: '#04260f',
348+
$value: '#002918',
349349
$type: 'color',
350350
$extensions: {
351351
'org.primer.figma': {

src/tokens/base/color/light/light.json5

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@
264264
},
265265
green: {
266266
'0': {
267-
$value: '#dafbe1',
267+
$value: '#cbf6d7',
268268
$type: 'color',
269269
$extensions: {
270270
'org.primer.figma': {
@@ -273,7 +273,7 @@
273273
},
274274
},
275275
'1': {
276-
$value: '#aceebb',
276+
$value: '#8aefaa',
277277
$type: 'color',
278278
$extensions: {
279279
'org.primer.figma': {
@@ -282,7 +282,7 @@
282282
},
283283
},
284284
'2': {
285-
$value: '#6fdd8b',
285+
$value: '#16da5a',
286286
$type: 'color',
287287
$extensions: {
288288
'org.primer.figma': {
@@ -291,7 +291,7 @@
291291
},
292292
},
293293
'3': {
294-
$value: '#4ac26b',
294+
$value: '#0cc051',
295295
$type: 'color',
296296
$extensions: {
297297
'org.primer.figma': {
@@ -300,7 +300,7 @@
300300
},
301301
},
302302
'4': {
303-
$value: '#2da44e',
303+
$value: '#05a347',
304304
$type: 'color',
305305
$extensions: {
306306
'org.primer.figma': {
@@ -309,7 +309,7 @@
309309
},
310310
},
311311
'5': {
312-
$value: '#1a7f37',
312+
$value: '#00873D',
313313
$type: 'color',
314314
$extensions: {
315315
'org.primer.figma': {
@@ -318,7 +318,7 @@
318318
},
319319
},
320320
'6': {
321-
$value: '#116329',
321+
$value: '#007036',
322322
$type: 'color',
323323
$extensions: {
324324
'org.primer.figma': {
@@ -327,7 +327,7 @@
327327
},
328328
},
329329
'7': {
330-
$value: '#044f1e',
330+
$value: '#006132',
331331
$type: 'color',
332332
$extensions: {
333333
'org.primer.figma': {
@@ -336,7 +336,7 @@
336336
},
337337
},
338338
'8': {
339-
$value: '#003d16',
339+
$value: '#004d2a',
340340
$type: 'color',
341341
$extensions: {
342342
'org.primer.figma': {
@@ -345,7 +345,7 @@
345345
},
346346
},
347347
'9': {
348-
$value: '#002d11',
348+
$value: '#003821',
349349
$type: 'color',
350350
$extensions: {
351351
'org.primer.figma': {

src/tokens/functional/color/light/patterns-light.json5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@
772772
scopes: ['bgColor'],
773773
},
774774
},
775-
}
775+
},
776776
},
777777
},
778778
button: {
@@ -2089,7 +2089,7 @@
20892089
underlineNav: {
20902090
borderColor: {
20912091
active: {
2092-
$value: '{base.color.coral.3}',
2092+
$value: '#FD794F',
20932093
$type: 'color',
20942094
$extensions: {
20952095
'org.primer.figma': {

src/tokens/functional/color/light/primitives-light.json5

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
},
137137
},
138138
success: {
139-
$value: '{base.color.green.5}',
139+
$value: '{base.color.green.6}',
140140
$type: 'color',
141141
$extensions: {
142142
'org.primer.figma': {
@@ -475,7 +475,7 @@
475475
},
476476
},
477477
emphasis: {
478-
$value: '{base.color.green.4}',
478+
$value: '{base.color.green.5}',
479479
$type: 'color',
480480
$extensions: {
481481
'org.primer.figma': {
@@ -488,10 +488,6 @@
488488
},
489489
},
490490
},
491-
mix: {
492-
color: '{base.color.green.5}',
493-
weight: 0.75,
494-
},
495491
},
496492
},
497493
open: {

0 commit comments

Comments
 (0)