Skip to content

Aditya-Fix: Improve dark mode text contrast in Total Org Summary statistics cards#4506

Merged
one-community merged 1 commit intodevelopmentfrom
Aditya-fix/dark-mode-statistics-card-text-contrast
Dec 7, 2025
Merged

Aditya-Fix: Improve dark mode text contrast in Total Org Summary statistics cards#4506
one-community merged 1 commit intodevelopmentfrom
Aditya-fix/dark-mode-statistics-card-text-contrast

Conversation

@Aditya-gam
Copy link
Copy Markdown
Contributor

@Aditya-gam Aditya-gam commented Dec 5, 2025


Description

Fixes critical readability issue in Total Org Summary page where statistics card text became unreadable in dark mode due to poor contrast (white text on light card backgrounds). Also converts StatisticsTab component to CSS modules to comply with pre-commit hook requirements.
IssueImage

Key Fix: Statistics card text now remains black in dark mode for proper contrast, while section headers remain white for theme consistency.


Related PRs

  • This PR fixes dark mode issues from PR #4142

Main Changes

Files Modified

  1. src/components/TotalOrgSummary/StatisticsTab/StatisticsTab.module.css (renamed from .css)

    • Converted all CSS classes from kebab-case to camelCase for CSS modules
    • Added dark mode override selectors (lines 47-57) to keep card text black
    • Updated selectors to use :global() syntax for cross-module references
    • Preserved CSS variables and responsive styles
  2. src/components/TotalOrgSummary/StatisticsTab/StatisticsTab.jsx

    • Updated import to use CSS module: import styles from './StatisticsTab.module.css'
    • Replaced all className strings with styles.className references
    • No functional changes to component logic

Implementation Details

  • Dark Mode Fix: Added specific selectors using :global(.bg-oxford-blue) with higher specificity to override white text rule from TotalOrgSummary.module.css line 17
  • CSS Modules: All classes are now scoped, preventing global conflicts
  • Specificity Strategy: Override targets .statisticsTabHolder combined with element types to ensure proper cascade

How to Test

  1. Checkout branch: Aditya-fix/dark-mode-statistics-card-text-contrast
  2. Reinstall dependencies and clear cache: rm -rf node_modules && yarn cache clean
  3. Run yarn install and start the app: yarn start:local
  4. Log in as owner/admin.
  5. Navigate to Total Org Summary page
  6. Toggle dark mode and verify:
    • Statistics cards show black text on light backgrounds (readable)
    • Section headers remain white
    • Light mode unchanged (no regressions)
  7. Test responsive behavior on different screen sizes

Screenshots

  • Before: White text on light card backgrounds (poor contrast)
BeforeVideo.mov
  • After: Black text on light card backgrounds (good contrast)
AfterVideo.mov
  • Include side-by-side comparison(Left Image is After and Right Image is before)
SideBySide

Notes

  • Pre-commit Hook: Now complies with .module.css file requirement

…contrast

- Convert StatisticsTab.css to StatisticsTab.module.css to comply with pre-commit hook requirements
- Update component to use CSS module styles object instead of global class names
- Convert class names from kebab-case to camelCase (statistics-tab-holder -> statisticsTabHolder)
- Use :global() selectors for dark mode overrides following TotalOrgSummary.module.css pattern
- Keep statistics card text black in dark mode for proper contrast with light card backgrounds
- Override white text color rule specifically for card content while maintaining section headers as white
- Fixes readability issue where white text on light backgrounds caused poor contrast in dark mode
@netlify
Copy link
Copy Markdown

netlify Bot commented Dec 5, 2025

Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit 45ce07b
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/69334a76b9b4ea0008ccbd47
😎 Deploy Preview https://deploy-preview-4506--highestgoodnetwork-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Dec 5, 2025

Copy link
Copy Markdown

@Anusha-Gali Anusha-Gali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Aditya,

I have reviewed your PR locally and the text appears in dark mode as per the requirements and is responsive as well.
Screenshot 2025-12-07 at 3 24 07 PM
Screenshot 2025-12-07 at 3 24 17 PM
Screenshot 2025-12-07 at 3 30 44 PM

@one-community
Copy link
Copy Markdown
Member

Thank you all, merging!

@one-community one-community merged commit cdc0dea into development Dec 7, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants