chore(theme): set default theme to light#5397
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughDark mode detection is simplified in two places: the server-side document bootstrap and the client-side component. Both changes remove the system color-scheme preference fallback, defaulting to light mode when localStorage contains no theme setting. ChangesDark Mode Detection Behavior
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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. Comment |
✅ Deploy Preview for asyncapi-website ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR updates the site’s theme initialization logic so that Light is the default on first visit, while still respecting an explicitly stored user preference in localStorage.
Changes:
- Removed the system
prefers-color-scheme: darkcheck from the pre-hydration theme script in_document.tsx. - Removed the system
prefers-color-scheme: darkcheck from theDarkModeTogglemount logic so onlylocalStorage.theme === 'dark'enables dark mode.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
pages/_document.tsx |
Defaults to light by only enabling dark mode when localStorage.theme is explicitly "dark" before hydration. |
components/DarkModeToggle.tsx |
Aligns client-side toggle initialization with the new default: dark mode only when stored theme is "dark". |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## website-ui #5397 +/- ##
============================================
Coverage 100.00% 100.00%
============================================
Files 22 22
Lines 830 830
Branches 159 159
============================================
Hits 830 830 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
|
@princerajpoot20 Ready for review |
|



As discussed in #5103 (comment)
Changed the default to Light - https://deploy-preview-5397--asyncapi-website.netlify.app/en
The only issue is if the user has previously visited the site and has set the theme to Dark then it checks for localStorage and sets it to dark.
Summary by CodeRabbit