UnoCSS
UnoCSS is a utility-first CSS engine. A replacement for Tailwind CSS

Install daisyUI for UnoCSS

How to install Tailwind CSS and daisyUI in a UnoCSS project

This guide uses The community (unofficial) package@ameinhardt/unocss-preset-daisyas UnoCSS preset for daisyUI.
Not all daisyUI components are supported yet, some class names may not work as expected.
See the repofor more information.

1. Create a new Vite project

Create a new Vite project in the current directory

Terminal
npm create vite@latest ./ -- --template vanilla

2. Install UnoCSS, daisyUI and unocss-preset-daisy

Terminal
npm install unocss daisyui @ameinhardt/unocss-preset-daisy

Add UnoCSS to Vite config

vite.config.js
import { defineConfig } from 'vite';
import unocss from "unocss/vite";

export default defineConfig({
  plugins: [
    unocss()
  ],
});

3. Create a UnoCSS config file

Create aunocss.config.jsfile in the root of your project and add the following code:

unocss.config.js
import { defineConfig } from "unocss";
import presetWind4 from "@unocss/preset-wind4";
import { presetDaisy } from "@ameinhardt/unocss-preset-daisy";

export default defineConfig({
  content: {
    pipeline: {
      include: ["src/**/*.{js,ts}"],
    },
  },
  presets: [presetDaisy(), presetWind4()],
});

4. Add UnoCSS to your JS file

Add the following code at the top of yoursrc/main.jsfile:

src/main.js
import "@unocss/reset/tailwind.css";
import "uno.css";

Now you can use daisyUI class names!

Do you have a question? Ask on GitHub or Discord server
Do you like daisyUI? Post about it!
Support daisyUI's development: Open Collective
daisyUI store

NEXUS
Official daisyUI Dashboard Template

Available on daisyUI store

More details