How to install Tailwind CSS and daisyUI in a Astro project
npm create astro@latest
npm install tailwindcss@next @tailwindcss/vite@next daisyui@beta
Add Tailwind CSS to Astro config
// @ts-check
import { defineConfig } from "astro/config";
import tailwindcss from "@tailwindcss/vite";
export default defineConfig({
vite: {
plugins: [tailwindcss()],
},
});
Put Tailwind and daisyUI to your CSS file
@import "tailwindcss";
@plugin "daisyui";
Import the CSS file on top of your astro Layout file
---
import "../assets/app.css";
---
Now you can use daisyUI class names!