-
Notifications
You must be signed in to change notification settings - Fork 126
Fix: improved dark mode styles and theme toggle transparency #198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Ashfaq Sayeed Shaik <[email protected]>
There was a problem hiding this 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 dark mode theme for the blog application using next-themes. The changes introduce a theme toggle component, update all UI components with dark mode variants, and establish a consistent color system using CSS custom properties.
Key changes:
- Added
next-themespackage (v0.4.6) and integrated ThemeProvider in the app root - Created a ThemeToggle component with sun/moon icons for theme switching
- Updated all components with dark mode-specific styling using Tailwind's
dark:prefix - Refactored CSS variables to support light/dark themes with consistent HSL color values
Reviewed Changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Added next-themes dependency |
| package-lock.json | Lockfile update for next-themes |
| pages/_app.tsx | Wrapped app with ThemeProvider |
| components/ThemeToggle.tsx | New theme toggle button component |
| components/header.tsx | Added ThemeToggle to header navigation |
| styles/index.css | Comprehensive dark mode CSS with variables, duplicate button styles removed and consolidated |
| pages/index.tsx | Updated Technology/Community buttons with dark mode borders |
| components/post-card.tsx | Added dark mode styling to blog post cards |
| components/hero-post.tsx | Updated hero post with dark theme support |
| components/topBlogs.tsx | Added dark mode to section headings and "see all" buttons |
| components/tweets.tsx | Dark mode styling for tweet cards |
| components/testimonials.tsx | Dark mode support for testimonial section |
| components/more-stories.tsx | Updated heading tag from h2 to h3 for consistency |
| components/navbar/main-nav.tsx | Dark mode styling for navigation menus and dropdowns |
Comments suppressed due to low confidence (1)
components/header.tsx:71
- The link opens in a new tab but doesn't inform screen reader users. Consider adding
aria-label=\"Sign In (opens in new tab)\"or similar accessible text to the link element.
<Button asChild className="ml-[8px]">
<a
href="https://app.keploy.io/signin"
target="_blank"
rel="noopener noreferrer"
>
Sign In
</a>
</Button>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /* === White border fix for dark mode buttons (like Technology & Community) === */ | ||
| .dark .btn, .dark .btn-sm { | ||
| border-color: #ffffff !important; | ||
| color: #ffffff !important; | ||
| } | ||
|
|
||
| .btn-sm { | ||
| @apply px-4 py-2; | ||
| .dark .btn:hover, .dark .btn-sm:hover { | ||
| background-color: rgba(255, 255, 255, 0.1); | ||
| } |
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate dark mode button styling exists at lines 136-143 and 268-287. The first instance handles .btn and .btn-sm, while the second handles .btn, .btn-outline, .btn-sm, .nav-btn, button, and a.btn. These should be consolidated into a single rule to avoid maintainability issues and ensure consistent styling across all button variants.
| .hamburger.active svg > :first-child { | ||
| opacity: 0; | ||
| y: 11; | ||
| opacity: 0; y: 11; |
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Multiple CSS property declarations should be on separate lines for better readability and maintainability. This applies to this line and similar patterns throughout the file (lines 79, 112-113).
| opacity: 0; y: 11; | |
| opacity: 0; | |
| y: 11; |
| :root .blog-card, :root .post-card, :root .blog-tile { | ||
| background-color: hsl(var(--card)); | ||
| color: hsl(var(--card-foreground)); | ||
| } | ||
| .dark .blog-card, .dark .post-card, .dark .blog-tile { | ||
| background-color: hsl(var(--card)); | ||
| color: hsl(var(--card-foreground)); | ||
| } |
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The :root scoped styling for blog cards (lines 257-260) appears redundant since these classes already apply bg-card and text-card-foreground via Tailwind on line 252. The dark mode override (lines 261-264) uses the same CSS variables, making these explicit declarations unnecessary.
| :root .blog-card, :root .post-card, :root .blog-tile { | |
| background-color: hsl(var(--card)); | |
| color: hsl(var(--card-foreground)); | |
| } | |
| .dark .blog-card, .dark .post-card, .dark .blog-tile { | |
| background-color: hsl(var(--card)); | |
| color: hsl(var(--card-foreground)); | |
| } |
| .hamburger svg > :first-child, | ||
| .hamburger svg > :nth-child(2), | ||
| .hamburger svg > :nth-child(3) { | ||
| transform-origin: center; |
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 108 is missing the transform: rotate(0deg); property that was removed. This property was part of the original hamburger animation state and should be retained to ensure the default state is explicitly defined for the non-active hamburger menu.
| transform-origin: center; | |
| transform-origin: center; | |
| transform: rotate(0deg); |
| import dynamic from 'next/dynamic' | ||
|
|
||
| import dynamic from 'next/dynamic'; | ||
| import { ThemeProvider } from "next-themes"; // 👈 added this |
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The inline comment // 👈 added this should be removed. Code comments should explain 'why' rather than 'what was added', and this type of comment is typically only useful during the review process.
| import { ThemeProvider } from "next-themes"; // 👈 added this | |
| import { ThemeProvider } from "next-themes"; |
| ref={ref} | ||
| style={springStyles} | ||
| className=" | ||
| bg-white dark:bg-[#1a1a1a] |
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hardcoded color #1a1a1a should use the CSS custom property instead (e.g., dark:bg-[hsl(var(--card))] or define a Tailwind color token) to maintain consistency with the design system established in the CSS variables.
| bg-white dark:bg-[#1a1a1a] | |
| bg-white dark:bg-[hsl(var(--card))] |
| <Link | ||
| href="/technology" | ||
| className="text-orange-500 hover:text-orange-600 font-semibold flex items-center transition-colors duration-300" | ||
| className="see-all-btn inline-flex items-center font-semibold px-5 py-2 rounded-lg border border-gray-300 dark:border-white text-orange-500 dark:text-white bg-transparent dark:bg-[#2b2b30] hover:bg-orange-100 dark:hover:bg-[#3a3a40] hover:text-orange-600 dark:hover:border-orange-400 transition-all duration-300" |
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multiple hardcoded colors (#2b2b30, #3a3a40) are used instead of CSS custom properties. Consider using dark:bg-card and dark:hover:bg-muted or defining these as Tailwind theme colors to maintain consistency with the design system.
| className="see-all-btn inline-flex items-center font-semibold px-5 py-2 rounded-lg border border-gray-300 dark:border-white text-orange-500 dark:text-white bg-transparent dark:bg-[#2b2b30] hover:bg-orange-100 dark:hover:bg-[#3a3a40] hover:text-orange-600 dark:hover:border-orange-400 transition-all duration-300" | |
| className="see-all-btn inline-flex items-center font-semibold px-5 py-2 rounded-lg border border-gray-300 dark:border-white text-orange-500 dark:text-white bg-transparent dark:bg-card hover:bg-orange-100 dark:hover:bg-muted hover:text-orange-600 dark:hover:border-orange-400 transition-all duration-300" |
| </h3> | ||
|
|
||
| {/* === Testimonials Section === */} | ||
| <div className="relative flex mb-8 h-[700px] w-full flex-col items-center justify-center overflow-hidden rounded-lg border border-gray-200 dark:border-gray-700 bg-white dark:bg-[hsl(220,14%,18%)] transition-colors duration-500"> |
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dark background uses a hardcoded HSL value hsl(220,14%,18%) that matches the --card variable. This should use dark:bg-card instead for consistency with the design system.
| <div className="relative flex mb-8 h-[700px] w-full flex-col items-center justify-center overflow-hidden rounded-lg border border-gray-200 dark:border-gray-700 bg-white dark:bg-[hsl(220,14%,18%)] transition-colors duration-500"> | |
| <div className="relative flex mb-8 h-[700px] w-full flex-col items-center justify-center overflow-hidden rounded-lg border border-gray-200 dark:border-gray-700 bg-white dark:bg-card transition-colors duration-500"> |
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| className="bg-white border border-gray-200 p-6 rounded-lg shadow-sm hover:shadow-lg transition-shadow duration-300 m-2 block" | ||
| className="bg-white dark:bg-[#1f1f23] border border-gray-200 dark:border-gray-700 p-6 rounded-lg shadow-sm hover:shadow-lg hover:scale-[1.02] transition-all duration-300 m-2 block" |
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hardcoded color #1f1f23 should use the CSS custom property dark:bg-card to maintain consistency with the design system.
| className="bg-white dark:bg-[#1f1f23] border border-gray-200 dark:border-gray-700 p-6 rounded-lg shadow-sm hover:shadow-lg hover:scale-[1.02] transition-all duration-300 m-2 block" | |
| className="bg-white dark:bg-card border border-gray-200 dark:border-gray-700 p-6 rounded-lg shadow-sm hover:shadow-lg hover:scale-[1.02] transition-all duration-300 m-2 block" |
|
@copilot open a new pull request to apply changes based on the comments in this thread |
1d8d6a9 to
3fb7cbe
Compare
|
Hi @amaan-bhati , I've implemented fixes to improve dark mode consistency and the theme toggle design across the site. |
Summary
This pull request improves the dark mode styling across the blog website, ensuring a consistent and cohesive visual experience throughout all sections.
Changes Made
Testing
Screenshots (Before & After)
Please find below the visual comparison of changes made:
Before
Home page (light and dark mode)

Technology “Latest Blog” section in dark mode

After
Home page with improved dark mode styling

Technology “Latest Blog” section with proper dark theme

Theme Toggle Button


Transparent theme toggle button blending smoothly in both modes