From 9f418f74dc6d3ca667f04ba40d5651afad22269c Mon Sep 17 00:00:00 2001 From: Nikki Massaro Date: Wed, 8 Jul 2026 11:03:12 -0400 Subject: [PATCH 1/5] docs(icon): accessibility migration plan --- 2nd-gen/packages/swc/.storybook/preview.ts | 7 +- .../03_components/README.md | 2 + .../icon/accessibility-migration-analysis.md | 197 ++++++++++++++++++ .../03_project-planning/README.md | 1 + 4 files changed, 203 insertions(+), 4 deletions(-) create mode 100644 CONTRIBUTOR-DOCS/03_project-planning/03_components/icon/accessibility-migration-analysis.md diff --git a/2nd-gen/packages/swc/.storybook/preview.ts b/2nd-gen/packages/swc/.storybook/preview.ts index 3750c3951ff..917f5e62205 100644 --- a/2nd-gen/packages/swc/.storybook/preview.ts +++ b/2nd-gen/packages/swc/.storybook/preview.ts @@ -422,6 +422,8 @@ const preview = { ], 'Help text', ['Rendering and styling migration analysis'], + 'Icon', + ['Accessibility migration analysis'], 'Illustrated message', [ 'Accessibility migration analysis', @@ -523,10 +525,7 @@ const preview = { 'Rendering and styling migration analysis', ], 'Toast', - [ - 'Accessibility migration analysis', - 'Rendering and styling migration analysis', - ], + ['Accessibility migration analysis'], 'Tooltip', [ 'Accessibility migration analysis', diff --git a/CONTRIBUTOR-DOCS/03_project-planning/03_components/README.md b/CONTRIBUTOR-DOCS/03_project-planning/03_components/README.md index dd969c79971..071461d98c4 100644 --- a/CONTRIBUTOR-DOCS/03_project-planning/03_components/README.md +++ b/CONTRIBUTOR-DOCS/03_project-planning/03_components/README.md @@ -82,6 +82,8 @@ - [Grid migration roadmap](grid/rendering-and-styling-migration-analysis.md) - Help Text - [Help text migration roadmap](help-text/rendering-and-styling-migration-analysis.md) +- Icon + - [Icon accessibility migration analysis](icon/accessibility-migration-analysis.md) - Illustrated Message - [Illustrated message accessibility migration analysis](illustrated-message/accessibility-migration-analysis.md) - [`sp-illustrated-message` Migration Plan](illustrated-message/migration-plan.md) diff --git a/CONTRIBUTOR-DOCS/03_project-planning/03_components/icon/accessibility-migration-analysis.md b/CONTRIBUTOR-DOCS/03_project-planning/03_components/icon/accessibility-migration-analysis.md new file mode 100644 index 00000000000..11875a6626c --- /dev/null +++ b/CONTRIBUTOR-DOCS/03_project-planning/03_components/icon/accessibility-migration-analysis.md @@ -0,0 +1,197 @@ + + +[CONTRIBUTOR-DOCS](../../../README.md) / [Project planning](../../README.md) / [Components](../README.md) / Icon / Icon accessibility migration analysis + + + +# Icon accessibility migration analysis + + + +
+In this doc + +- [Overview](#overview) + - [Also read](#also-read) + - [What an icon is](#what-an-icon-is) + - [What it is not](#what-it-is-not) + - [Related](#related) +- [ARIA and WCAG context](#aria-and-wcag-context) + - [Pattern in the APG](#pattern-in-the-apg) + - [Guidelines that apply](#guidelines-that-apply) +- [Related 1st-gen accessibility (Jira)](#related-1st-gen-accessibility-jira) +- [Recommendations: ``](#recommendations-swc-icon) + - [ARIA roles, states, and properties](#aria-roles-states-and-properties) + - [Shadow DOM and cross-root ARIA Issues](#shadow-dom-and-cross-root-aria-issues) + - [Accessibility tree expectations](#accessibility-tree-expectations) + - [Keyboard and focus](#keyboard-and-focus) +- [Testing](#testing) + - [Automated tests](#automated-tests) + - [Manual screen reader testing](#manual-screen-reader-testing) +- [Summary checklist](#summary-checklist) +- [References](#references) + +
+ + + +## Overview + +This document covers the accessibility requirements and recommendations for **``**, the 2nd-gen generic SVG wrapper frame. The target standard is **WCAG 2.2 Level AA**. + +`` accepts an SVG in its default slot and controls whether that SVG is exposed to assistive technology (meaningful) or hidden from it (decorative). Per-icon workflow elements such as `` extend the same base class (`IconBase`) and inherit the same accessibility behavior. + +### Also read + +[Icon migration roadmap](./rendering-and-styling-migration-analysis.md) for layout, CSS, and DOM changes. + +### What an icon is + +`` is a **non-interactive SVG wrapper**. It operates in one of two modes: + +- **Decorative** (no `label`): the common case. The icon is inside an already-labeled control such as a button or menu item. Both host and SVG receive `aria-hidden="true"` so the icon does not generate a duplicate announcement. +- **Meaningful** (with `label`): the icon stands alone as content. The slotted SVG is exposed as an image with the `label` value as its accessible name. + +### What it is not + +- A button, link, or interactive element. To add click behavior to an icon, wrap it in `` or another interactive control; do not add event listeners directly to ``. +- A font icon or CSS pseudo-element. It renders real SVG markup. +- A replacement for per-icon workflow elements (``, etc.), which are the preferred approach for Spectrum workflow icons and extend the same base class. + +### Related + +- **Per-icon workflow elements** (``, etc.): generated wrappers that share `IconBase`; accessibility behavior is identical to ``. +- **UI icon functions** (internal): consumed directly by components such as `` and ``; not slotted by authors. + +--- + +## ARIA and WCAG context + +### Pattern in the APG + +The [APG](https://www.w3.org/WAI/ARIA/apg/) does not define a named pattern for a generic SVG icon wrapper. Relevant guidance comes from the APG's treatment of images and decorative content: + +- A **decorative** icon inside an already-labeled control must be hidden from assistive technology to prevent duplicate announcement. +- A **standalone meaningful** icon needs `role="img"` and an accessible name (`aria-label`), because SVG elements do not have a reliable implicit ARIA role across all browsers and assistive technologies. +- A **custom element** has no implicit ARIA role; `role="img"` must be applied explicitly to the element that carries the semantics. + +### Guidelines that apply + +| Idea | Plain meaning | +|------|---------------| +| [Non-text content (WCAG 1.1.1)](https://www.w3.org/TR/WCAG22/#non-text-content) | Every meaningful image needs a text alternative. Decorative images must be hidden from assistive technology. | +| [Use of color (WCAG 1.4.1)](https://www.w3.org/TR/WCAG22/#use-of-color) | Color alone must not convey meaning. The accessible name, not the icon's color, must carry semantic intent. | +| [Contrast — minimum (WCAG 1.4.3)](https://www.w3.org/TR/WCAG22/#contrast-minimum) | Text rendered inside SVG must meet 4.5:1 against its background. | +| [Non-text contrast (WCAG 1.4.11)](https://www.w3.org/TR/WCAG22/#non-text-contrast) | The icon fill must meet 3:1 contrast against the adjacent background for UI components. | + +**Bottom line:** Every `` is either explicitly decorative (hidden) or explicitly meaningful (named). Leaving `label` empty when an icon is the sole communication of meaning is an author error that fails WCAG 1.1.1. + +--- + +## Related 1st-gen accessibility (Jira) + +| Jira | Type | Status (snapshot) | Resolution (snapshot) | Summary | +|------|------|-------------------|------------------------|---------| +| [SWC-875](https://jira.corp.adobe.com/browse/SWC-875) | Epic | Done | Fixed | Update icon components for accessibility | +| [SWC-1337](https://jira.corp.adobe.com/browse/SWC-1337) | Bug | To Do | Unresolved | Different icons depending on import path — may deliver different SVG shapes, which changes what assistive technology announces | + +--- + +## Recommendations: `` + +### ARIA roles, states, and properties + +| Topic | What to do | +|-------|------------| +| **One semantic role** | `` represents one thing: a static SVG image or a decorative glyph. **Do not** set `role="button"`, `role="link"`, or any interactive role on the host. For icon buttons, wrap `` inside `` or a native `