Skip to content

Commit a90341d

Browse files
ajrothwellclaude
andcommitted
a11y: contrast fix, aria-labels, scope=row, prefers-reduced-motion
- Change #999/#888 to #767676 for WCAG AA 4.5:1 contrast (g01) - Add aria-label to legend <ul> elements (9y9) - Add scope="row" to popup table <th> elements (984) - Add prefers-reduced-motion media queries for animations (7tx) - Bump @phila/phila-ui-map-core to 0.0.3-beta.4 v3.0.0-beta.12 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 884721e commit a90341d

File tree

8 files changed

+38
-14
lines changed

8 files changed

+38
-14
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@phila/layerboard",
3-
"version": "3.0.0-beta.11",
3+
"version": "3.0.0-beta.12",
44
"type": "module",
55
"description": "Vue 3 + MapLibre mapping framework for City of Philadelphia applications",
66
"main": "./dist/index.js",
@@ -44,7 +44,7 @@
4444
"dependencies": {
4545
"@phila/phila-ui-core": "2.3.1-beta.0",
4646
"@phila/phila-ui-link": "1.0.2-beta.0",
47-
"@phila/phila-ui-map-core": "0.0.3-beta.3",
47+
"@phila/phila-ui-map-core": "0.0.3-beta.4",
4848
"@phila/phila-ui-text-field": "1.1.1-beta.0"
4949
},
5050
"devDependencies": {

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/LayerCheckboxSet.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ function onOpacityChange(layerId: string, event: Event) {
196196
<ul
197197
v-if="shouldShowLegendBox(layer) && isVisible(layer.id) && layer.legend?.length"
198198
class="layer-legend"
199+
:aria-label="'Legend for ' + getLayerDisplayName(layer)"
199200
>
200201
<li
201202
v-for="(item, index) in layer.legend"
@@ -306,7 +307,7 @@ function onOpacityChange(layerId: string, event: Event) {
306307
307308
/* Unavailable layer styles */
308309
.layer-unavailable {
309-
color: #999;
310+
color: #767676;
310311
cursor: not-allowed;
311312
}
312313
@@ -316,7 +317,7 @@ function onOpacityChange(layerId: string, event: Event) {
316317
317318
.zoom-indicator {
318319
font-size: 11px;
319-
color: #888;
320+
color: #767676;
320321
font-style: italic;
321322
margin-left: 4px;
322323
}

src/components/LayerPanel.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ function onOpacityChange(layerId: string, event: Event) {
252252
<ul
253253
v-if="showLegend && isVisible(layer.config.id) && layer.config.legend?.length"
254254
class="layer-legend"
255+
:aria-label="'Legend for ' + layer.config.title"
255256
>
256257
<li
257258
v-for="(item, index) in layer.config.legend"
@@ -436,7 +437,7 @@ function onOpacityChange(layerId: string, event: Event) {
436437
437438
/* Unavailable layer styles (zoom range) */
438439
.layer-unavailable {
439-
color: #999;
440+
color: #767676;
440441
cursor: not-allowed;
441442
}
442443
@@ -446,7 +447,7 @@ function onOpacityChange(layerId: string, event: Event) {
446447
447448
.zoom-indicator {
448449
font-size: 11px;
449-
color: #888;
450+
color: #767676;
450451
font-style: italic;
451452
margin-left: 4px;
452453
}

src/components/LayerRadioButtonSet.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ function onOpacityChange(layerId: string, event: Event) {
169169
<ul
170170
v-if="shouldShowLegendBox(layer) && isVisible(layer.id) && layer.legend?.length"
171171
class="layer-legend"
172+
:aria-label="'Legend for ' + getLayerDisplayName(layer)"
172173
>
173174
<li
174175
v-for="(item, index) in layer.legend"
@@ -267,7 +268,7 @@ function onOpacityChange(layerId: string, event: Event) {
267268
268269
/* Unavailable layer styles */
269270
.layer-unavailable {
270-
color: #999;
271+
color: #767676;
271272
cursor: not-allowed;
272273
}
273274
@@ -277,7 +278,7 @@ function onOpacityChange(layerId: string, event: Event) {
277278
278279
.zoom-indicator {
279280
font-size: 11px;
280-
color: #888;
281+
color: #767676;
281282
font-style: italic;
282283
margin-left: 4px;
283284
}

src/components/Layerboard.vue

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,4 +1430,15 @@ html, body {
14301430
white-space: nowrap;
14311431
border: 0;
14321432
}
1433+
1434+
@media (prefers-reduced-motion: reduce) {
1435+
.layerboard-spinner {
1436+
animation: none;
1437+
}
1438+
1439+
.layerboard-sidebar-toggle,
1440+
.layerboard-sidebar {
1441+
transition: none;
1442+
}
1443+
}
14331444
</style>

src/components/MapPanel.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@ const popupHtml = computed(() => {
962962
html += `<table class="popup-table" aria-label="${escapeHtml(popupTitle.value)}">`;
963963
for (const field of feature.popupConfig.fields) {
964964
const value = formatFieldValue(feature.properties[field.field], field.format);
965-
html += `<tr><th>${escapeHtml(field.label)}</th><td>${escapeHtml(value)}</td></tr>`;
965+
html += `<tr><th scope="row">${escapeHtml(field.label)}</th><td>${escapeHtml(value)}</td></tr>`;
966966
}
967967
html += `</table>`;
968968
} else {

src/components/TopicAccordion.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,4 +190,14 @@ function toggleAccordion() {
190190
.topic-accordion.is-expanded .topic-header {
191191
background: #e8e8e8;
192192
}
193+
194+
@media (prefers-reduced-motion: reduce) {
195+
.topic-header {
196+
transition: none;
197+
}
198+
199+
.topic-chevron {
200+
transition: none;
201+
}
202+
}
193203
</style>

0 commit comments

Comments
 (0)