hiroshinishio / sample-website

https://sample-website-chi.vercel.app
1 stars 1 forks source link

GitAuto: Add a new icon on the top right to switch this entire website between dark mode and light mode #87

Open gitauto-for-dev[bot] opened 1 month ago

gitauto-for-dev[bot] commented 1 month ago

Resolves #80

What is the feature

This feature introduces a new icon located in the top right corner of the website that allows users to switch between dark mode and light mode themes.

Why we need the feature

Implementing a dark mode toggle enhances user experience by accommodating individual preferences and reducing eye strain in low-light environments. Many users prefer dark mode for its aesthetic and comfort, and providing this option keeps the website competitive and user-friendly. It aligns with modern web design standards where theme customization is expected.

How to implement and why

Step 1: Create a Theme Context

Step 2: Develop the Theme Toggle Component

Step 3: Implement Theme Styles

Step 4: Apply Theme Class to the Root Element

Step 5: Persist User Preference

Step 6: Update the Layout

Step 7: Test Across All Pages and Devices

Why these steps

About backward compatibility

The addition of the dark mode toggle is backward compatible:

This approach ensures that we improve the website without disrupting the experience for existing users.

Test these changes locally

git checkout -b gitauto-wes/issue-#80-03baa80e-a1c4-447e-a5d4-48a3b1aad71d
git pull origin gitauto-wes/issue-#80-03baa80e-a1c4-447e-a5d4-48a3b1aad71d
vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sample-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 14, 2024 0:29am