1. Install Tailwind via npm
npm install -D tailwindcss@latest postcss@latest autoprefixer@latest
2. Create your configuration files
npx tailwindcss init -p
// tailwind.config.js
module.exports = {
purge: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'],
darkMode: false, // or 'media' or 'class'
theme: {
extend: {},
},
variants: {
extend: {},
},
plugins: [],
}
4. Include Tailwind in your CSS
@tailwind base;
@tailwind components;
@tailwind utilities;
5. Import your CSS in main.js
import { createApp } from 'vue'
import App from './App.vue'
import './index.css'
createApp(App).mount('#app')