Very basic and simple dark theme switcher using some plain Javascript, Vue 3 and Tailwindcss.
- Install Vue 3
Just follow the instruction from Vue's official documentation - Creating a Vue Application.
- Add Tailwindcss
Use official documentation on the Tailwindcss website but start from point 2 (Install Tailwind CSS) - Install Tailwind CSS with Vite Using Vue.
- Add theme switcher
I will add it to the index.html file to visualize its usage. I leave it to you to find the most convenient way to use it in your project.
See the index.html from repository
- Add test content
I have added the contents of the App.vue to test the functionality.
See the src/App.vue from repository
You can see how it works at my GitHub page Or on the demo page
npm install
npm run dev
npm run build