-
Notifications
You must be signed in to change notification settings - Fork 92
Fix WCAG AA Color Contrast Violations #1329
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for openfeature ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Summary of ChangesHello @huangkevin-apr, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the OpenFeature website's accessibility by addressing multiple WCAG AA color contrast violations. The changes primarily involve updating text and badge colors to meet higher contrast ratios, ensuring a more readable and inclusive experience for all users, particularly in light mode. Additionally, it standardizes the muted color for the DocSearch component across themes. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request effectively addresses 15 WCAG AA color contrast violations by updating text colors for better readability in light mode. The changes in custom.css, features-zigzag.tsx, and question-blocks.tsx are correct and achieve the goal of improving accessibility. I've added one suggestion to improve long-term maintainability by centralizing the new text color styles into custom utility classes, which would make future theme updates easier.
| </div> | ||
| <h1 className="h2 mb-4">Community driven feature flagging</h1> | ||
| <p className="text-xl text-gray-500 dark:text-gray-300 mb-4"> | ||
| <p className="text-xl text-gray-700 dark:text-gray-300 mb-4"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While changing text-gray-500 to text-gray-700 correctly fixes the color contrast issue, this color class (text-gray-700) is now repeated in multiple places across features-zigzag.tsx and question-blocks.tsx. This could make future theme adjustments more difficult.
To improve maintainability, consider creating a custom utility class for this muted text style. You could add the following to src/css/additional-styles/utility-patterns.css:
.text-muted {
@apply text-gray-700 dark:text-gray-300;
}Then, you could apply this class like so:
<p className="text-xl text-muted mb-4">This would centralize the color definition, making it easier to manage. A similar approach could be used for text-gray-600 (e.g., with a .text-muted-alt class), which is also used for muted text in this file.
Signed-off-by: huangkevin-apr <huangkevinapr@outlook.com>
1511562 to
135fffc
Compare
This PR
Fixes 15 WCAG AA color contrast violations across the OpenFeature website
Updates text colors in light mode from
text-gray-500totext-gray-700for improved readabilityChanges the "Open source" badge text color from
text-green-600totext-green-800for better contrast against the green backgroundAdds CSS custom properties for DocSearch muted color to ensure proper contrast in the search placeholder
adds this new feature
Related Issues
This PR addresses 15 WCAG AA color contrast violations identified by accessibility testing. All violations were related to insufficient text contrast ratios that failed to meet WCAG 2.1 Level AA standards (criterion 1.4.3).
When running IBM Accessibility Checker (Version 4.0.9) on the homepage, 15 contrast-related accessibility violations were reported.
Screenshot of Violation Element:

Violation Report:

Notes
The patch submitted in this PR was generated by A11YRepair, an automated Web Accessibility repair tool that I developed to address common accessibility violations in web applications. The generated fixes were manually reviewed and validated before submission.
Follow-up Tasks
N/A
How to test
Fix Before:

Fix After:
