Installation
Package Installation
Install the preset using your preferred package manager:
bash
npm install unocss-preset-light-darkbash
yarn add unocss-preset-light-darkbash
pnpm add unocss-preset-light-darkbash
bun add unocss-preset-light-darkSetup
Add the preset to your UnoCSS configuration:
ts
import { defineConfig } from 'unocss'
import { presetLightDark } from 'unocss-preset-light-dark'
export default defineConfig({
presets: [
presetLightDark(),
],
})Nuxt
For Nuxt projects, it is hightly recommended to use the @nuxtjs/color-mode module for better integration with the light-dark() function.