gbu-accessibility-package 1.6.0 โ 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +124 -0
- package/README-vi.md +500 -0
- package/README.md +201 -115
- package/cli.js +174 -77
- package/demo/advanced-test.html +44 -0
- package/demo/advanced-test.html.backup +44 -0
- package/demo/comprehensive-test.html +21 -0
- package/demo/comprehensive-test.html.backup +21 -0
- package/lib/fixer.js +678 -3
- package/package.json +24 -5
package/README.md
CHANGED
|
@@ -12,6 +12,11 @@
|
|
|
12
12
|
- ๐ท๏ธ **Aria Label Support** - Automatic aria-label matching alt text
|
|
13
13
|
- ๐ **HTML Lang Attributes** - Automatic language attribute fixes
|
|
14
14
|
- ๐ญ **Role Attributes** - WCAG-compliant role attribute management
|
|
15
|
+
- ๐ **Form Labels** - Fix missing labels with intelligent aria-label generation
|
|
16
|
+
- ๐ **Button Names** - Fix empty buttons and input buttons without names
|
|
17
|
+
- ๐ **Link Names** - Fix empty links and detect generic link text
|
|
18
|
+
- ๐๏ธ **Landmarks** - Add missing main and navigation landmarks
|
|
19
|
+
- ๐ **Heading Analysis** - Analyze heading structure with suggestions (no auto-fix)
|
|
15
20
|
- ๐งน **Duplicate Cleanup** - Remove duplicate role attributes
|
|
16
21
|
- ๐ **Batch Processing** - Process entire directories recursively
|
|
17
22
|
- ๐พ **Automatic Backups** - Safe modifications with backup files
|
|
@@ -33,7 +38,7 @@ npm install gbu-accessibility-package
|
|
|
33
38
|
### Basic Usage
|
|
34
39
|
|
|
35
40
|
```bash
|
|
36
|
-
#
|
|
41
|
+
# Comprehensive fixes (default mode)
|
|
37
42
|
gbu-a11y
|
|
38
43
|
|
|
39
44
|
# Preview changes (dry run)
|
|
@@ -42,9 +47,6 @@ gbu-a11y --dry-run
|
|
|
42
47
|
# Fix specific directory
|
|
43
48
|
gbu-a11y ./src
|
|
44
49
|
|
|
45
|
-
# Comprehensive fixes (recommended)
|
|
46
|
-
gbu-a11y --comprehensive
|
|
47
|
-
|
|
48
50
|
# Fix specific file
|
|
49
51
|
gbu-a11y index.html
|
|
50
52
|
```
|
|
@@ -62,35 +64,43 @@ Options:
|
|
|
62
64
|
--backup Create backup files (default: enabled)
|
|
63
65
|
--no-backup Don't create backup files
|
|
64
66
|
--dry-run Preview changes without applying
|
|
65
|
-
--comprehensive, --all Run
|
|
67
|
+
--comprehensive, --all Run comprehensive fixes (same as default)
|
|
66
68
|
--cleanup-only Only cleanup duplicate role attributes
|
|
67
|
-
--alt-only
|
|
68
|
-
--lang-only
|
|
69
|
-
--role-only
|
|
69
|
+
--alt-only Fix alt attributes + cleanup
|
|
70
|
+
--lang-only Fix HTML lang attributes + cleanup
|
|
71
|
+
--role-only Fix role attributes + cleanup
|
|
72
|
+
--forms-only Fix form labels + cleanup
|
|
73
|
+
--buttons-only Fix button names + cleanup
|
|
74
|
+
--links-only Fix link names + cleanup
|
|
75
|
+
--landmarks-only Fix landmarks + cleanup
|
|
76
|
+
--headings-only Analyze heading structure (no auto-fix)
|
|
70
77
|
-h, --help Show help message
|
|
71
78
|
```
|
|
72
79
|
|
|
73
80
|
### Examples
|
|
74
81
|
|
|
75
82
|
```bash
|
|
76
|
-
#
|
|
83
|
+
# Comprehensive fixes (default - includes cleanup)
|
|
77
84
|
gbu-a11y
|
|
78
85
|
|
|
79
86
|
# Preview all changes
|
|
80
|
-
gbu-a11y --dry-run
|
|
87
|
+
gbu-a11y --dry-run
|
|
81
88
|
|
|
82
89
|
# Fix with English language
|
|
83
90
|
gbu-a11y -l en ./public
|
|
84
91
|
|
|
85
|
-
# Individual fix types
|
|
86
|
-
gbu-a11y --alt-only #
|
|
87
|
-
gbu-a11y --
|
|
88
|
-
gbu-a11y --
|
|
92
|
+
# Individual fix types (all include cleanup)
|
|
93
|
+
gbu-a11y --alt-only # Fix alt attributes + cleanup
|
|
94
|
+
gbu-a11y --forms-only # Fix form labels + cleanup
|
|
95
|
+
gbu-a11y --buttons-only # Fix button names + cleanup
|
|
96
|
+
gbu-a11y --links-only # Fix link names + cleanup
|
|
97
|
+
gbu-a11y --landmarks-only # Fix landmarks + cleanup
|
|
98
|
+
gbu-a11y --headings-only # Analyze heading structure
|
|
89
99
|
gbu-a11y --cleanup-only # Only cleanup duplicates
|
|
90
100
|
|
|
91
101
|
# Combine with other options
|
|
92
|
-
gbu-a11y --alt-only --dry-run ./src # Preview alt fixes
|
|
93
|
-
gbu-a11y --
|
|
102
|
+
gbu-a11y --alt-only --dry-run ./src # Preview alt fixes + cleanup
|
|
103
|
+
gbu-a11y --forms-only -l en ./public # Form fixes + cleanup with English lang
|
|
94
104
|
|
|
95
105
|
# Backup options
|
|
96
106
|
gbu-a11y --backup ./dist # Explicitly enable backups (default)
|
|
@@ -100,21 +110,21 @@ gbu-a11y --no-backup ./dist # Disable backups for faster processing
|
|
|
100
110
|
## ๐ง Programmatic Usage
|
|
101
111
|
|
|
102
112
|
```javascript
|
|
103
|
-
const AccessibilityFixer = require(
|
|
113
|
+
const AccessibilityFixer = require('gbu-accessibility-package');
|
|
104
114
|
|
|
105
115
|
const fixer = new AccessibilityFixer({
|
|
106
|
-
language:
|
|
116
|
+
language: 'en',
|
|
107
117
|
backupFiles: true,
|
|
108
|
-
dryRun: false
|
|
118
|
+
dryRun: false
|
|
109
119
|
});
|
|
110
120
|
|
|
111
121
|
// Fix all accessibility issues
|
|
112
122
|
async function fixAccessibility() {
|
|
113
123
|
try {
|
|
114
|
-
const results = await fixer.fixAllAccessibilityIssues(
|
|
115
|
-
console.log(
|
|
124
|
+
const results = await fixer.fixAllAccessibilityIssues('./src');
|
|
125
|
+
console.log('Fixed files:', results);
|
|
116
126
|
} catch (error) {
|
|
117
|
-
console.error(
|
|
127
|
+
console.error('Error:', error);
|
|
118
128
|
}
|
|
119
129
|
}
|
|
120
130
|
|
|
@@ -123,75 +133,63 @@ fixAccessibility();
|
|
|
123
133
|
|
|
124
134
|
## ๐ฏ Fix Modes
|
|
125
135
|
|
|
126
|
-
###
|
|
127
|
-
|
|
128
|
-
You can now fix specific accessibility issues individually:
|
|
129
|
-
|
|
130
|
-
- `--alt-only` - Only fix alt attributes for images
|
|
131
|
-
- `--lang-only` - Only fix HTML lang attributes
|
|
132
|
-
- `--role-only` - Only fix role attributes
|
|
133
|
-
- `--cleanup-only` - Only cleanup duplicate role attributes
|
|
134
|
-
|
|
135
|
-
### Combined Modes
|
|
136
|
-
|
|
137
|
-
- **Standard mode** (default) - Fixes alt, lang, and role attributes
|
|
138
|
-
- `--comprehensive` - All fixes including duplicate cleanup
|
|
136
|
+
### Comprehensive Mode (Default)
|
|
137
|
+
Runs all fixes including cleanup:
|
|
139
138
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
139
|
+
1. **HTML lang attributes** - Adds missing language attributes
|
|
140
|
+
2. **Alt attributes** - Generates contextual alt text + aria-label
|
|
141
|
+
3. **Role attributes** - Adds appropriate ARIA roles + picture handling
|
|
142
|
+
4. **Form labels** - Fixes missing input labels
|
|
143
|
+
5. **Button names** - Fixes empty buttons
|
|
144
|
+
6. **Link names** - Fixes empty links and detects generic text
|
|
145
|
+
7. **Landmarks** - Adds main and navigation landmarks
|
|
146
|
+
8. **Heading analysis** - Analyzes structure (suggestions only)
|
|
147
|
+
9. **Cleanup** - Removes duplicate role attributes
|
|
146
148
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
# Clean up duplicate roles only
|
|
151
|
-
gbu-a11y --cleanup-only
|
|
149
|
+
### Individual Fix Options
|
|
150
|
+
Each individual mode includes cleanup step:
|
|
152
151
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
152
|
+
- `--alt-only` - Alt attributes + cleanup
|
|
153
|
+
- `--forms-only` - Form labels + cleanup
|
|
154
|
+
- `--buttons-only` - Button names + cleanup
|
|
155
|
+
- `--links-only` - Link names + cleanup
|
|
156
|
+
- `--landmarks-only` - Landmarks + cleanup
|
|
157
|
+
- `--headings-only` - Heading analysis only (no cleanup)
|
|
156
158
|
|
|
157
159
|
## ๐ง What Gets Fixed
|
|
158
160
|
|
|
159
|
-
### 1. Alt Attributes
|
|
160
|
-
|
|
161
|
+
### 1. Alt Attributes & Aria Labels
|
|
161
162
|
- **Missing alt attributes** โ Adds contextual alt text
|
|
162
163
|
- **Empty alt attributes** โ Generates meaningful descriptions
|
|
164
|
+
- **Automatic aria-label** โ Adds aria-label matching alt text
|
|
163
165
|
- **Context-aware generation** โ Uses surrounding text, headings, captions
|
|
164
166
|
|
|
165
167
|
```html
|
|
166
168
|
<!-- Before -->
|
|
167
|
-
<img src="logo.png"
|
|
168
|
-
<img src="chart.jpg" alt=""
|
|
169
|
+
<img src="logo.png">
|
|
170
|
+
<img src="chart.jpg" alt="">
|
|
169
171
|
|
|
170
172
|
<!-- After -->
|
|
171
|
-
<img src="logo.png" alt="ใญใด"
|
|
172
|
-
<img src="chart.jpg" alt="ใฐใฉใ"
|
|
173
|
+
<img src="logo.png" alt="ใญใด" role="img" aria-label="ใญใด">
|
|
174
|
+
<img src="chart.jpg" alt="ใฐใฉใ" role="img" aria-label="ใฐใฉใ">
|
|
173
175
|
```
|
|
174
176
|
|
|
175
177
|
### 2. HTML Lang Attributes
|
|
176
|
-
|
|
177
178
|
- **Missing lang attributes** โ Adds specified language
|
|
178
179
|
- **Empty lang attributes** โ Sets proper language code
|
|
179
180
|
|
|
180
181
|
```html
|
|
181
182
|
<!-- Before -->
|
|
182
183
|
<html>
|
|
183
|
-
|
|
184
|
-
<!-- After -->
|
|
185
|
-
<html lang="ja">
|
|
186
|
-
<html lang="ja"></html>
|
|
187
|
-
</html>
|
|
188
|
-
</html>
|
|
189
|
-
</html>
|
|
190
|
-
```
|
|
184
|
+
<html lang="">
|
|
191
185
|
|
|
192
|
-
|
|
186
|
+
<!-- After -->
|
|
187
|
+
<html lang="ja">
|
|
188
|
+
<html lang="ja">
|
|
189
|
+
```
|
|
193
190
|
|
|
194
|
-
|
|
191
|
+
### 3. Role Attributes
|
|
192
|
+
- **Images** โ `role="img"`
|
|
195
193
|
- **Picture elements** โ Moves `role="img"` from `<picture>` to `<img>` inside
|
|
196
194
|
- **Links** โ `role="link"`
|
|
197
195
|
- **Clickable elements** โ `role="button"`
|
|
@@ -200,48 +198,109 @@ gbu-a11y --comprehensive
|
|
|
200
198
|
|
|
201
199
|
```html
|
|
202
200
|
<!-- Before -->
|
|
203
|
-
<img src="icon.png" alt="Icon"
|
|
201
|
+
<img src="icon.png" alt="Icon">
|
|
204
202
|
<picture role="img">
|
|
205
|
-
<img src="photo.jpg" alt="Photo"
|
|
203
|
+
<img src="photo.jpg" alt="Photo">
|
|
206
204
|
</picture>
|
|
207
205
|
<a href="/home">Home</a>
|
|
208
206
|
<div class="btn-click">Click me</div>
|
|
209
207
|
|
|
210
208
|
<!-- After -->
|
|
211
|
-
<img src="icon.png" alt="Icon" role="img" aria-label="Icon"
|
|
209
|
+
<img src="icon.png" alt="Icon" role="img" aria-label="Icon">
|
|
212
210
|
<picture>
|
|
213
|
-
<img src="photo.jpg" alt="Photo" role="img" aria-label="Photo"
|
|
211
|
+
<img src="photo.jpg" alt="Photo" role="img" aria-label="Photo">
|
|
214
212
|
</picture>
|
|
215
213
|
<a href="/home" role="link">Home</a>
|
|
216
214
|
<div class="btn-click" role="button">Click me</div>
|
|
217
215
|
```
|
|
218
216
|
|
|
219
|
-
### 4.
|
|
217
|
+
### 4. Form Labels
|
|
218
|
+
- **Input elements without labels** โ Adds appropriate `aria-label`
|
|
219
|
+
- **Supports multiple input types** โ text, email, password, tel, etc.
|
|
220
|
+
|
|
221
|
+
```html
|
|
222
|
+
<!-- Before -->
|
|
223
|
+
<input type="text" placeholder="Name">
|
|
224
|
+
<input type="email">
|
|
225
|
+
<input type="password">
|
|
226
|
+
|
|
227
|
+
<!-- After -->
|
|
228
|
+
<input type="text" placeholder="Name" aria-label="ใใญในใๅ
ฅๅ">
|
|
229
|
+
<input type="email" aria-label="ใกใผใซใขใใฌใน">
|
|
230
|
+
<input type="password" aria-label="ใในใฏใผใ">
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### 5. Button Names
|
|
234
|
+
- **Empty buttons** โ Adds text content and aria-label
|
|
235
|
+
- **Input buttons without value** โ Adds appropriate value
|
|
236
|
+
|
|
237
|
+
```html
|
|
238
|
+
<!-- Before -->
|
|
239
|
+
<button></button>
|
|
240
|
+
<input type="submit">
|
|
241
|
+
<input type="button">
|
|
242
|
+
|
|
243
|
+
<!-- After -->
|
|
244
|
+
<button aria-label="ใใฟใณ">ใใฟใณ</button>
|
|
245
|
+
<input type="submit" value="้ไฟก">
|
|
246
|
+
<input type="button" value="ใใฟใณ">
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### 6. Link Names
|
|
250
|
+
- **Empty links** โ Adds aria-label
|
|
251
|
+
- **Generic text detection** โ Identifies "Click here", "Read more"
|
|
252
|
+
- **Image-only links** โ Handles links containing only images
|
|
253
|
+
|
|
254
|
+
```html
|
|
255
|
+
<!-- Before -->
|
|
256
|
+
<a href="/home"></a>
|
|
257
|
+
<a href="/more">Click here</a>
|
|
258
|
+
<a href="/image"><img src="icon.png"></a>
|
|
259
|
+
|
|
260
|
+
<!-- After -->
|
|
261
|
+
<a href="/home" aria-label="ใชใณใฏ">ใชใณใฏ</a>
|
|
262
|
+
<a href="/more">Click here</a> <!-- Detected but not auto-fixed -->
|
|
263
|
+
<a href="/image" aria-label="็ปๅใชใณใฏ"><img src="icon.png"></a>
|
|
264
|
+
```
|
|
220
265
|
|
|
221
|
-
|
|
222
|
-
- **
|
|
223
|
-
- **
|
|
266
|
+
### 7. Landmarks
|
|
267
|
+
- **Missing main landmark** โ Adds `role="main"`
|
|
268
|
+
- **Missing navigation landmark** โ Adds `role="navigation"`
|
|
224
269
|
|
|
225
270
|
```html
|
|
226
271
|
<!-- Before -->
|
|
227
|
-
<
|
|
272
|
+
<div class="content">
|
|
273
|
+
<p>Main content</p>
|
|
274
|
+
</div>
|
|
275
|
+
<ul class="navigation">
|
|
276
|
+
<li><a href="/home">Home</a></li>
|
|
277
|
+
</ul>
|
|
228
278
|
|
|
229
279
|
<!-- After -->
|
|
230
|
-
<
|
|
280
|
+
<div class="content" role="main">
|
|
281
|
+
<p>Main content</p>
|
|
282
|
+
</div>
|
|
283
|
+
<ul class="navigation" role="navigation">
|
|
284
|
+
<li><a href="/home">Home</a></li>
|
|
285
|
+
</ul>
|
|
231
286
|
```
|
|
232
287
|
|
|
233
|
-
###
|
|
288
|
+
### 8. Heading Analysis
|
|
289
|
+
- **Multiple h1 detection** โ Identifies and suggests fixes
|
|
290
|
+
- **Heading level skipping** โ Detects jumps (h1 โ h3)
|
|
291
|
+
- **Empty headings** โ Identifies headings without content
|
|
292
|
+
- **Analysis only** โ Provides suggestions, no auto-fix for content safety
|
|
234
293
|
|
|
235
|
-
|
|
236
|
-
- **
|
|
237
|
-
- **Handles mixed
|
|
294
|
+
### 9. Duplicate Cleanup
|
|
295
|
+
- **Removes duplicate role attributes** โ Keeps first occurrence
|
|
296
|
+
- **Handles mixed quotes** โ role="button" role='button'
|
|
238
297
|
|
|
239
298
|
```html
|
|
240
299
|
<!-- Before -->
|
|
241
|
-
<img src="test.jpg" role="img" role="img" alt="Test"
|
|
300
|
+
<img src="test.jpg" role="img" role="img" alt="Test">
|
|
242
301
|
|
|
243
302
|
<!-- After -->
|
|
244
|
-
<img src="test.jpg" role="img" alt="Test"
|
|
303
|
+
<img src="test.jpg" role="img" alt="Test">
|
|
245
304
|
```
|
|
246
305
|
|
|
247
306
|
## ๐ Smart Alt Text Generation
|
|
@@ -249,9 +308,8 @@ gbu-a11y --comprehensive
|
|
|
249
308
|
The package uses intelligent context analysis to generate meaningful alt text:
|
|
250
309
|
|
|
251
310
|
### Context Sources
|
|
252
|
-
|
|
253
311
|
1. **Title attributes**
|
|
254
|
-
2. **Aria-label attributes**
|
|
312
|
+
2. **Aria-label attributes**
|
|
255
313
|
3. **Definition terms (dt elements)**
|
|
256
314
|
4. **Parent link text**
|
|
257
315
|
5. **Nearby headings**
|
|
@@ -259,7 +317,6 @@ The package uses intelligent context analysis to generate meaningful alt text:
|
|
|
259
317
|
7. **Surrounding text content**
|
|
260
318
|
|
|
261
319
|
### Fallback Patterns
|
|
262
|
-
|
|
263
320
|
- `logo.png` โ "ใญใด" (Logo)
|
|
264
321
|
- `icon.svg` โ "ใขใคใณใณ" (Icon)
|
|
265
322
|
- `banner.jpg` โ "ใใใผ" (Banner)
|
|
@@ -268,41 +325,43 @@ The package uses intelligent context analysis to generate meaningful alt text:
|
|
|
268
325
|
|
|
269
326
|
## ๐ Output Examples
|
|
270
327
|
|
|
271
|
-
###
|
|
272
|
-
|
|
328
|
+
### Comprehensive Mode
|
|
273
329
|
```
|
|
274
330
|
๐ Starting Accessibility Fixer...
|
|
275
|
-
|
|
331
|
+
๐ฏ Running comprehensive accessibility fixes...
|
|
332
|
+
|
|
333
|
+
๐ Step 1: HTML lang attributes...
|
|
276
334
|
โ
Fixed lang attributes in 5 files
|
|
277
335
|
|
|
278
|
-
๐ผ๏ธ Step 2:
|
|
336
|
+
๐ผ๏ธ Step 2: Alt attributes...
|
|
279
337
|
โ
Fixed alt attributes in 12 files (34 issues)
|
|
280
338
|
|
|
281
|
-
๐ญ Step 3:
|
|
339
|
+
๐ญ Step 3: Role attributes...
|
|
282
340
|
โ
Fixed role attributes in 8 files (67 issues)
|
|
283
341
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
Files fixed: 15
|
|
287
|
-
Total issues resolved: 106
|
|
342
|
+
๐ Step 4: Form labels...
|
|
343
|
+
โ
Fixed form labels in 6 files (15 issues)
|
|
288
344
|
|
|
289
|
-
|
|
290
|
-
|
|
345
|
+
๐ Step 5: Button names...
|
|
346
|
+
โ
Fixed button names in 4 files (8 issues)
|
|
291
347
|
|
|
292
|
-
|
|
348
|
+
๐ Step 6: Link names...
|
|
349
|
+
โ
Fixed link names in 7 files (12 issues)
|
|
293
350
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
351
|
+
๐๏ธ Step 7: Landmarks...
|
|
352
|
+
โ
Fixed landmarks in 3 files (5 issues)
|
|
353
|
+
|
|
354
|
+
๐ Step 8: Heading analysis...
|
|
355
|
+
โ
Analyzed headings in 10 files (18 suggestions)
|
|
356
|
+
|
|
357
|
+
๐งน Step 9: Cleanup duplicate roles...
|
|
358
|
+
โ
Cleaned duplicate roles in 2 files
|
|
300
359
|
|
|
301
360
|
๐ All accessibility fixes completed!
|
|
302
361
|
๐ Final Summary:
|
|
303
362
|
Total files scanned: 25
|
|
304
|
-
Files fixed:
|
|
305
|
-
Total issues resolved:
|
|
363
|
+
Files fixed: 20
|
|
364
|
+
Total issues resolved: 164
|
|
306
365
|
```
|
|
307
366
|
|
|
308
367
|
## ๐ Safety Features
|
|
@@ -332,32 +391,55 @@ gbu-a11y --backup --comprehensive
|
|
|
332
391
|
## ๐ ๏ธ Configuration
|
|
333
392
|
|
|
334
393
|
### Package.json Scripts
|
|
335
|
-
|
|
336
394
|
```json
|
|
337
395
|
{
|
|
338
396
|
"scripts": {
|
|
339
397
|
"a11y:fix": "gbu-a11y",
|
|
340
398
|
"a11y:check": "gbu-a11y --dry-run",
|
|
341
399
|
"a11y:comprehensive": "gbu-a11y --comprehensive",
|
|
400
|
+
"a11y:forms": "gbu-a11y --forms-only",
|
|
401
|
+
"a11y:buttons": "gbu-a11y --buttons-only",
|
|
402
|
+
"a11y:links": "gbu-a11y --links-only",
|
|
403
|
+
"a11y:landmarks": "gbu-a11y --landmarks-only",
|
|
404
|
+
"a11y:headings": "gbu-a11y --headings-only",
|
|
342
405
|
"a11y:cleanup": "gbu-a11y --cleanup-only",
|
|
343
|
-
"
|
|
344
|
-
"a11y:lang": "gbu-a11y --lang-only",
|
|
345
|
-
"a11y:role": "gbu-a11y --role-only"
|
|
406
|
+
"cleanup-backups": "find . -name '*.backup' -type f -delete"
|
|
346
407
|
}
|
|
347
408
|
}
|
|
348
409
|
```
|
|
349
410
|
|
|
350
411
|
### CI/CD Integration
|
|
351
|
-
|
|
352
412
|
```yaml
|
|
353
413
|
# GitHub Actions example
|
|
354
414
|
- name: Check Accessibility
|
|
355
415
|
run: npx gbu-accessibility-package --dry-run
|
|
356
416
|
|
|
357
|
-
- name: Fix Accessibility Issues
|
|
417
|
+
- name: Fix Accessibility Issues
|
|
358
418
|
run: npx gbu-accessibility-package --comprehensive
|
|
359
419
|
```
|
|
360
420
|
|
|
421
|
+
## ๐ Accessibility Standards Coverage
|
|
422
|
+
|
|
423
|
+
This package addresses common issues found by axe DevTools:
|
|
424
|
+
|
|
425
|
+
### โ
Supported
|
|
426
|
+
- `image-alt` - Images must have alternate text
|
|
427
|
+
- `html-has-lang` - HTML element must have lang attribute
|
|
428
|
+
- `label` - Form elements must have labels (basic support)
|
|
429
|
+
- `button-name` - Buttons must have discernible text
|
|
430
|
+
- `link-name` - Links must have discernible text (basic support)
|
|
431
|
+
- `landmark-one-main` - Document should have one main landmark
|
|
432
|
+
- `region` - Page content should be contained by landmarks
|
|
433
|
+
- `heading-order` - Heading levels analysis (suggestions only)
|
|
434
|
+
- Duplicate role attributes cleanup
|
|
435
|
+
|
|
436
|
+
### ๐ Future Enhancements
|
|
437
|
+
- `color-contrast` - Color contrast checking
|
|
438
|
+
- `focus-order-semantics` - Focus order validation
|
|
439
|
+
- Advanced ARIA attributes validation
|
|
440
|
+
- Table accessibility features
|
|
441
|
+
- List structure validation
|
|
442
|
+
|
|
361
443
|
## ๐ค Contributing
|
|
362
444
|
|
|
363
445
|
1. Fork the repository
|
|
@@ -372,9 +454,9 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
|
|
|
372
454
|
|
|
373
455
|
## ๐ Support
|
|
374
456
|
|
|
375
|
-
- ๐ง **Issues**: [GitHub Issues](https://github.com/
|
|
376
|
-
- ๐ **Documentation**: [GitHub Wiki](https://github.com/
|
|
377
|
-
- ๐ฌ **Discussions**: [GitHub Discussions](https://github.com/
|
|
457
|
+
- ๐ง **Issues**: [GitHub Issues](https://github.com/dangpv94/gbu-accessibility-tool/issues)
|
|
458
|
+
- ๐ **Documentation**: [GitHub Wiki](https://github.com/dangpv94/gbu-accessibility-tool/wiki)
|
|
459
|
+
- ๐ฌ **Discussions**: [GitHub Discussions](https://github.com/dangpv94/gbu-accessibility-tool/discussions)
|
|
378
460
|
|
|
379
461
|
## ๐ Why Choose GBU Accessibility Package?
|
|
380
462
|
|
|
@@ -384,7 +466,11 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
|
|
|
384
466
|
- โ
**Comprehensive** - Covers all major accessibility issues
|
|
385
467
|
- โ
**Fast & Efficient** - Batch processing with detailed reports
|
|
386
468
|
- โ
**WCAG Compliant** - Follows accessibility standards
|
|
469
|
+
- โ
**axe DevTools Compatible** - Fixes common axe issues
|
|
470
|
+
- โ
**Individual Control** - Fix specific issues or everything
|
|
471
|
+
- โ
**Safe Heading Analysis** - Suggests instead of auto-fixing
|
|
472
|
+
- โ
**Multi-language Support** - Japanese, English, and extensible
|
|
387
473
|
|
|
388
474
|
---
|
|
389
475
|
|
|
390
|
-
Made with โค๏ธ by the GBU Team
|
|
476
|
+
Made with โค๏ธ by the GBU Team
|