Skip to content

✨ feat: Add light/dark mode toggle with theme persistence#104

Merged
DeadIndian merged 7 commits into
DeadIndian:mainfrom
sandeepsidar1210-rgb:feature/light-dark-mode-toggle
Jun 3, 2026
Merged

✨ feat: Add light/dark mode toggle with theme persistence#104
DeadIndian merged 7 commits into
DeadIndian:mainfrom
sandeepsidar1210-rgb:feature/light-dark-mode-toggle

Conversation

@sandeepsidar1210-rgb
Copy link
Copy Markdown
Contributor

@sandeepsidar1210-rgb sandeepsidar1210-rgb commented May 20, 2026

🎯 Overview

This PR introduces a fully functional light/dark mode toggle to the Gamify platform, enhancing user experience with theme customization and persistence.

✨ Features

  • Theme toggle button in the public navigation with sun/moon icons.
  • Smooth transitions (0.3s) for colors and UI elements.
  • Preference persisted in localStorage and restored on page load.
  • Centralized CSS variables for dark (:root) and light (.light) themes.
  • Font consistency ensured — identical typography across themes.
  • No side effects to existing components.

🛠️ Technical Implementation

New / Modified files

  • client/src/Context/ThemeContext.jsx — theme provider & hook
  • client/src/App.jsx — ThemeProvider wrapper
  • client/src/index.css — CSS variables for both themes
  • client/src/pages/Landing.jsx — theme toggle button in public nav
  • CHANGELOG.md — Unreleased entry
  • docs/screenshots/dark.png, docs/screenshots/light.png — example screenshots

✅ Testing & Verification

  • Theme toggles and UI updates correctly.
  • Preference persists across reloads.
  • Fonts identical in both modes (Space Grotesk).
  • Production build succeeded (vite build).

📸 Screenshots

Light mode
Light Mode

Dark mode
Dark Mode

📦 Commits

  • feat: add fully functional light/dark mode toggle to the UI
  • fix: restore original fonts for both dark and light modes
  • chore: fix lint - remove unused imports and allow theme hook export
  • docs: add changelog entry for light/dark theme feature
  • docs: add dark/light screenshots and capture script
  • fix: regenerate light theme screenshot correctly

🔖 Labels & Reviewers (suggested)

  • Labels: enhancement, ui, accessibility
  • Suggested reviewers: @DeadIndian

- Implement ThemeProvider context for managing dark/light mode state
- Add light mode CSS variables to index.css with proper color scheme
- Integrate theme toggle button in landing page navbar (PubNav)
- Add smooth transitions for theme switching
- Store user theme preference in localStorage
- Update ThemeContext to properly manage dark/light class toggle
- No other components affected by theme changes
- Move font and other shared variables to :root (dark mode default)
- Light mode now only overrides colors and shadows, keeping the same fonts
- Ensures consistent typography across both themes
@DeadIndian
Copy link
Copy Markdown
Owner

good work. Btw, you are from ELUSOC right? I will merge this PR once the event starts.

@sandeepsidar1210-rgb
Copy link
Copy Markdown
Contributor Author

good work. Btw, you are from ELUSOC right? I will merge this PR once the event starts.

Thanks! Yes, I am from ELUSOC. Sounds good to me, feel free to merge it once the event officially starts.

@Karanjot786
Copy link
Copy Markdown

Hey @sandeepsidar1210-rgb! Saw your work on GSSoC 2026.

We are building TermUI, a TypeScript terminal UI framework with React-style hooks and JSX, rendered entirely in the terminal.

We have 67 unassigned GSSoC issues open. 19 are marked good first issue. Your JavaScript background transfers directly.

Karanjot, TermUI maintainer

@sandeepsidar1210-rgb
Copy link
Copy Markdown
Contributor Author

Hey @sandeepsidar1210-rgb! Saw your work on GSSoC 2026.

We are building TermUI, a TypeScript terminal UI framework with React-style hooks and JSX, rendered entirely in the terminal.

We have 67 unassigned GSSoC issues open. 19 are marked good first issue. Your JavaScript background transfers directly.

Karanjot, TermUI maintainer

Hey @Karanjot786 , thanks a lot for reaching out! I checked out TermUI and it looks really interesting. I’d love to contribute to GSSoC issues. I’ll go through the open issues and start with a good first issue. Looking forward to contributing 🚀

@sandeepsidar1210-rgb
Copy link
Copy Markdown
Contributor Author

sandeepsidar1210-rgb commented Jun 2, 2026

@DeadIndian I hope you didn't forget to merge my PULL REQUEST .

@DeadIndian DeadIndian merged commit 41151d6 into DeadIndian:main Jun 3, 2026
1 of 3 checks passed
@DeadIndian DeadIndian added adventurer Level 2 issue for ELUSOC 2026 ELUSOC enhancement New feature or request labels Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adventurer Level 2 issue for ELUSOC 2026 ELUSOC enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants