Lenoxo / EmanuelDev

My website source code.
https://emanueldev.vercel.app
1 stars 0 forks source link

Add persistend dark mode in localStorage #18

Closed Lenoxo closed 6 months ago

Lenoxo commented 6 months ago

This PR has 3 main changes:

1. Removing js-cookie unused library: Because currently I'm only using localStorage to save data.

2. Adding a custom hook, useLocalStorage: For organizing the logic related to localStorage of the site. It only has to deal with the dark mode persistence for now.

3. Adding a next/script to change style before hydrating the page: This was something I learned during this week, and it's related to how you can make critical checks or functionalities before hydrating with the JS files the HTML and CSS ones, more details can be found here in next.js docs: Script Optimization.

vercel[bot] commented 6 months ago

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

Name Status Preview Updated (UTC)
emanueldev-fagq ✅ Ready (Inspect) Visit Preview Apr 7, 2024 5:33pm