-
Notifications
You must be signed in to change notification settings - Fork 40
Dark Mode Bug Fix for Blog and Projects Pages #105
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
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 adds dark mode support to the Blog and Projects pages by applying Tailwind's dark mode utility classes throughout the components. The changes ensure that backgrounds, text, borders, and interactive elements properly adapt when dark mode is active.
Key Changes
- Added dark mode variants (
dark:*) to main containers, cards, text elements, borders, and interactive components - Ensured consistent color hierarchy using gray-900 for backgrounds, gray-800 for cards, and gray-300 for text
- Applied dark mode styling to loading states, error states, filter buttons, and content sections
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| src/components/Projects/Projects.tsx | Added comprehensive dark mode classes to main container, loading/error states, header text, filter controls, project cards, and all text elements |
| src/components/Blog/Blog.tsx | Added dark mode support to main container, loading/error states, blog post cards, search input, filter buttons, community values section, and blog post detail view |
| package-lock.json | Automated npm lockfile updates adding "peer": true flags to several dependencies (unrelated to dark mode functionality) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| return ( | ||
| <div className="min-h-screen bg-gray-50 py-12"> | ||
| <div className="min-h-screen bg-gray-50 dark:bg-gray-900 py-12"> |
Copilot
AI
Dec 7, 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] For consistency with other components in the codebase (Community, Challenges, Profile, etc.), consider adding transition-colors duration-300 to the main container div to provide smooth transitions when toggling dark mode.
| <div className="min-h-screen bg-gray-50 dark:bg-gray-900 py-12"> | |
| <div className="min-h-screen bg-gray-50 dark:bg-gray-900 py-12 transition-colors duration-300"> |
| if (selectedPost) { | ||
| return ( | ||
| <div className="min-h-screen bg-gray-50 py-8"> | ||
| <div className="min-h-screen bg-gray-50 dark:bg-gray-900 py-8"> |
Copilot
AI
Dec 7, 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] For consistency with other components in the codebase (Community, Challenges, Profile, etc.), consider adding transition-colors duration-300 to the main container div to provide smooth transitions when toggling dark mode.
| <div className="min-h-screen bg-gray-50 dark:bg-gray-900 py-8"> | |
| <div className="min-h-screen bg-gray-50 dark:bg-gray-900 py-8 transition-colors duration-300"> |
| <div className="min-h-screen bg-gray-50 dark:bg-gray-900 py-12 flex items-center justify-center"> | ||
| <div className="text-center"> | ||
| <div className="animate-spin rounded-full h-12 w-12 border-b-2 border-purple-600 mx-auto mb-4"></div> | ||
| <p className="text-gray-600">Loading blog posts...</p> |
Copilot
AI
Dec 7, 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 loading text should have a dark mode variant to ensure readability on dark backgrounds. Add dark:text-gray-300 to match the pattern used elsewhere in the component.
| <p className="text-gray-600">Loading blog posts...</p> | |
| <p className="text-gray-600 dark:text-gray-300">Loading blog posts...</p> |
|
|
||
| if (error) { | ||
| return ( | ||
| <div className="min-h-screen bg-gray-50 py-12 flex items-center justify-center"> |
Copilot
AI
Dec 7, 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 error state container background is missing the dark mode class. Add dark:bg-gray-900 to the outer div to match the styling pattern used in the loading state and main content.
| <div className="min-h-screen bg-gray-50 py-12 flex items-center justify-center"> | |
| <div className="min-h-screen bg-gray-50 dark:bg-gray-900 py-12 flex items-center justify-center"> |
| <div className="min-h-screen bg-gray-50 dark:bg-gray-900 py-12 flex items-center justify-center"> | ||
| <div className="text-center"> | ||
| <div className="animate-spin rounded-full h-12 w-12 border-b-2 border-purple-600 mx-auto mb-4"></div> | ||
| <p className="text-gray-600">Loading projects...</p> |
Copilot
AI
Dec 7, 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 loading text should have a dark mode variant to ensure readability on dark backgrounds. Add dark:text-gray-300 to match the pattern used elsewhere in the component.
| <p className="text-gray-600">Loading projects...</p> | |
| <p className="text-gray-600 dark:text-gray-300">Loading projects...</p> |
|
|
||
| if (error) { | ||
| return ( | ||
| <div className="min-h-screen bg-gray-50 py-12 flex items-center justify-center"> |
Copilot
AI
Dec 7, 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 error state container background is missing the dark mode class. Add dark:bg-gray-900 to the outer div to match the styling pattern used in the loading state and main content.
| <div className="min-h-screen bg-gray-50 py-12 flex items-center justify-center"> | |
| <div className="min-h-screen bg-gray-50 dark:bg-gray-900 py-12 flex items-center justify-center"> |
|
|
||
| return ( | ||
| <div className="min-h-screen bg-gray-50 py-12"> | ||
| <div className="min-h-screen bg-gray-50 dark:bg-gray-900 py-12"> |
Copilot
AI
Dec 7, 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] For consistency with other components in the codebase (Community, Challenges, Profile, etc.), consider adding transition-colors duration-300 to the main container div to provide smooth transitions when toggling dark mode.
| <div className="min-h-screen bg-gray-50 dark:bg-gray-900 py-12"> | |
| <div className="min-h-screen bg-gray-50 dark:bg-gray-900 py-12 transition-colors duration-300"> |
Summary
This PR resolves the dark mode display issues affecting the Blog and Projects pages.
The previous implementation did not correctly apply dark theme styling across all components, leading to UI inconsistencies. This update ensures that dark mode now functions reliably and consistently throughout both pages.
Fix Details
Blog Page
Projects Page
Global Styling Adjustments
Testing
Additional Notes
Request
Please review and merge this PR into the main branch.
Thanks for giving me the opportunity to contribute.