Skip to content

[a11y] Count only a component's own demos when axe results are shared #49514

Closed

Description

@rohits2501

Summary

Let accessibility.json say which demos in its axe file count for that component, so pnpm a11y:scorecard reads only those.

Today readAxeResults in scripts/a11yScorecard/axe.mjs takes the worst status of each rule across every demo in the file. When two components point at the same file, each one gets the other's results.

Examples

CircularProgress and LinearProgress both use docs/data/material/components/progress/progress.a11y.json, because the reporter keys results by docs slug. Since #49504, the LinearProgress report lists aria-hidden-focus ✅ under 4.1.2. LinearProgress renders nothing aria-hidden; that result comes from the CircularProgress track.

A pass only adds a line. A failure would do more: an axe failure in any CircularProgress demo would downgrade LinearProgress, and the other way around.

A possible shape is an optional list of demo names or a glob next to axe, for example:

{
  "axe": "docs/data/material/components/progress/progress.a11y.json",
  "axeDemos": ["Circular*"]
}

Components without the field would keep reading the whole file.

Motivation

Raised by @JCQuintas in #49504 (comment) and kept out of that pull request to keep it small. More pages will share a slug as the assessments continue, for example several form components on one docs page, so this will matter beyond progress.

Search keywords: a11y scorecard, readAxeResults, progress.a11y.json, shared axe results

Activity

  1. github-actions commented on Oct 22, 2026

    @github-actions
    Contributor

    This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
    Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.


    @rohits2501 Thanks again for creating this issue! If you have a moment, we would love to hear your thoughts on how we handled it with this short feedback form.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions