Skip to content

Dark Mode Toggle Button Not Working & Theme Not Applying #532

@nazneen-p1

Description

@nazneen-p1

Description

The dark mode toggle button is currently not functioning as expected. When the button is clicked, the theme does not switch between light and dark modes. Additionally, the dark mode styles are not being applied to the UI.

❗ Problem
Clicking the dark mode toggle button does not change the theme
No visual changes occur after interaction
Dark mode styles are not applied to the page

✅ Expected Behavior
Clicking the toggle button should switch between light and dark mode
The UI should update instantly with dark theme styles
Theme preference should persist using local storage4

🔍 Possible Causes
JavaScript file (darkmode.js) not properly linked
Event listener not attached correctly to the button
CSS variables or [data-theme="dark"] styles not defined properly
Script loading before DOM elements are available

🛠️ Suggested Fix
Ensure darkmode.js is correctly linked in HTML
Verify button ID (theme-toggle) matches in JS
Add proper [data-theme="dark"] CSS styles
Load script at the bottom of the page

📷 Additional Notes

This issue affects user experience as theme switching is a core UI feature.

🚀 Contribution

I would like to work on this issue and fix the dark mode functionality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions