(HACK WEEK 2025) Dark mode a11y audit rules (#2939)
* chore: 🤖 change axe runOptions based on color theme * fix: 🐛 fix background-color and color styles application
This commit is contained in:
1 parent
a51f1eee8e
commit
7a42bf456e
5 files changed
+51
-23
No files matched your search
@@ -15,6 +15,7 @@ const {
|
||||
const APP_NAME = process.env.APP_NAME || 'Boundary';
|
||||
const API_HOST = process.env.API_HOST || '';
|
||||
const ENABLE_A11Y_AUDIT = process.env.ENABLE_A11Y_AUDIT || false;
|
||||
const COLOR_THEME = process.env.COLOR_THEME ?? 'light';
|
||||
|
||||
const clone = (obj) => v8.deserialize(v8.serialize(obj));
|
||||
|
||||
@@ -171,6 +172,7 @@ module.exports = function (environment) {
|
||||
});
|
||||
|
||||
ENV.ENABLE_A11Y_AUDIT = ENABLE_A11Y_AUDIT;
|
||||
ENV.COLOR_THEME = COLOR_THEME;
|
||||
}
|
||||
|
||||
if (environment === 'test') {
|
||||
@@ -192,6 +194,7 @@ module.exports = function (environment) {
|
||||
ENV.enableConfirmService = false;
|
||||
|
||||
ENV.ENABLE_A11Y_AUDIT = ENABLE_A11Y_AUDIT;
|
||||
ENV.COLOR_THEME = COLOR_THEME;
|
||||
}
|
||||
|
||||
if (environment === 'production') {
|
||||
|
||||
@@ -35,18 +35,23 @@ setupGlobalA11yHooks(() => true, {
|
||||
|
||||
setupQUnitA11yAuditToggle(QUnit);
|
||||
|
||||
const runOnly =
|
||||
config.COLOR_THEME === 'dark'
|
||||
? 'color-contrast'
|
||||
: {
|
||||
type: 'tag',
|
||||
values: [
|
||||
'wcag2a',
|
||||
'wcag2aa',
|
||||
'wcag21a',
|
||||
'wcag21aa',
|
||||
'wcag22aa',
|
||||
'best-practice',
|
||||
],
|
||||
};
|
||||
|
||||
setRunOptions({
|
||||
runOnly: {
|
||||
type: 'tag',
|
||||
values: [
|
||||
'wcag2a',
|
||||
'wcag2aa',
|
||||
'wcag21a',
|
||||
'wcag21aa',
|
||||
'wcag22aa',
|
||||
'best-practice',
|
||||
],
|
||||
},
|
||||
runOnly,
|
||||
include: [['#ember-testing-container']],
|
||||
exclude: [['.flight-sprite-container']],
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user