Skip to content

Comments

🐛 Fix: dark mode switch button appears dark in light mode #1194

Merged
clubanderson merged 1 commit intomainfrom
fix/dark-mode-toggle-button-light-mode
Feb 24, 2026
Merged

🐛 Fix: dark mode switch button appears dark in light mode #1194
clubanderson merged 1 commit intomainfrom
fix/dark-mode-toggle-button-light-mode

Conversation

@btwshivam
Copy link
Collaborator

The pre-mount placeholder for the ThemeToggle button used bg-gray-200 which appears as a dark gray in light mode. Changed to bg-white with a border to match the mounted button's light mode appearance and prevent visual flash on page load.

📌 Fixes

Fixes #1192


📝 Summary of Changes

  • Short description of what was changed
  • Include links to related issues/discussions if any

Changes Made

  • Updated ...
  • Refactored ...
  • Fixed ...
  • Added tests for ...

Checklist

Please ensure the following before submitting your PR:

  • I have reviewed the project's contribution guidelines.
  • I have written unit tests for the changes (if applicable).
  • I have updated the documentation (if applicable).
  • I have tested the changes locally and ensured they work as expected.

Screenshots or Logs (if applicable)


👀 Reviewer Notes

Add any special notes for the reviewer here

Copilot AI review requested due to automatic review settings February 22, 2026 20:35
@kubestellar-prow kubestellar-prow bot added the dco-signoff: no Indicates the PR's author has not signed the DCO. label Feb 22, 2026
@kubestellar-prow
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign btwshivam for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@netlify
Copy link

netlify bot commented Feb 22, 2026

Deploy Preview for kubestellar-docs ready!

Name Link
🔨 Latest commit 965b0fd
🔍 Latest deploy log https://app.netlify.com/projects/kubestellar-docs/deploys/699b690ff3e18400084da812
😎 Deploy Preview https://deploy-preview-1194--kubestellar-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@github-actions
Copy link
Contributor

Welcome to KubeStellar! 🚀 Thank you for submitting this Pull Request.

Before your PR can be merged, please ensure:

DCO Sign-off - All commits must be signed off with git commit -s to certify the Developer Certificate of Origin

PR Title - Must start with an emoji: ✨ (feature), 🐛 (bug fix), 📖 (docs), 🌱 (infra/tests), ⚠️ (breaking change)

Getting Started with KubeStellar:

Contributor Resources:


🌟 Help KubeStellar Grow - We Need Adopters!

Our roadmap is driven entirely by adopter feedback. Whether you're using KubeStellar yourself or know someone who could benefit from multi-cluster Kubernetes:

📋 Take our Multi-Cluster Survey - Share your use cases and help shape our direction!


A maintainer will review your PR soon. Feel free to ask questions in the comments or on Slack!

@kubestellar-prow kubestellar-prow bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 22, 2026
The pre-mount placeholder for the ThemeToggle button used bg-gray-200
which appears as a dark gray in light mode. Changed to bg-white with a
border to match the mounted button's light mode appearance and prevent
visual flash on page load.

Signed-off-by: btwshivam <shivam200446@gmail.com>
@btwshivam btwshivam force-pushed the fix/dark-mode-toggle-button-light-mode branch from 5cac75a to 965b0fd Compare February 22, 2026 20:37
@kubestellar-prow kubestellar-prow bot added dco-signoff: yes Indicates the PR's author has signed the DCO. and removed dco-signoff: no Indicates the PR's author has not signed the DCO. labels Feb 22, 2026
Copy link
Contributor

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 addresses a visual mismatch on initial page load by updating the pre-mount placeholder styling for the docs theme toggle so it matches the light-mode appearance and avoids a dark-looking flash.

Changes:

  • Updated ThemeToggle pre-mount button styles from bg-gray-200 to bg-white with border styling to match the mounted state.
  • Adjusted SidebarFooter styling for pre-mount and mounted renders (background/border now driven by inline styles rather than Tailwind dark: classes).
  • Minor formatting changes in SidebarFooter JSX.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/components/docs/ThemeToggle.tsx Updates the SSR/pre-mount placeholder button styling to match the mounted light-mode toggle appearance.
src/components/docs/SidebarFooter.tsx Refactors footer background/border styling (including SSR/pre-mount behavior), plus formatting changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@clubanderson clubanderson left a comment

Choose a reason for hiding this comment

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

1190 🐛 Fix: resolve hydration mismatch in RelatedProjects links oksaumya

Copy link
Contributor

@clubanderson clubanderson left a comment

Choose a reason for hiding this comment

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

Review

Fixes the reported issue — the pre-mount placeholder no longer flashes dark in light mode. The inline-style approach for SidebarFooter background/border works correctly.

Notes:

  • The pre-mount placeholder now assumes light mode (bg-white). Users with dark mode preference will see a brief light flash before the theme resolves. This is an acceptable tradeoff.
  • Hardcoded hex colors (#ffffff, #111827, #1f2937, #e5e7eb) match Tailwind palette but are less maintainable than Tailwind classes.
  • Unrelated reformatting of Moon/Sun className template literals adds noise to the diff.

Broader concern: This PR (and #1195) replace idiomatic Tailwind dark: classes with JS-driven inline styles to work around hydration timing. The root cause is that html.dark isn't reliably set before first paint. A blocking <script> in <head> to set the dark class before hydration would fix this at the source and let you keep using Tailwind dark: classes everywhere. Worth filing a follow-up issue for that.

/lgtm

@kubestellar-prow kubestellar-prow bot added the lgtm Indicates that a PR is ready to be merged. label Feb 24, 2026
@kubestellar-prow
Copy link

LGTM label has been added.

DetailsGit tree hash: d0ff6a28725502006acee28642a777724030c073

@clubanderson
Copy link
Contributor

@copilot Please clean up this PR:

  1. Remove the unrelated reformatting changes — the Moon/Sun className template literal line break changes and trailing whitespace cleanups on style={{ lines are noise. Only keep the actual fix (pre-mount placeholder styling and inline background/border colors).
  2. Add a brief code comment mapping the hardcoded hex values to their Tailwind equivalents, e.g.: // gray-900 (#111827), white (#ffffff), gray-800 (#1f2937), gray-200 (#e5e7eb)

Copy link
Contributor

Copilot AI commented Feb 24, 2026

@clubanderson I've opened a new pull request, #1203, to work on those changes. Once the pull request is ready, I'll request review from you.

@clubanderson clubanderson merged commit 4da2aa1 into main Feb 24, 2026
20 of 21 checks passed
@kubestellar-prow kubestellar-prow bot deleted the fix/dark-mode-toggle-button-light-mode branch February 24, 2026 03:39
@github-actions
Copy link
Contributor

🎉 Thank you for your contribution! Your PR has been successfully merged.


🌟 Help KubeStellar Grow - We Need Adopters!

Our roadmap is driven entirely by adopter feedback - nothing else. Whether you're using KubeStellar yourself or know organizations that could benefit from multi-cluster Kubernetes, we need your help:

📋 Take our Multi-Cluster Survey - Share your use cases and help shape our direction!

🗣️ Spread the word - Tell colleagues, write blog posts, present at meetups

💬 Share feedback on Slack #kubestellar-dev

Every adopter story helps us prioritize what matters most. Thank you for being part of the KubeStellar community!

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

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. frontend lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. typescript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dark Mode switch button is Dark in light mode

3 participants