Repository navigation
fix: Fix the dark mode and make the mode toggle switch in the navbar - #46
Open
RoshanSinhabahu wants to merge 1 commit into
Open
RoshanSinhabahu wants to merge 1 commit into
RoshanSinhabahu wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
There are user-visible and accessibility issues to address (initial theme flash and focus visibility), and the new navbar variable styling is currently overridden by remaining dark-mode navbar rules.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates the app’s theming approach to make dark mode reliable by switching to CSS custom properties and exposes the theme toggle directly in the navbar.
Changes:
- Introduces theme variables in
index.cssand applies them to global background/text colors. - Adds the
DarkModetoggle to the navbar and refactors the toggle component to use React state + effect. - Updates
App.cssto use theme variables for the toggle and navbar styling, and extends dark-mode styling coverage.
File summaries
| File | Description |
|---|---|
| src/index.css | Defines light/dark theme CSS variables and applies them to the document. |
| src/components/Navbar.jsx | Renders the theme toggle inside the navbar. |
| src/components/Dark-Mode.jsx | Refactors theme toggle logic to React state/effects and persists theme. |
| src/App.css | Moves navbar/toggle styling toward theme variables and adds additional dark-mode rules. |
| package-lock.json | Lockfile metadata adjustments from dependency resolution/install. |
Review details
- Files reviewed: 4/5 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+16
to
+19
| useEffect(() => { | ||
| document.documentElement.setAttribute("data-theme", theme); | ||
| localStorage.setItem("theme", theme); | ||
| }, [theme]); |
Comment on lines
176
to
180
| padding: 0.9rem 1.5rem; | ||
| background: rgba(255, 255, 255, 0.85); | ||
| background: var(--navbar-bg); | ||
| backdrop-filter: blur(8px); | ||
| border-bottom: 1px solid #ececec; | ||
| border-bottom: 1px solid var(--border-color); | ||
| } |
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.
Description
This pull request fixes the dark mode functionality and adds a mode toggle switch to the navbar, allowing users to easily switch between light and dark modes.
Related Issue
No related issue.
Type of Change
Please select all applicable options:
Changes Made
Testing
npm run lintsuccessfullyDocumentation
Screenshots / Videos
Checklist
Before submitting this pull request, please confirm:
npm run lintand resolved any issues.Additional Notes
The dark mode toggle is now available directly in the navbar for easier access.