How to install Tailwind CSS and daisyUI in a Deno Fresh project
Install Deno, according to theofficial Deno docs
Create a new Fresh project calledmyapp
and navigate to it
deno run -A -r https://fresh.deno.dev myapp --tailwind=false --vscode=false
cd myapp
Add"nodeModulesDir": "auto",
todeno.json
file
{
+ "nodeModulesDir": "auto",
"lock": false,
//...rest of the file
}
Install Tailwind CSS, daisyUI and fresh-plugin-tailwindcss
deno i -D npm:tailwindcss@latest npm:daisyui@latest jsr:@pakornv/fresh-plugin-tailwindcss
Add Tailwind CSS and daisyUI to your CSS file
@import "tailwindcss";
@plugin "daisyui";
Add these lines tofresh.config.ts
file
import { defineConfig } from "$fresh/server.ts";
+ import tailwind from "@pakornv/fresh-plugin-tailwindcss";
export default defineConfig({
+ plugins: [tailwind()],
});
Run the Deno server with the following command
deno task start
Now you can use daisyUI class names!