unocss-transformer-classnames-minifier
v0.0.3
Published
Transform UnoCSS classnames minifier.
Downloads
12
Readme
unocss-transformer-classnames-minifier
Transform UnoCSS classnames minifier.
Install
pnpm add -D unocss-transformer-classnames-minifier
// uno.config.ts
import { defineConfig } from 'unocss'
import transformerClassnamesMinifier from 'unocss-transformer-classnames-minifier'
export default defineConfig({
// ...
transformers: [
transformerClassnamesMinifier(),
],
})
Usage
<button class=":uno: px-2 py-3 bg-blue-500 text-white rounded"></button>
Will be transformed to:
<button class="a b c d f"></button>
Options
I suggest you to use special prefixes to avoid UnoCSS incorrectly transforming your code.
transformerClassnamesMinifier({
})
interface KeepOption {
/**
* Special prefix to avoid UnoCSS transforming your code.
* @default ':uno:'
*/
trigger?: string
/**
* Hash function
*/
hashFn?: () => string
/**
* The layer name of generated rules
*/
layer?: string
}