GitAuto: Add a new icon on the top right to switch this entire website between dark mode and light mode#88
Open
gitauto-for-dev[bot] wants to merge 1 commit into
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
Add a new icon on the top right of the website that allows users to switch between dark mode and light mode.
Why we need the feature
Introducing a dark mode enhances user experience by providing an alternative theme that's easier on the eyes, especially in low-light environments. It accommodates user preferences, improves accessibility, and aligns with modern web design trends. This feature can increase user engagement and satisfaction by offering a personalized viewing experience.
How to implement and why
Step 1: Design Dark Mode Styles
Step 2: Add the Toggle Icon
<button>element with appropriatearia-labelsfor screen readers.Step 3: Implement Theme Switching Logic
dark-mode) on the root element (<html>or<body>).localStorageto persist across sessions:Step 4: Update Existing Pages
pagesdirectory to ensure that all elements respond to the theme switch.Step 5: Optimize for Performance and Accessibility
Step 6: Testing
About backward compatibility
This feature is fully backward compatible. It does not affect existing functionalities or alter the default light mode. Users who do not interact with the theme toggle will continue to experience the website as before. By adding the feature as an enhancement rather than a replacement, we ensure that the website remains functional for all users regardless of their interaction with the new theme switch.
Test these changes locally