You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// WCAG AAA requires 7:1 for normal text (not 4.5:1 which is AA)
313
313
if(contrastRatio<7.0){
314
-
contrastIssues.push(
315
-
`${element.tagName}[${index}] "${element.textContent?.trim().substring(0,20)}..." contrast ratio ${contrastRatio.toFixed(2)}:1 is below WCAG AAA standard (7:1)`
316
-
);
314
+
return[`${element.tagName}[${index}] "${element.textContent?.trim().substring(0,20)}..." contrast ratio ${contrastRatio.toFixed(2)}:1 is below WCAG AAA standard (7:1)`];
317
315
}
318
316
}
319
317
}
318
+
return[];
320
319
});
321
320
322
321
expect(contrastIssues.length,`Contrast issues found at ${size.name}: ${contrastIssues.join(', ')}`).toBe(0);
`Large text ${element.tagName}[${index}] "${element.textContent?.trim().substring(0,20)}..." contrast ratio ${contrastRatio.toFixed(2)}:1 is below WCAG AAA standard (4.5:1)`
355
-
);
352
+
return[`Large text ${element.tagName}[${index}] "${element.textContent?.trim().substring(0,20)}..." contrast ratio ${contrastRatio.toFixed(2)}:1 is below WCAG AAA standard (4.5:1)`];
356
353
}
357
354
}
358
355
}
359
356
}
357
+
return[];
360
358
});
361
359
362
360
expect(contrastIssues.length,`Large text contrast issues at ${size.name}: ${contrastIssues.join(', ')}`).toBe(0);
0 commit comments