How to install and use daisyUI with Tailwind CSS CLI
Initialize a new Node project in the current directory using npm init -y if it's not a Node project already.
Install Tailwind CSS CLI and daisyUI
npm install tailwindcss@latest @tailwindcss/cli@latest daisyui@latestAdd Tailwind CSS and daisyUI to your CSS file.
Address your HTML and other markup files in the source function.
@import "tailwindcss";
@plugin "daisyui";Add a script to your package.json to build the CSS.
{
"scripts": {
"build:css": "npx @tailwindcss/cli -i app.css -o public/output.css"
},
}Run the script to build the CSS file
npm run build:cssThis command creates a public/output.css file with the compiled CSS. You can link this file to your HTML file.
<link href="./output.css" rel="stylesheet">Now you can use daisyUI class names!
