fix: Add missing CSS rules for dark mode theme - #47
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces the missing dark-mode styling needed for the existing NavBar toggle (which adds/removes dark-mode on document.body) to produce an actual visual theme change across the app.
Changes:
- Adds global
body.dark-modeCSS variable overrides and new theme variables/classes inApp.css(navbar/admin tabs/teacher cards/footer). - Adds component-level
body.dark-modeoverrides in several feature stylesheets (admin Activity Logs / Payments, Reviews, Bookmarks), including fixes for native<select><option>popup readability. - Updates Admin/Teacher components to use theme-aware classnames instead of hardcoded inline colors.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/App.css | Adds global dark-mode variable overrides and shared theme classes (navbar/admin tabs/teacher cards/footer tweaks). |
| frontend/src/components/common/NavBar.jsx | Implements the dark-mode toggle behavior and navbar styling hooks. |
| frontend/src/components/admin/AdminHome.jsx | Replaces hardcoded admin tab styling with theme-aware classes. |
| frontend/src/components/user/teacher/TeacherHome.jsx | Applies new theme-aware classes to course cards and enrolled text. |
| frontend/src/components/admin/PaymentRecords.css | Adds dark-mode variable overrides and fixes for controls/status colors in dark mode. |
| frontend/src/components/admin/ActivityLogs.css | Adds dark-mode variable overrides and fixes for controls/table/badges in dark mode. |
| frontend/src/components/reviews/CourseReviews.css | Adds dark-mode variable overrides and dark-mode control/background styling for reviews UI. |
| frontend/src/components/bookmarks/Bookmarks.css | Adds dark-mode variable overrides and button/empty/error state styling for bookmarks UI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| body.dark-mode .review-form-card textarea, | ||
| body.dark-mode .review-form-actions button, | ||
| body.dark-mode .review-owner-actions button, | ||
| body.dark-mode .review-pagination button, | ||
| body.dark-mode .reviews-toolbar select { | ||
| background: #2a2a2a; | ||
| color: var(--review-ink); | ||
| } | ||
|
|
||
| body.dark-mode .review-form-actions button:last-child { | ||
| color: #1a1a1a; | ||
| } |
| .premium-navbar { | ||
| backdrop-filter: blur(12px) saturate(1.2); | ||
| background: var(--navbar-bg); | ||
| border-radius: 0 0 18px 18px; | ||
| border-bottom: 1px solid var(--navbar-border); |
| .settings-btn { | ||
| background: var(--surface-dark); | ||
| color: #fff; | ||
| } | ||
|
|
|
@sujalv28 Nice work on this PR! The Copilot suggestions look worthwhile please address them, and I'll take another look. |
|
Okk sure @udaycodespace I'll check them |
|
Hello @udaycodespace, I have made the changes requested. You can review them and merge if it solve the issue. |
LGTM! |
Summary
This PR fixes the issue #27 [Dark Mode Toggle Does Nothing] where the dark mode toggle in the NavBar had no visual effect. While the toggle correctly applied the .dark-mode class to document.body, the corresponding CSS styles were completely missing from the project.
I have added a comprehensive set of .dark-mode CSS variables/rules to the global stylesheet so the application correctly switches to a dark theme when the class is active.
Related Issue
Issue #27 [Dark Mode Does Nothing]
Closes #27 [Dark Mode Does Nothing]
What changed?
Root theming:
Component-local dark-mode blocks (each had its own CSS variable scope, disconnected from the global toggle):
Fixed-background-paired-with-theme-variable-text bugs (same failure pattern, found in three places):
Native 'select' dropdown popups (5 instances):
Components entirely outside the theme system:
Files touched: App.css, NavBar.jsx, PaymentRecords.css, ActivityLogs.css, CourseReviews.css, Bookmarks.css, AdminHome.jsx, TeacherHome.jsx.
Type
Areas touched
Testing
Test steps
Screenshots
Before
After
Edge cases checked
Checklist
CONTRIBUTING.md