Custom auto completion preset for UnoCSS
- Auto completion support in functions, like
clsx()
,cn()
and so on - Auto completion support in css directives, like
--at-apply
,--uno
and so on - Customizable
npm i -D unocss-preset-completion unocss
yarn i -D unocss-preset-completion unocss
pnpm i -D unocss-preset-completion unocss
bun i -D unocss-preset-completion unocss
// uno.config.ts
import { defineConfig } from 'unocss'
import { presetClassCompletion, presetDirectiveCompletion } from 'unocss-preset-completion'
export default defineConfig({
presets: [
// ...
presetClassCompletion(),
presetDirectiveCompletion(),
],
})
// uno.config.ts
import { defineConfig } from 'unocss'
import { presetCompletion } from 'unocss-preset-completion'
export default defineConfig({
presets: [
// ...
presetCompletion({
autocompleteFunctions: ['youCustomFunction']
}),
presetDirectiveCompletion({
directives: ['--your-directive']
}),
],
})
MIT