Skip to content

Add a dark mode toggle to the nav bar persisting the user's preference in localStorage #750

Description

@Chucks1093

Summary

The app currently has no dark mode support. A toggle in the nav bar should switch between light and dark themes, persist the preference in localStorage, and respect the user's OS preference on first visit.

Scope

  • Add a sun/moon icon toggle to the nav bar
  • On first visit, read prefers-color-scheme from the OS and apply the matching theme
  • On toggle, apply the new theme and persist it in localStorage under theme
  • On subsequent visits, read localStorage first; fall back to OS preference if absent
  • Apply the theme class to the <html> element so Tailwind's dark mode variants work globally

Acceptance Criteria

  • Toggle switches between light and dark themes
  • OS preference applied on first visit
  • Preference persisted in localStorage
  • Correct theme applied on subsequent visits without flash
  • Theme class applied to <html> element

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third Campaign

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions