Skip to content

chore(theme): set default theme to light#5397

Open
sammy200-ui wants to merge 2 commits into
asyncapi:website-uifrom
sammy200-ui:website-ui-default-light-theme
Open

chore(theme): set default theme to light#5397
sammy200-ui wants to merge 2 commits into
asyncapi:website-uifrom
sammy200-ui:website-ui-default-light-theme

Conversation

@sammy200-ui
Copy link
Copy Markdown
Contributor

@sammy200-ui sammy200-ui commented May 11, 2026

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

  • Bug Fixes
    • Updated dark mode detection to use only stored theme preference. System color scheme preference is no longer applied as a fallback, defaulting to light mode when no preference is saved.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 035835de-4d6c-48be-8e9e-ba80a362c235

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Dark 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.

Changes

Dark Mode Detection Behavior

Layer / File(s) Summary
Server-side Bootstrap
pages/_document.tsx
Dark mode bootstrap script now uses only localStorage theme value, removing fallback to window.matchMedia('(prefers-color-scheme: dark)').
Client-side Detection
components/DarkModeToggle.tsx
Component useEffect now uses only localStorage theme value, removing system preference detection.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🌙 The theme now lives in localStorage alone,
System whispers fade, no preference known,
Light mode waits as default when none is shown,
Two synchronized paths, consistently honed! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore(theme): set default theme to light' accurately describes the main change: removing the system preference fallback so the default theme becomes light mode instead of following the system color scheme.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 11, 2026

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 1083aff
🔍 Latest deploy log https://app.netlify.com/projects/asyncapi-website/deploys/6a08926555e37600081949cb
😎 Deploy Preview https://deploy-preview-5397--asyncapi-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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: dark check from the pre-hydration theme script in _document.tsx.
  • Removed the system prefers-color-scheme: dark check from the DarkModeToggle mount logic so only localStorage.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
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (80655ae) to head (1083aff).
⚠️ Report is 8 commits behind head on website-ui.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sammy200-ui
Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

✅ Actions performed

Full review triggered.

Comment thread pages/_document.tsx
@sammy200-ui
Copy link
Copy Markdown
Contributor Author

@princerajpoot20 Ready for review

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To Be Triaged

Development

Successfully merging this pull request may close these issues.

3 participants