Skip to content

[GOOD FIRST ISSUE] Add dark mode toggle #1

@Priyanshu-byte-coder

Description

@Priyanshu-byte-coder

What needs to be done

Add a dark/light mode toggle button to the dashboard. Clicking it switches between dark (current default) and light theme.

Why this matters

Many users prefer light mode. This is one of the most-requested features and a great entry point into the component architecture.

Exact files to edit

1. src/app/dashboard/page.tsx — add the toggle button to the top bar area

2. src/components/DashboardHeader.tsx — place the toggle button here (next to the sign-out button)

3. src/app/globals.css — add light mode CSS variables (or use Tailwind dark: classes throughout)

Recommended approach

Use Tailwind's built-in dark mode. In tailwind.config.ts, set:

darkMode: 'class'

Then toggle a dark class on <html> using localStorage to persist the preference.

A minimal toggle component:

"use client";
import { useEffect, useState } from "react";

export default function ThemeToggle() {
  const [dark, setDark] = useState(true);

  useEffect(() => {
    document.documentElement.classList.toggle("dark", dark);
    localStorage.setItem("theme", dark ? "dark" : "light");
  }, [dark]);

  return (
    <button onClick={() => setDark((d) => !d)}>
      {dark ? "☀️ Light" : "🌙 Dark"}
    </button>
  );
}

Acceptance criteria

  • Toggle button visible in the dashboard header
  • Clicking it switches between dark and light theme
  • Preference persists across page refreshes (localStorage)
  • npm run lint and npm run type-check pass

Setup

See DEVELOPMENT.md to get running locally in under 10 minutes.

Mentorship

Comment "I'd like to work on this" to get assigned. Maintainer will respond within 48h.

Metadata

Metadata

Assignees

Labels

good first issueGood for newcomersgssoc26GSSoC 2026 contribution~2hEstimated 2 hours

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions