fix(a11y): WCAG 2.1 accessibility improvements across Icon component and demo#4
Open
yacosta738 wants to merge 32 commits into
Open
fix(a11y): WCAG 2.1 accessibility improvements across Icon component and demo#4yacosta738 wants to merge 32 commits into
yacosta738 wants to merge 32 commits into
Conversation
- Add release-please-config.json for packages/core (@dallay/astro-icon) - Add .release-please-manifest.json with current version 1.2.4 - Add release-please.yml workflow: auto PR on push to main, publish to npm on release - Convert release.yml to manual fallback with explicit confirmation guard - Remove .changeset directory and @changesets/* dependencies - Remove changeset version script from root package.json
… CI action SHAs
- devalue >= 5.8.1 (DoS via sparse array) - fast-uri >= 3.1.2 (host confusion + path traversal) - minimatch >= 10.2.3 (ReDoS, 3 CVEs) - path-to-regexp >= 6.3.0 (backtracking ReDoS) - undici@<6 >= 5.29.0 (DoS, smuggling, CRLF) - ajv >= 8.18.0 (ReDoS via $data) - smol-toml >= 1.6.1 (DoS via nested TOML)
…ponents--@dallay/astro-icon chore: release @dallay/astro-icon 1.3.0
- Replace prettier with @biomejs/biome ^2.4.15 - Add biome.json with formatter, linter, and files.includes config (Biome v2) - Update package.json scripts: lint, lint:fix, format - Rewrite CI lint job: drop wearerequired/lint-action, use native biome + git auto-fix steps
Run biome check --write and --unsafe to auto-correct formatting and safe lint issues
Added a security policy document outlining supported versions and vulnerability reporting. Signed-off-by: Yuniel Acosta Pérez <33158051+yacosta738@users.noreply.github.com>
…dates (#4) Bumps the npm_and_yarn group with 2 updates in the / directory: [postcss](https://github.com/postcss/postcss) and [yaml](https://github.com/eemeli/yaml). Updates `postcss` from 8.5.8 to 8.5.14 - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](postcss/postcss@8.5.8...8.5.14) Updates `yaml` from 2.7.1 to 2.9.0 - [Release notes](https://github.com/eemeli/yaml/releases) - [Commits](eemeli/yaml@v2.7.1...v2.9.0) --- updated-dependencies: - dependency-name: postcss dependency-version: 8.5.14 dependency-type: indirect - dependency-name: yaml dependency-version: 2.9.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Add .vercel to packages/www/.gitignore to prevent Vercel deployment artifacts from being committed. Keeps repository clean of environment-specific deployment metadata.
Co-authored-by: dallay-bot[bot] <172063952+dallay-bot[bot]@users.noreply.github.com>
- Rename _id to id so symbol/use references resolve correctly (bug fix) - Rename _normalizedBody to normalizedBody to match template usage (bug fix) - Add focusable='false' to prevent SVGs from being keyboard-focusable in IE/Edge and some Chromium builds (WCAG 2.1.1) - Decorative icons (no title prop) receive aria-hidden='true' so assistive technologies skip them (WCAG 1.1.1) - Meaningful icons (with title prop) receive role='img' so screen readers expose the title as the accessible name (WCAG 4.1.2) - Associate desc element with a stable id for future aria-describedby wiring (WCAG 1.1.1)
…se layout - Wrap slot in <main id='main-content'> to provide a navigation landmark that keyboard and AT users can target (WCAG 1.3.6, 2.4.1) - Add skip link that becomes visible on focus so keyboard users can bypass repeated header content (WCAG 2.4.1 - Level A) - Add meta description for better AT context and SEO - Skip link uses tabindex='-1' on <main> to allow programmatic focus without disrupting natural tab order
…cs in demo pages - Add explicit imports for Base layout and Icon component to replace implicit globals; makes component contracts clear and auditable - Fix variable name: _icon -> icon so the runtime reference resolves - Add title prop to standalone icons so they are exposed as role='img' with an accessible name to screen readers (WCAG 1.1.1) - Wrap star icons in <figure aria-label='Rating: 4 out of 5 stars'> with a visually-hidden <figcaption> so the group meaning is communicated to AT users (WCAG 1.1.1, 1.3.1) - Add .visually-hidden utility class following the standard SR-only clip pattern
actions/checkout on pull_request events checks out the merge commit,
leaving the runner in detached HEAD state. A plain 'git push' then
fails with exit 128 because there is no active branch to push to.
Fix: use 'git push origin HEAD:${HEAD_REF}' when github.head_ref is
set (PR context), falling back to plain 'git push' on direct pushes
to main where HEAD is always attached.
- Add biome-ignore on normalizedBody variable (used in Astro template, outside Biome JS scope) to prevent false unused-variable warning - Apply biome import order: sort imports alphabetically in demo pages - Apply biome ternary formatting in Icon.astro (cosmetic only) - Use --force-with-lease on push to guard against concurrent pushes while still protecting against accidental overwrite of others' work
- Icon.astro: add aria-describedby to normalizedProps when desc is provided and icon is meaningful, binding <svg> to its <desc id> (WCAG 1.1.1 / 4.1.2) - map.astro: remove per-star title props so each icon is decorative; the <figure aria-label> and <figcaption> carry the collective meaning and screen readers no longer announce each star separately
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes several WCAG 2.1 accessibility violations found in the
Iconcomponent and the demo pages. Changes are grouped into three focused commits for easier review.Issues Fixed
packages/core/components/Icon.astro— Critical_idvariable used in template but computed as_id—<symbol>and<use>referenced an undefinedid_id→id,_normalizedBody→normalizedBodyaria-hidden="true"when notitleprop is providedrole="img"whentitleprop is providedfocusable="false"unconditionallydemo/src/layouts/base.astro— Serious<main>landmark — AT users couldn't navigate to main content<slot />in<main id="main-content" tabindex="-1">#main-content<meta name="description">demo/src/pages/index.astroandmap.astro— Moderatetitle— invisible to ATtitleprop to each meaningful icon_iconvariable shadowed — runtime reference would fail_icon→icon<figure aria-label="Rating: 4 out of 5 stars">+ visually-hidden<figcaption>importstatements forBaseandIconHow to Verify
Keyboard
<main>Screen reader (VoiceOver / NVDA)
titlemust be announced as"<title text>, image""Rating: 4 out of 5 stars"(or equivalent)Automated
# From repo root npx @axe-core/cli http://localhost:4321 --exit npx pa11y http://localhost:4321 --reporter cliWCAG References
Accessibility review:
role="img"+titlefor meaningful icons;aria-hiddenfor decorative<main>landmark;focusable="false"on SVGs