Skip to content

fix: background not changing in dark/light mode toggle #220 - #225

Open
Ashrithhn wants to merge 1 commit into
Skrishna0703:mainfrom
Ashrithhn:main
Open

fix: background not changing in dark/light mode toggle #220#225
Ashrithhn wants to merge 1 commit into
Skrishna0703:mainfrom
Ashrithhn:main

Conversation

@Ashrithhn

Copy link
Copy Markdown

Closes #123

Description

This PR fixes the issue where only the text color changed when switching between Dark and Light mode, while the background remained static.
The update ensures that both text and background colors change smoothly and consistently when toggling themes.

Changes Made

Updated Home.css to include background color rules for both dark and light modes.

Added proper CSS variables or conditional classes for background theming.

Ensured smooth transitions between themes using CSS transitions.

Verified that the fix applies correctly across all pages wrapped by Home.jsx.

Why This Change

Improves visual consistency during theme changes.

Fixes incomplete dark/light mode behavior that affected the user experience.

Keeps theme switching smooth and modern-looking.

Testing Steps

  1. Toggle between Dark and Light modes.

  2. Verify that both text and background colors update correctly.

  3. Confirm that transitions are smooth and no flickering occurs.

Type of Change

[x] Bug Fix

[ ] Enhancement

[ ] New Feature

Checklist

[x] Verified background and text colors change as expected

[x] Tested across multiple components using the Home layout

[x] No new console errors introduced

Screenshots (if Aplicable)

WhatsApp.Video.2025-10-09.at.13.04.35_3f066a17.mp4

@github-actions

github-actions Bot commented Oct 9, 2025

Copy link
Copy Markdown

Thanks for creating a PR for your Issue! ☺️

We'll review it as soon as possible.
In the meantime, please double-check the file changes and ensure that all commits are accurate.

If there are any unresolved review comments, feel free to resolve them. 🙌🏼

@Ashrithhn

Copy link
Copy Markdown
Author

@Skrishna0703 please check the pr once

@Ashrithhn

Copy link
Copy Markdown
Author

@Skrishna0703 can you please review and merge pr i worked on my own

/* Light mode (default) */
.light body,
.light .Home {
background-color: #ffffff !important;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Avoid excessive !important usage to prevent future styling conflicts and allow component-level text color overrides

/* ===============================
Global Light/Dark Background
=============================== */

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Centralizes background and text color transitions to avoid duplication and keep theme switching smooth and consistent

@@ -19,20 +19,21 @@ export const Home = () => {
const token = localStorage.getItem("token");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ensures API request is made only when a valid token exists, preventing unnecessary or unauthorized backend calls

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