Tailwind CSS - AdarshTheki/mern-stack-learn GitHub Wiki
- Setup vite project
npm create vite@latest my-project -- --template react
cd my-project
- Add tailwind
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
- Rename to tailwind.config.cjs, Auto following content
- Add the Tailwind directives to your CSS
index.css
@tailwind base;
@tailwind components;
@tailwind utilities;
index.css
@layer components {
.align-element {
@apply mx-auto max-w-7xl px-8;
}
}
index.html
<html lang="en" class="bg-slate-50 scroll-smooth"></html>