Attributify Mode for [UnoCSS](https://github.com/unocss/unocss).
npm install @unocss-applet/transformer-attributifyAttributify Mode for UnoCSS.
``bash`
npm i @unocss-applet/transformer-attributify --save-dev # with npm
yarn add @unocss-applet/transformer-attributify -D # with yarn
pnpm add @unocss-applet/transformer-attributify -D # with pnpm
`ts
import transformerAttributify from '@unocss-applet/transformer-attributify'
import { defineConfig } from 'unocss'
export default defineConfig({
// ...
transformers: [
transformerAttributify(),
],
})
`
`ts
export interface TransformerAttributifyOptions {
/**
* @default 'un-'
*/
prefix?: string
/**
* Only match for prefixed attributes
*
* @default false
*/
prefixedOnly?: boolean
/**
* Support matching non-valued attributes
*
* For example
* `html`
*
*
*
* @default true
*/
nonValuedAttribute?: boolean
/**
* A list of attributes to be ignored from extracting.
*/
ignoreAttributes?: string[]
/**
* Delete attributes that added in class=""`
* @default true
*/
deleteAttributes?: boolean
}
> Attributes will be deleted unless deleteAttributes is set to true.
`html`
py-3
`html``
py-3
MIT License © 2022-PRESENT Neil Lee