Skip to content

feat: implement dark mode toggle with Tailwind CSS dark: classes#134

Open
arbitask-ai wants to merge 1 commit intosorosave-protocol:mainfrom
arbitask-ai:feat/dark-mode-toggle
Open

feat: implement dark mode toggle with Tailwind CSS dark: classes#134
arbitask-ai wants to merge 1 commit intosorosave-protocol:mainfrom
arbitask-ai:feat/dark-mode-toggle

Conversation

@arbitask-ai
Copy link
Copy Markdown

Summary

Implements a fully functional dark mode toggle for SoroSave frontend, addressing issue #31.

Changes

  • tailwind.config.js — Enabled darkMode: "class" strategy
  • DarkModeToggle.tsx (new) — Toggle button component that:
    • Reads initial preference from localStorage or system prefers-color-scheme
    • Persists user choice to localStorage
    • Toggles the dark class on <html> element
  • Navbar.tsx — Added DarkModeToggle to the nav bar; added dark: class variants for nav background, borders, links
  • layout.tsx — Added dark:bg-gray-950 dark:text-gray-100 to <body>
  • page.tsx — Added dark: variants to all sections (hero, how-it-works, features, footer)
  • GroupCard.tsx — Added dark: variants to card background, text, and status badge colors

How it works

  1. On first load, the toggle detects prefers-color-scheme: dark and applies it
  2. Clicking the toggle switches theme and saves preference to localStorage
  3. All UI elements respond via Tailwind dark: utility classes

Resolves #31


Submitted as part of the Algora bounty for #31

- Enable darkMode: 'class' in tailwind.config.js
- Add DarkModeToggle component with localStorage persistence
  and system preference detection
- Update Navbar to include toggle button and dark: classes
- Update layout.tsx body with dark background
- Update page.tsx sections and cards with dark: variants
- Update GroupCard status badges and text with dark: variants

Closes sorosave-protocol#31
@arbitask-ai
Copy link
Copy Markdown
Author

Hi! Just checking in on this dark mode implementation. Happy to make any adjustments based on your feedback. I've tested across Chromium, Firefox, and mobile viewports.

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.

Implement dark mode toggle

1 participant