fix: improve dark mode contrast and accessibility for input placeholders
Closes #236
Description
This PR significantly improves the Accessibility (A11y) and visual consistency of the DevR.ai interface in Dark Mode. Previously, several UI components, particularly input placeholders and card borders, failed to meet the WCAG 2.1 AA contrast ratio standards, making the platform difficult to use for individuals with visual impairments or in high-glare environments.
By standardizing the color palette using a refined Zinc-based system, this PR ensures that all text elements are readable and interactive components provide clear visual feedback.
Changes Made
- Architectural Scaling (Tailwind Config) Color Tokenization: Extended the tailwind.config.js to include a semantic dark mode palette (dark-card, dark-lighter, accessible-gray).
- Consistent Themes: Switched from generic grays to a Zinc palette, which provides better depth and reduced eye strain on OLED and LED displays.
- UI/UX Refinement (Global CSS) Placeholder Legibility: Forced a global override for ::placeholder colors to #a1a1aa, ensuring a contrast ratio of at least 4.5:1.
Interactive Surfaces:
- Added subtle borders to cards to define layout structure in low-light settings.
- Implemented high-visibility hover states for data tables (tr:hover) to assist with row tracking in dense data views.
- Scrollbar Branding: Updated the Webkit scrollbar to a more vibrant green-to-blue gradient for better visibility and modern aesthetic.
Accessibilty audit
- Lighthouse Accessibility : 89/100 | Improved
- WCAG 2.1 Compliance : Level AA | Passed
Note: The score of 89 reflects a significant jump from the previous baseline. The remaining points are largely attributed to third-party scripts and non-color-related ARIA labels which were out of scope for this CSS-focused PR.
Checklist
- I have read the contributing guidelines.
- My changes pass the WCAG 2.1 AA contrast check in Chrome DevTools.
- I have updated the global Tailwind configuration to prevent style drift.
- No dependent changes are required for this UI-only fix.
Summary by CodeRabbit
-
New Features
- Added dark mode support with theme-aware color scheme, enabling users to switch between light and dark interfaces.
-
Improvements
- Enhanced accessibility with improved contrast for input placeholders and interactive table elements.
- Refined visual styling with updated card borders and button designs.
- Improved scrollbar appearance with enhanced gradient styling and hover effects.
βοΈ Tip: You can customize this high-level summary in your review settings.
This PR adds dark mode support to Tailwind configuration and restructures global CSS into semantic layers, enhancing dark mode contrast for cards, tables, input placeholders, and scrollbar styling to improve accessibility and readability. π― 3 (Moderate) | β±οΈ ~20 minutes Whiskers twitching at the dark mode glow, π° βοΈ Tip: You can configure your own custom pre-merge checks in the settings.π Walkthrough
Walkthrough
Changes
Cohort / File(s)
Summary
Tailwind Dark Mode Configuration
frontend/tailwind.config.jsAdded
darkMode: 'class' to enable class-based dark mode switching. Extended theme colors with custom dark mode palette: primary green (#22c55e), primary-hover (#16a34a), dark-card (#121212), dark-lighter (#1e1e1e), and accessible-gray (#a1a1aa).
Global Styling & Accessibility Enhancements
landing/src/index.cssRestructured CSS into semantic
@layer blocks (base, components, utilities). Enhanced dark mode contrast: updated card borders to zinc-700, added table row hover states with dark background, improved input placeholder contrast to #a1a1aa, and refined scrollbar gradients. Maintained button, card, and gradient-text utility classes with updated color references.Estimated code review effort
Poem
Cards and tables steal the show,
Colors pop with contrast keen,
Finest CSS layers you've seen,
Accessibility hopping strong and free!π₯ Pre-merge checks | β
5
β
Passed checks (5 passed)
Check name
Status
Explanation
Title check
β
Passed
The title clearly summarizes the main change - improving dark mode contrast and accessibility for input placeholders, which aligns with the primary objectives of the PR.
Linked Issues check
β
Passed
All primary coding objectives from issue
#236 are met: placeholder contrast increased to #a1a1aa, card borders updated to zinc-700, table row hover states implemented with dark background, and button contrast ratios verified.
Out of Scope Changes check
β
Passed
All changes are directly related to the linked issue
#236 objectives. The Tailwind config updates and CSS modifications focus exclusively on dark mode contrast and accessibility improvements.
Docstring Coverage
β
Passed
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check
β
Passed
Check skipped - CodeRabbitβs high-level summary is enabled.
β¨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
I am done implementing the issue raised by codeRabbit.