Skip to content

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

Closed
viniciusvts wants to merge 1 commit intotwbs:mainfrom
viniciusvts:fix-Incorrect-comparison-in-color-contrast
Closed

bug: Fix Incorrect comparison in color-contrast function#41551
viniciusvts wants to merge 1 commit intotwbs:mainfrom
viniciusvts:fix-Incorrect-comparison-in-color-contrast

Conversation

@viniciusvts
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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