Skip to content

Fixed Dark Theme Toggle Functionality (Issue #540)#548

Open
gayatridot wants to merge 4 commits into
PatelHarsh2006:mainfrom
gayatridot:fix/toggle-theme
Open

Fixed Dark Theme Toggle Functionality (Issue #540)#548
gayatridot wants to merge 4 commits into
PatelHarsh2006:mainfrom
gayatridot:fix/toggle-theme

Conversation

@gayatridot

Copy link
Copy Markdown

📝 PR Title

Fixed Dark Theme Toggle Functionality (Issue #540)


📌 Description

This PR resolves the bug reported in Issue #540 where the light/dark mode toggle button was non‑functional.

✅ Changes Made

  • Implemented a global theme-toggle.js script that:
    • Applies dark-theme by default and switches to light-theme when toggled.
    • Stores the user’s preference in localStorage so the theme persists across all pages.
    • Updates the toggle button state (sun/moon icons and thumb position) based on the active theme.
  • Updated CSS to handle .dark-theme and .light-theme classes consistently.
  • Ensured the toggle button works across all pages by including the script globally.

🎯 Benefits

  • Restores expected functionality of the theme toggle button.
  • Provides a consistent user experience across the site.
  • Remembers user preference between sessions.
  • Improves accessibility and usability.

📷 Screenshot

image -

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.

1 participant