Installation
Langkah-langkah cepat memasang Tailwind CSS di aplikasi Anda.
Installation
Get started with Tailwind CSS in your project. Tailwind works by scanning all of your HTML files, JavaScript components, and any other templates for class names, generating the corresponding styles and then writing them to a static CSS file.
Quick Start with Vite#
Install Tailwind CSS and its peer dependencies via npm:
Terminal
npm install -D tailwindcss @tailwindcss/vite
Add the @tailwindcss/vite plugin to your Vite configuration:
vite.config.js
import { defineConfig } from 'vite'
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
plugins: [
tailwindcss(),
],
})
Import Tailwind in your CSS#
Add the @import "tailwindcss"; directive to your main CSS file:
app.css
@import "tailwindcss";
Tips
Pastikan file CSS utama Anda telah diimpor di dalam template HTML utama.