Skip to content

Add dark mode toggle to ElevenLabs site template#23

Merged
adityaoberai merged 2 commits intomainfrom
add-elevenlabs-template-dark-mode-toggle
Nov 7, 2025
Merged

Add dark mode toggle to ElevenLabs site template#23
adityaoberai merged 2 commits intomainfrom
add-elevenlabs-template-dark-mode-toggle

Conversation

@adityaoberai
Copy link
Copy Markdown
Contributor

@adityaoberai adityaoberai commented Nov 7, 2025

What does this PR do?

Adds dark mode toggle to ElevenLabs site template

Test Plan

image image

Related PRs and Issues

#22

Have you read the Contributing Guidelines on issues?

Yes

Summary by CodeRabbit

  • New Features

    • Added a site-wide light/dark theme provider and a header theme toggle.
    • App now respects system theme preference and persists user choice.
  • Style

    • Introduced global theme-aware transition utilities and a reduced-motion guard.
    • Adjusted main container vertical padding for tighter spacing.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 7, 2025

Walkthrough

Adds client-side theming to the Next.js text-to-speech app: a ThemeProvider component that manages light/dark state (persisted to localStorage and responsive to system preferences), a ThemeToggle button component, wraps the root layout with the provider, updates the page to include the toggle in the header and reduces vertical padding, and extends globals.css with a custom dark variant plus global transition and reduced-motion rules.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • ThemeProvider.tsx: review initialization, localStorage usage, system preference listener, DOM class and color-scheme updates, and SSR guards.
  • ThemeToggle.tsx: verify mounted-state handling to avoid hydration mismatches and correct toggle behavior/ARIA.
  • globals.css: validate custom variant syntax and the added global transition and reduced-motion rules.
  • layout.tsx and page.tsx: confirm provider wrapper placement and the header toggle integration do not introduce layout shifts or import path issues.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add dark mode toggle to ElevenLabs site template' directly and accurately summarizes the main change: implementing a dark mode toggle feature for the ElevenLabs template.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-elevenlabs-template-dark-mode-toggle

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c0a7fef and 15b65f8.

📒 Files selected for processing (1)
  • nextjs/text-to-speech/app/globals.css (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • nextjs/text-to-speech/app/globals.css

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@Meldiron Meldiron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

Design nitpick, there seems to be slign animation when switching modes. Lets try to find quick fix, if complex, good enough.

@adityaoberai
Copy link
Copy Markdown
Contributor Author

Approved.

Design nitpick, there seems to be slign animation when switching modes. Lets try to find quick fix, if complex, good enough.

Transition is now applied consistently everywhere

@adityaoberai adityaoberai merged commit f9437a5 into main Nov 7, 2025
1 check passed
@adityaoberai adityaoberai deleted the add-elevenlabs-template-dark-mode-toggle branch November 7, 2025 17:48
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.

2 participants