Open allevo opened 1 month ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
rustcrab | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Sep 6, 2024 3:35pm |
The recent updates implement a dark mode functionality that detects user preferences and applies the theme accordingly. The layout checks for system preferences and updates the document's root element, while the Header component initializes its dark mode state based solely on local storage. These changes enhance the theme management process and improve responsiveness to user settings upon loading.
Files | Change Summary |
---|---|
src/app/layout.tsx |
Introduced dark mode detection using window.matchMedia and updated HTML with inline <script> . |
src/components/Header.tsx |
Simplified dark mode state initialization to only check localStorage . Removed dynamic management logic. |
Objective | Addressed | Explanation |
---|---|---|
Dark mode should be applied immediately (#[143]) | ✅ | |
Prevent light flash on page reload (#[143]) | ✅ |
🐇 In the moonlight's gentle sway,
A rabbit hops, and sings today.
"With dark mode now, so sleek and bright,
Your preferences guide our delight!
A cozy theme, both soft and warm,
Embrace the night, let comfort swarm!" 🌙✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
thanks, please solve the conflicts
Conflicts resolved
Description
Move the initial logic that calculates the color preference outside Next.JS flow to a dedicated script Fix https://github.com/FrancescoXX/rustcrab/issues/143
Type of change
Please delete options that are not relevant.
Test Required (Yes / No)
If Yes then How Has This Been Tested?
Test Configuration:
Checklist:
Summary by CodeRabbit
New Features
Bug Fixes
Refactor