You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a theme toggle button so visitors can switch the site between light and dark mode. The choice should be remembered across visits.
Proposed Implementation
Move the colours in style.css into CSS variables (e.g. --bg, --text, --accent) defined on :root, with an overriding set under [data-theme="dark"] or [data-theme="light"].
Add a toggle button (sun/moon icon) in the header or navbar in index.html.
In script.js, switch the data-theme attribute on when the button is clicked.
Save the choice in localStorage and apply it on page load.
On first visit, default to the user’s system setting using prefers-color-scheme.
Set the toggle’s aria-label, and make it keyboard accessible.
Additional Context
No response
Checklist
I confirm that I want to work on this feature.
I have searched the existing issues for similar feature requests.
Activity