Next.js Dark Mode with No Flicker + Tailwind CSS

Описание к видео Next.js Dark Mode with No Flicker + Tailwind CSS

Web Dev Roadmap for Beginners (Free!): https://bit.ly/DaveGrayWebDevRoadmap

Apply a Next.js dark mode with no flicker or flash. This will allow your users to toggle between light and dark mode on your website. Learn how I applied a light and dark mode toggle to my Next.js & Tailwind CSS blog.

💖 Support me on Patreon ➜   / davegray  

⭐ Become a full-stack web dev with Zero To Mastery Courses:
Complete Next.js Developer: https://bit.ly/CompNextJSDev
Advanced React: https://bit.ly/AdvReactDev
Junior to Senior Dev Roadmap: https://bit.ly/WebDevRoadmap-JrtoSr

🚩 Subscribe ➜ https://bit.ly/3nGHmNn

📬 Course Updates ➜ https://courses.davegray.codes/

❓ Questions - Please post them to my Discord ➜   / discord  

☕ Buy Me A Coffee ➜ https://www.buymeacoffee.com/davegray

👇 Follow Me On Social Media:
GitHub: https://github.com/gitdagray
Twitter:   / yesdavidgray  
LinkedIn:   / davidagray  

🔗 Source Code & Article: https://www.davegray.codes/posts/ligh...

Next.js Dark Mode with No Flicker + Tailwind CSS

(00:00) Intro
(00:11) Welcome
(00:35) Why This is Challenging in Next.js
(01:29) Tailwind Config
(01:42) Install next-themes
(02:02) Create a providers file
(03:04) Add Providers to your layout
(03:55) Using a Provider in Next.js
(05:07) suppressHydrationWarning
(06:19) Create a Theme Switcher component
(08:21) Wrap up

📚 Tutorial References:
🔗 Next.js: https://nextjs.org/
🔗 Tailwind CSS: https://tailwindcss.com/
🔗 next-themes: https://github.com/pacocoursey/next-t...
🔗 React docs suppressHydrationWarning: https://react.dev/reference/react-dom...
🔗 Next.js docs "Using Context Providers:" https://nextjs.org/docs/app/building-...

Was this tutorial about applying a dark mode toggle to your Next.js website helpful? If so, please share. Let me know your thoughts in the comments.

#nextjs #dark #mode

Комментарии

Информация по комментариям в разработке