-
Notifications
You must be signed in to change notification settings - Fork 0
/
a11y-custom-config-extras.js
176 lines (176 loc) · 8.42 KB
/
a11y-custom-config-extras.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
/**
* Custom config file for running A11y audits in Lighthouse.
* Work in progress
*/
module.exports = {
passes: [{
recordTrace: true,
pauseAfterLoadMs: 5000,
useThrottling: true,
gatherers: [
'runtime-exceptions',
'chrome-console-messages',
'accessibility',
'viewport',
'seo/font-size',
'fonts',
],
}],
audits: [
'accessibility/accesskeys',
'accessibility/aria-allowed-attr',
'accessibility/aria-required-attr',
'accessibility/aria-required-children',
'accessibility/aria-required-parent',
'accessibility/aria-roles',
'accessibility/aria-valid-attr-value',
'accessibility/aria-valid-attr',
'accessibility/audio-caption',
'accessibility/button-name',
'accessibility/bypass',
'accessibility/color-contrast',
'accessibility/definition-list',
'accessibility/dlitem',
'accessibility/document-title',
'accessibility/duplicate-id',
'accessibility/frame-title',
'accessibility/html-has-lang',
'accessibility/html-lang-valid',
'accessibility/image-alt',
'accessibility/input-image-alt',
'accessibility/label',
'accessibility/layout-table',
'accessibility/link-name',
'accessibility/list',
'accessibility/listitem',
'accessibility/meta-refresh',
'accessibility/meta-viewport',
'accessibility/object-alt',
'accessibility/tabindex',
'accessibility/td-headers-attr',
'accessibility/th-has-data-cells',
'accessibility/valid-lang',
'accessibility/video-caption',
'accessibility/video-description',
'accessibility/manual/custom-controls-labels',
'accessibility/manual/custom-controls-roles',
'accessibility/manual/focus-traps',
'accessibility/manual/focusable-controls',
'accessibility/manual/heading-levels',
'accessibility/manual/logical-tab-order',
'accessibility/manual/managed-focus',
'accessibility/manual/offscreen-content-hidden',
'accessibility/manual/use-landmarks',
'accessibility/manual/visual-order-follows-dom',
'errors-in-console',
'manual/pwa-cross-browser',
'seo/font-size',
'font-display',
],
groups: {
'a11y-color-contrast': {
title: 'Color Contrast Is Satisfactory',
description: 'These are opportunities to improve the legibility of your content.',
},
'a11y-describe-contents': {
title: 'Elements Describe Contents Well',
description: 'These are opportunities to make your content easier to understand for a user of assistive technology, like a screen reader.',
},
'a11y-well-structured': {
title: 'Elements Are Well Structured',
description: 'These are opportunities to make sure your HTML is appropriately structured.',
},
'a11y-aria': {
title: 'ARIA Attributes Follow Best Practices',
description: 'These are opportunities to improve the usage of ARIA in your application which may enhance the experience for users of assistive technology, like a screen reader.',
},
'a11y-correct-attributes': {
title: 'Elements Use Attributes Correctly',
description: 'These are opportunities to improve the configuration of your HTML elements.',
},
'a11y-element-names': {
title: 'Elements Have Discernible Names',
description: 'These are opportunities to improve the semantics of the controls in your application. This may enhance the experience for users of assistive technology, like a screen reader.',
},
'a11y-language': {
title: 'Page Specifies Valid Language',
description: 'These are opportunities to improve the interpretation of your content by users in different locales.',
},
'a11y-meta': {
title: 'Meta Tags Used Properly',
description: 'These are opportunities to improve the user experience of your site.',
},
'a11y-manual-checks': {
title: 'Manual Checks',
description: 'Lorem ipsem.',
},
'robust': {
title: 'Robust',
description: 'Content must be robust enough that it can be interpreted reliably by a wide variety of user agents, including assistive technologies.',
},
'legible': {
title: 'Adequate Font Sizes',
description: 'Small text is harder to read. Links in small text results in small touch and pointer targets, which make it hard for people to click links and navigate the website. [Learn more](https://material.io/design/usability/accessibility.html#layout-typography).',
},
},
categories: {
'accessibility': {
title: 'Accessibility',
description: 'These checks highlight opportunities to [improve the accessibility of your web app](https://developers.google.com/web/fundamentals/accessibility). Only a subset of accessibility issues can be automatically detected so manual testing is also encouraged.',
manualDescription: 'These items address areas which an automated testing tool cannot cover. Learn more in our guide on [conducting an accessibility review](https://developers.google.com/web/fundamentals/accessibility/how-to-review).',
auditRefs: [
// Standard A11y automated audits
{id: 'accesskeys', weight: 1, group: 'a11y-correct-attributes'},
{id: 'aria-allowed-attr', weight: 3, group: 'a11y-aria'},
{id: 'aria-required-attr', weight: 2, group: 'a11y-aria'},
{id: 'aria-required-children', weight: 5, group: 'a11y-aria'},
{id: 'aria-required-parent', weight: 2, group: 'a11y-aria'},
{id: 'aria-roles', weight: 3, group: 'a11y-aria'},
{id: 'aria-valid-attr-value', weight: 2, group: 'a11y-aria'},
{id: 'aria-valid-attr', weight: 5, group: 'a11y-aria'},
{id: 'audio-caption', weight: 4, group: 'a11y-correct-attributes'},
{id: 'button-name', weight: 10, group: 'a11y-element-names'},
{id: 'bypass', weight: 10, group: 'a11y-describe-contents'},
{id: 'color-contrast', weight: 6, group: 'a11y-color-contrast'},
{id: 'definition-list', weight: 1, group: 'a11y-well-structured'},
{id: 'dlitem', weight: 1, group: 'a11y-well-structured'},
{id: 'document-title', weight: 2, group: 'a11y-describe-contents'},
{id: 'duplicate-id', weight: 5, group: 'a11y-well-structured'},
{id: 'frame-title', weight: 5, group: 'a11y-describe-contents'},
{id: 'html-has-lang', weight: 4, group: 'a11y-language'},
{id: 'html-lang-valid', weight: 1, group: 'a11y-language'},
{id: 'image-alt', weight: 8, group: 'a11y-correct-attributes'},
{id: 'input-image-alt', weight: 1, group: 'a11y-correct-attributes'},
{id: 'label', weight: 10, group: 'a11y-describe-contents'},
{id: 'layout-table', weight: 1, group: 'a11y-describe-contents'},
{id: 'link-name', weight: 9, group: 'a11y-element-names'},
{id: 'list', weight: 5, group: 'a11y-well-structured'},
{id: 'listitem', weight: 4, group: 'a11y-well-structured'},
{id: 'meta-refresh', weight: 1, group: 'a11y-meta'},
{id: 'meta-viewport', weight: 3, group: 'a11y-meta'},
{id: 'object-alt', weight: 4, group: 'a11y-describe-contents'},
{id: 'tabindex', weight: 4, group: 'a11y-correct-attributes'},
{id: 'td-headers-attr', weight: 1, group: 'a11y-correct-attributes'},
{id: 'th-has-data-cells', weight: 1, group: 'a11y-correct-attributes'},
{id: 'valid-lang', weight: 1, group: 'a11y-language'},
{id: 'video-caption', weight: 4, group: 'a11y-describe-contents'},
{id: 'video-description', weight: 3, group: 'a11y-describe-contents'},
// Standard A11y manual audits
{id: 'logical-tab-order', weight: 0, group: 'a11y-manual-checks'},
{id: 'focusable-controls', weight: 0, group: 'a11y-manual-checks'},
{id: 'managed-focus', weight: 0, group: 'a11y-manual-checks'},
{id: 'focus-traps', weight: 0, group: 'a11y-manual-checks'},
{id: 'custom-controls-labels', weight: 0, group: 'a11y-manual-checks'},
{id: 'custom-controls-roles', weight: 0, group: 'a11y-manual-checks'},
{id: 'visual-order-follows-dom', weight: 0, group: 'a11y-manual-checks'},
{id: 'offscreen-content-hidden', weight: 0, group: 'a11y-manual-checks'},
{id: 'heading-levels', weight: 0, group: 'a11y-manual-checks'},
{id: 'use-landmarks', weight: 0, group: 'a11y-manual-checks'},
// Extras
{id: 'errors-in-console', weight: 1, group: 'robust'},
{id: 'font-size', weight: 0, group: 'legible'},
{id: 'pwa-cross-browser', weight: 0, group: 'a11y-manual-checks'},
],
},
},
};