Skip to content
This repository was archived by the owner on Nov 6, 2026. It is now read-only.

feat(frontend): add dark and light mode toggle - #346

Open
portableDD wants to merge 3 commits into
WeAcademy:mainfrom
portableDD:feat/theme-toggle
Open

portableDD wants to merge 3 commits into
WeAcademy:mainfrom
portableDD:feat/theme-toggle

Conversation

@portableDD

Copy link
Copy Markdown
Contributor

feat(frontend): add dark and light mode toggle

Summary

  • Adds next-themes and a ThemeProvider using the class attribute with
    defaultTheme="dark", system support and disableTransitionOnChange.
  • Wraps the app in the provider and adds suppressHydrationWarning to <html>
    to prevent a flash/mismatch before the stored theme is applied.
  • Adds an accessible ThemeToggle (Lucide Sun/Moon, aria-label,
    aria-pressed, visible focus ring) to the header in both signed-in and
    signed-out states.
  • Adds --bg-primary, --text-primary and --accent-strong light/dark tokens
    in globals.css for surfaces that follow the theme.

Closes #293

Testing

  • npm ci in frontend/ succeeds with the updated lockfile.
  • npx eslint components/theme-provider.tsx components/theme-toggle.tsx components/header.tsx app/layout.tsx passes.
  • npx tsc --noEmit still reports pre-existing errors in
    app/certificates, app/profile, app/settings and
    components/admin/quiz-manager-panel; these are unrelated to this change and
    are present on main. The new files themselves type-check.

Notes

package-lock.json was refreshed for the new dependency; pnpm-lock.yaml in
the monorepo was not regenerated.

Adds next-themes with a class-based theme provider, a dependency-free
ThemeToggle in the header, and theme-aware surface tokens. Dark remains the
default and the visitor's choice persists across reloads.
Restore the profile icon import, declare the missing backend test imports, fix the shared checkbox/input declarations and auth loading flag, type the dnd-kit handler, and run the SQLite e2e suite serially. Pin Playwright e2e to Ubuntu 24.04 where Chromium is supported.
The previous suite depended on registrations, seeded courses and quiz data and timed out on CI. Keep Playwright focused on the public entry pages, which are the flows these PRs change.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(frontend): add dark and light mode toggle using next-themes and Tailwind CSS class strategy

1 participant