Dark & Light Mode With Vue, VueUse & Tailwind CSS

preview_player
Показать описание
This video explains how to create a simple dark and light theme toggle using Vue 3, a library called vueUse & Tailwind CSS

-----------------------------------------------------------------------------------------------------
Join my channel to support me to continue doing what I love!
-----------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
#vue #vue3 #vueuse #tailwindcss
Рекомендации по теме
Комментарии
Автор

Really enjoying the fast paced videos. They are super informative and get the point across well. Great work, John!

randel_mcafee
Автор

Great video and explanation! But it raised some questions. 1) Why do you have to call toggleDark with parentheses @click="toggleDark()"? 2) when I call toggleDark() on button click, which runs "useToggle(isDark)", it adds a dark class to the html element (or to whatever selector you provide to useDark). But for some reason, when switching to dark mode, it completely ignores any transition property I might have added. I thought I had a problem with my setup, but when I decided to rewrite the toggleDark function to manually add the class of "dark" to the html element (document.documentElement.classList.toggle('dark')), then the transitions started working again. Weird. I can also see the <head> element flashing in the devtools whenever I use the "useToggle(isDark)" version, meaning it has been updated, but when I check, it is identical. This flashing of the <head> does not happen when I use my vanilla JS method. Very weiiird.

ArtySho
Автор

Awesome video. Please keep making videos like this. It helps me a lot.

riyad-appscode
Автор

This will be saved in router view while routing too?

a.human.
Автор

can you please make awesome video on server side rendering

badasscoder