fixed dark light toggle on schemes page#724
Merged
Merged
Conversation
|
@Eshajha19 is attempting to deploy a commit to the Renu's projects Team on Vercel. A member of the Team first needs to authorize it. |
🎉 Thanks for the PR, @Eshajha19!We really appreciate you taking the time to contribute to ExpenseFlow! 💙 ⭐ Love this project?Please give us a star! It helps the project grow and reach more developers! 🌟 🔗 https://github.com/Renu-code123/ExpenseFlow ✅ PR ChecklistBefore we review, please ensure:
🙌 Thank You for Contributing!We truly appreciate your interest in contributing to this project.
We'll review your PR as soon as possible. Keep up the great work! ✨ |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Feb 21, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix Dark/Light Mode Toggle Issue on Government Schemes Page
📌 Description
This PR fixes the dark/light mode toggle issue on the Government Schemes page where global CSS styles were overriding theme-specific styles, preventing proper light mode conversion.
##🐛 Problem
Global styles from expensetracker.css were applying fixed background and text colors.
These styles overrode .dark-mode styles.
As a result:
Light mode was not restoring correctly.
Some elements stayed dark.
Card backgrounds and navbar colors were inconsistent.
🚀 Solution Implemented
1️⃣ Introduced CSS Variable-Based Theme System
Added root-level CSS variables to manage colors dynamically:
:root {
--bg-main: #ffffff;
--bg-card: #ffffff;
--text-main: #111827;
}
body.dark-mode {
--bg-main: #0f172a;
--bg-card: #1e293b;
--text-main: #f1f5f9;
}
2️⃣ Replaced Hardcoded Colors
Overrode global styles using variables with controlled !important where required.
body {
background: var(--bg-main) !important;
color: var(--text-main) !important;
}
3️⃣ Persistent Toggle Functionality
Ensured:
Theme preference is stored in localStorage
Icon switches correctly (moon/sun)
Smooth transition between themes
🎯 Result
Dark mode works correctly
Light mode restores fully
No conflicts with global CSS
Smooth UI transitions
Fully scalable theme system
🧪 Testing
Verified toggle multiple times
Checked page reload persistence
Tested hover states in both themes
Confirmed navbar, cards, and footer update properly
This PR #724 closes issue #722

