Skip to content

bug: Fix Incorrect comparison in color-contrast function #41551

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

viniciusvts
Copy link
Contributor

@viniciusvts viniciusvts commented Jun 17, 2025

Update the conditional to correctly reflect the WCAG standard: the visual presentation of text and images of text has a contrast ratio of at least 4.5:1 (i.e., >= 4.5), not strictly greater than (>).

Type of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would change existing functionality)

Checklist

  • I have read the contributing guidelines
  • My code follows the code style of the project (using npm run lint)
  • My change introduces changes to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

Refs: #41543
Closes: #41543

@viniciusvts viniciusvts requested a review from a team as a code owner June 17, 2025 12:55
@julien-deramond
Copy link
Member

Could you please provide some before-and-after examples, including comparisons with other tools that implement this WCAG algorithm? This would help us review the proposed update. Please note that the need for updating the algorithm has not yet been discussed in the corresponding issue.

@julien-deramond
Copy link
Member

Closing as superseded by #41585

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

Successfully merging this pull request may close these issues.

Incorrect comparison in color-contrast function (should be >= instead of >)
2 participants