Skip to content

Conversation

asr1325
Copy link

@asr1325 asr1325 commented Oct 5, 2025

Ref. #12

Description

Implemented light mode for hackerblog-frontend.

Screenshot 2025-10-06 at 12 04 38 AM Screenshot 2025-10-06 at 12 04 58 AM

Copy link

vercel bot commented Oct 5, 2025

@asr1325 is attempting to deploy a commit to the notshrirang's projects Team on Vercel.

A member of the Team first needs to authorize it.

@asr1325
Copy link
Author

asr1325 commented Oct 5, 2025

Hey! I've finally implemented light mode for your open-source project after trying hard, but few color schemes have changed from the previous version. Although the light mode works flawlessly.
No change in layout but few colors are changed from the last time. @NotShrirang
Only accept if you think that is fair.
Thank you for extending the time!

Copy link

vercel bot commented Oct 6, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
hackerblog Ready Ready Preview Comment Oct 6, 2025 3:09am

@NotShrirang NotShrirang requested a review from Copilot October 6, 2025 03:15
@NotShrirang NotShrirang self-assigned this Oct 6, 2025
@NotShrirang NotShrirang added enhancement New feature or request hacktoberfest For hacktoberfest 2025 hacktoberfest-accepted Accepting for HacktoberFest 2025 labels Oct 6, 2025
@NotShrirang NotShrirang linked an issue Oct 6, 2025 that may be closed by this pull request
Copy link
Contributor

@Copilot 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 implements a comprehensive light mode feature for the hackerblog-frontend application. The implementation introduces a theme context system that allows users to toggle between light and dark modes, with CSS custom properties (CSS variables) used throughout the application for consistent theming.

Key Changes:

  • Added a ThemeContext with localStorage persistence for theme preferences
  • Introduced CSS custom properties in theme.css for light and dark color schemes
  • Updated all UI components to use CSS variables instead of hardcoded colors
  • Added a theme toggle button in the navigation bar

Reviewed Changes

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

Show a summary per file
File Description
src/style/theme.css Defines CSS custom properties for light and dark themes
src/context/ThemeContext.jsx Provides theme context with toggle functionality and localStorage persistence
src/App.jsx Wraps application with ThemeProvider and imports theme styles
src/components/TopBar.jsx Adds theme toggle button to navigation
src/components/TopBar.css Updates styles to use CSS variables
src/pages/AuthPages.css Converts hardcoded colors to CSS variables
src/layout/Layout.css Updates background to use CSS variables
src/components/ui/*.jsx Updates all UI components to use CSS variables for theming
src/components/Footer.jsx Converts footer styling to use CSS variables

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

--brand-hover-color: rgb(140,120,255);
--danger-color: #ff7b7b;
--danger-hover-color: #ff4d4d;
--card-bg: #ffffff;
Copy link
Preview

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

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

The light theme is missing CSS custom properties that are used elsewhere in the codebase (--text-muted, --card-bg-light, --card-gradient, --card-border). These should be defined to prevent fallback to undefined values.

Suggested change
--card-bg: #ffffff;
--card-bg: #ffffff;
--text-muted: #6c6c80;
--card-bg-light: #f8f8ff;
--card-gradient: linear-gradient(135deg, #e9e8fc 0%, #f7f6ff 100%);
--card-border: 1px solid #e0e0f0;

Copilot uses AI. Check for mistakes.

</h3>
<p
className="font-google-code text-sm leading-relaxed text-center"
style={{ color: "var(--text-muted)" }}
Copy link
Preview

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

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

The CSS custom property '--text-muted' is used but not defined in the theme.css file. This will result in no color being applied.

Copilot uses AI. Check for mistakes.

rel="noopener noreferrer"
className="flex items-center justify-center w-10 h-10 rounded-lg text-xl transition-all duration-300 hover:-translate-y-0.5"
style={{
backgroundColor: "var(--card-bg-light)",
Copy link
Preview

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

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

The CSS custom properties '--card-bg-light' and '--text-muted' are used but not defined in the theme.css file. These will result in no styling being applied.

Copilot uses AI. Check for mistakes.

e.currentTarget.style.boxShadow = "0 4px 12px rgba(160,160,255,0.3)";
}}
onMouseLeave={(e) => {
e.currentTarget.style.backgroundColor = "var(--card-bg-light)";
Copy link
Preview

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

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

The CSS custom properties '--card-bg-light' and '--text-muted' are used but not defined in the theme.css file. These will result in no styling being applied.

Copilot uses AI. Check for mistakes.

<span
key={subIndex}
className="text-sm cursor-not-allowed"
style={{ color: "var(--text-muted)" }}
Copy link
Preview

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

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

The CSS custom properties '--card-bg-light' and '--text-muted' are used but not defined in the theme.css file. These will result in no styling being applied.

Copilot uses AI. Check for mistakes.

key={item.title}
className="flex items-center gap-1 px-3 py-1 rounded-full text-xs font-medium"
style={{
backgroundColor: "var(--card-bg-light)",
Copy link
Preview

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

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

The CSS custom properties '--card-bg-light' and '--text-muted' are used but not defined in the theme.css file. These will result in no styling being applied.

Copilot uses AI. Check for mistakes.

Comment on lines +13 to +14
background: "var(--card-gradient)",
borderColor: "var(--card-border)",
Copy link
Preview

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

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

The CSS custom properties '--card-gradient' and '--card-border' are used but not defined in the theme.css file. This will result in no styling being applied.

Copilot uses AI. Check for mistakes.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@NotShrirang
Copy link
Contributor

@asr1325 Can you fix these suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest For hacktoberfest 2025 hacktoberfest-accepted Accepting for HacktoberFest 2025
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Implement light mode
2 participants