GitAuto: Add a new icon on the top right to switch this entire website between dark mode and light mode #89
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #80
What is the feature
This pull request introduces a new icon located in the top right corner of the website that allows users to switch between dark mode and light mode. When clicked, the icon toggles the website's theme, providing an option for users to choose their preferred viewing mode.
Why we need the feature
Implementing a dark mode enhances user experience by providing a comfortable viewing option, especially in low-light conditions. It reduces eye strain and caters to user preferences, which can increase engagement and satisfaction. Additionally, offering theme customization aligns with modern web standards and expectations.
How to implement and why
Step 1: Design the Toggle Icon
Step 2: Implement Theme State Management
Step 3: Update Global Styles
styles/globals.css) that applies these variables based on the theme state.Step 4: Integrate the Icon into the Navigation Bar
pagesdirectory or acomponentsfolder.Step 5: Ensure Theme Applies to All Pages
Reasons for This Implementation:
About backward compatibility
The addition of the theme switcher is backward compatible:
Test these changes locally