Skip to content

a11y/color-contrast reads same-site linked stylesheets for the page and body background #1756

Closed

Description

@nc9

Follow-up to #1752. Rules never see stylesheet text, so text whose background comes from a linked stylesheet (the nut shop tagline: inline #b9b9b9 on a background set in styles.css) is reported as unresolved info, not a contrast warning. Assuming white would warn falsely on dark themes.

Acceptance Criteria

  • The asset phase fetches same-site linked stylesheets (bounded count and bytes, same egress rules as scripts) and extracts only the html/body background colour, which reaches the rule through collected signals.
  • With that colour known, the nut shop tagline case warns with the measured ratio; a dark-theme body background does not produce a false warning for light inline text.
  • Stylesheets that fail to load keep the pair unresolved (info), never assumed white.
  • Engine-level test with a local fixture server; docs for the rule updated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementrulessize: M

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions