Skip to content

Implemented toggle button feature#681

Open
Chandrika987 wants to merge 2 commits into
komalharshita:mainfrom
Chandrika987:feat/toggle-theme
Open

Implemented toggle button feature#681
Chandrika987 wants to merge 2 commits into
komalharshita:mainfrom
Chandrika987:feat/toggle-theme

Conversation

@Chandrika987
Copy link
Copy Markdown

Summary [required]

Added a theme toggle feature to DevPath that allows users to switch between light and dark modes. Implemented theme switching functionality with persistent user preference using localStorage and improved the user experience with animated sun/moon toggle icons.

Related Issue [required]

Closes #331

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
index.html Added theme toggle button with sun and moon icons in the navigation bar
static/style.css Added dark theme variables, toggle button styling, and smooth icon transition styles
static/script.js Added theme switching logic and localStorage support to save user theme preference

How to Test This PR [required]

  1. Clone this branch: git checkout feat/theme-toggle
  2. Install dependencies: pip install -r requirements.txt
  3. Run the app: python app.py
  4. Open http://127.0.0.1:5000/
  5. Click the theme toggle button in the navbar
  6. Verify the page switches between light and dark themes
  7. Refresh the page and confirm the selected theme remains saved

Expected test output:

Theme switches successfully Selected theme persists after refresh No UI breaking issues found

Test Results [required]

Theme toggle manually tested successfully. Light mode: Passed Dark mode: Passed Theme persistence: Passed Responsive UI check: Passed

Screenshots (if UI change)

Before After
screenshot screenshot
Screenshot 2026-05-29 200840 Screenshot 2026-05-29 200855

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

@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

@Chandrika987 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.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Thank you for submitting your first pull request to DevPath.

Before review:

  • Complete the PR template fully
  • Ensure all tests pass
  • Link your PR to an issue
  • Keep changes scoped to the issue

A maintainer will review your contribution soon.

@Chandrika987
Copy link
Copy Markdown
Author

Hi @komalharshita ,
I have completed the implementation of the theme toggle feature and raised a Pull Request for review.

Changes included:

  • Added light/dark mode toggle functionality
  • Implemented theme persistence using localStorage
  • Added smooth sun/moon icon transition
  • Tested the feature across desktop and mobile views

Could you please review the PR when you get a chance?
Looking forward to your feedback.
Thank you!

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 Better User Experience

1 participant