@0x-jerry/unocss-preset-daisyui
v0.2.3
Published
Daisyui preset for UnoCSS
Downloads
318
Readme
UnoCSS Preset Daisyui
A UnoCSS preset for daisyui. Due to the implementation, this is 100% compatible with daisyui with some trade-offs.
Install
pnpm i @0x-jerry/unocss-preset-daisyui daisyui -DUsage
unocss.config.ts
import { defineConfig, presetMini, presetWind4 } from "unocss";
import { presetDaisyui } from "@0x-jerry/unocss-preset-daisyui";
export default defineConfig({
presets: [
presetMini(),
// When use with wind4 preset, you need to disable reset preflight,
// because preset daisyui already included it.
presetWind4({
preflights: {
reset: false,
},
})
presetDaisyui(),
],
});main.ts
import "uno.css";
import "daisyui/theme/light.css";Limitations
Due to the implementation of this preset, here has some limitations:
- All
daisyuiclasses will only available in global scope. daisyui/theme/light.cssis required, or you can import any theme you want fromdaisyui/theme.- You can't use
@applywithdaisyuiclasses. daisyuiclasses is not fully on-demand, so the bundle size may larger than expected.
