Skip to content

feat: add dark/light mode toggle with persistent theme support#458

Open
pari-dubey1 wants to merge 2 commits into
komalharshita:mainfrom
pari-dubey1:feat/dark-light-mode-toggle
Open

feat: add dark/light mode toggle with persistent theme support#458
pari-dubey1 wants to merge 2 commits into
komalharshita:mainfrom
pari-dubey1:feat/dark-light-mode-toggle

Conversation

@pari-dubey1
Copy link
Copy Markdown

Summary [required]

This PR adds a fully functional dark/light mode toggle feature to improve accessibility and overall user experience across the DevPath website. Users can now switch between light and dark themes dynamically, with the selected preference being saved using localStorage so the theme persists across refreshes and future visits. The update also improves responsive behavior by adding a dedicated mobile theme toggle inside the hamburger navigation menu and applies dark mode styling consistently across major homepage sections, cards, forms, buttons, navigation, footer, and interactive UI components.


Related Issue [required]

Closes #283


Type of Change [required]

  • Bug fix — resolves a broken behaviour
  • Feature — adds new functionality
  • Data — adds new projects to data/projects.json
  • Documentation — updates docs, README, or code comments only
  • Style — CSS or visual changes only, no logic change
  • Refactor — restructures code without changing behaviour
  • Test — adds or updates tests

What Was Changed [required]

File Change made
static/style.css Added complete dark mode styling for navbar, hero, cards, sections, footer, forms, buttons, and responsive components
static/script.js Added theme toggle logic, localStorage persistence, theme switching functionality, and mobile theme synchronization
templates/index.html Added desktop and mobile theme toggle buttons inside navbar and hamburger menu

How to Test This PR [required]

  1. Clone this branch:
git checkout feat/dark-mode-toggle
  1. Install dependencies:
pip install -r requirements.txt
  1. Run the application:
python app.py
  1. Open:
http://127.0.0.1:5000
  1. Verify the following:
  • Theme toggle button works on desktop
  • Mobile hamburger menu contains working theme toggle
  • Theme persists after refresh
  • Dark mode styles apply correctly across all sections
  • Navigation, cards, buttons, forms, and footer remain readable
  • Responsive layout works correctly in both themes
  1. Run tests:
python tests/test_basic.py

Expected test output:

27 passed, 0 failed out of 27 tests

Test Results [required]

27 passed, 0 failed out of 27 tests

Screenrecording

Screen.Recording.2026-05-22.160504.mp4
Screen.Recording.2026-05-22.160559.mp4

Self-Review Checklist [required]

  • I have read CONTRIBUTING.md and followed all guidelines
  • My branch name follows the convention: feat/, fix/, docs/, data/, style/, test/
  • I have run python tests/test_basic.py and all 27 tests pass
  • I have run flake8 . locally and there are no errors
  • I have not introduced any print() or console.log() debug statements
  • Every new function I wrote has a docstring
  • I have not modified files outside the scope of the linked issue
  • If I changed the UI, I tested it at 375px (mobile) and 1280px (desktop)
  • If I added a project to the dataset, it has all required JSON fields

Notes for Reviewer

  • Added both desktop and mobile theme toggle support
  • Theme preference is persisted using localStorage
  • Verified responsiveness for both light and dark themes
  • Adjusted dark mode styles for readability and accessibility across all homepage sections

@vercel
Copy link
Copy Markdown

vercel Bot commented May 22, 2026

@pari-dubey1 is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add Dark/Light Mode Toggle for Improved Accessibility and User Experience

1 participant