Skip to content

a11y/color-contrast: large text is held to 4.5:1 instead of WCAG's 3:1 #2105

Closed

Description

@nc9

a11y/color-contrast applies the 4.5:1 ratio to all text (packages/rules/src/a11y/color-contrast.ts:19-20). WCAG 2.2 success criterion 1.4.3 Contrast (Minimum) asks for 4.5:1 on normal text but only 3:1 on large text (at least 18pt, or 14pt bold). So large text between 3:1 and 4.5:1 is reported as a failure it is not. Once pub#2024 lands, those findings are also labelled 1.4.3 AA, which makes the overstatement visible to anyone reading by WCAG level.

Found by the full review of pub#2024; the behaviour predates that PR.

Acceptance Criteria

  • Text that is large under WCAG 1.4.3 (at least 18pt, or 14pt and bold, from the computed or declared font size and weight the rule can see) passes at 3:1 and fails below 3:1.
  • Normal-size text keeps the 4.5:1 threshold.
  • When the rule cannot tell the size, it keeps 4.5:1 and says so in the finding details.
  • Tests cover large text at 3.5:1 (pass), large text at 2.5:1 (fail), and normal text at 3.5:1 (fail).
  • The rule page states both ratios and when each applies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugrulessize: S

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions