Skip to content

fix: Fix the dark mode and make the mode toggle switch in the navbar - #46

Open
RoshanSinhabahu wants to merge 1 commit into
Vikram-sardiwal:mainfrom
RoshanSinhabahu:feature/dark-mode
Open

RoshanSinhabahu wants to merge 1 commit into
Vikram-sardiwal:mainfrom
RoshanSinhabahu:feature/dark-mode

Conversation

@RoshanSinhabahu

@RoshanSinhabahu RoshanSinhabahu commented Aug 31, 2026 •

Copy link
Copy Markdown

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:

  • Bug fix
  • New feature
  • Documentation update
  • UI/Styling improvement
  • Refactoring
  • Performance improvement
  • Other (please describe):

Changes Made

  • Fixed the dark mode functionality.
  • Added a dark/light mode toggle switch to the navbar.
  • Updated the required CSS styles for dark mode.
  • Updated the dark mode component and navbar component.

Testing

  • Ran npm run lint successfully
  • Tested the changes locally
  • Verified the affected functionality
  • Checked for console errors or warnings
  • Checked responsive design where applicable

Documentation

  • Updated the README or documentation if necessary
  • No documentation changes are required

Screenshots / Videos

image

Checklist

Before submitting this pull request, please confirm:

  • My code follows the project's coding standards.
  • I have tested my changes locally.
  • I have run npm run lint and resolved any issues.
  • I have not introduced unnecessary dependencies.
  • I have updated relevant documentation where necessary.
  • I have reviewed my own changes before requesting a review.
  • I have created a separate branch for this change.
  • I have linked the related issue.
  • Existing functionality still works.

Additional Notes

The dark mode toggle is now available directly in the navbar for easier access.

Copilot AI lite review requested due to automatic review settings August 31, 2026 09:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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.css and applies them to global background/text colors.
  • Adds the DarkMode toggle to the navbar and refactors the toggle component to use React state + effect.
  • Updates App.css to 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 thread src/App.css
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);
}
Comment thread src/App.css Resolved
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.

2 participants