GitAuto: Add a new icon on the top right to switch this entire website between dark mode and light mode#91
Open
gitauto-for-dev[bot] wants to merge 1 commit intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 feature introduces a new icon located at the top right corner of the website, allowing users to switch between dark mode and light mode themes for the entire site.
Why we need the feature
Providing a dark mode option enhances user experience by accommodating individual preferences and improving readability in low-light environments. It can reduce eye strain, save battery life on devices with OLED screens, and align the website with modern design standards where dark mode is a common expectation.
How to implement and why
Design the Toggle Icon: Create an intuitive icon (e.g., a sun/moon or light bulb symbol) that clearly indicates its function to switch themes.
Add Icon to Navigation: Insert the icon into the website's header or navigation component, ensuring it's consistently displayed across all pages. This can be done in a shared layout component within the
pagesdirectory.Implement Theme State Management:
useStatehook or context API to manage the theme state across the application.prefers-color-schememedia query.Persist Theme Preference:
localStorageto remember their preference on subsequent visits.Apply Theming to Stylesheets:
styles/global.cssor equivalent to reference these variables.Update Existing Components:
Ensure Responsive and Accessible Design:
Testing:
Documentation and Updates:
README.mdwith information about the new feature.By implementing the feature step by step, we ensure a seamless integration that enhances the user interface without disrupting existing functionality.
About backward compatibility
The addition is backward compatible. Users who do not interact with the theme toggle will continue to experience the website in its default light mode. Since we're adding new functionality without altering existing features, there should be no negative impact on current users or site behavior.
Test these changes locally