A Unocss transformer hash template.
pnpm i -D unocss-transformer-hash
// uno.config.ts
import { defineConfig } from 'unocss'
import transformerHash from 'unocss-transformer-hash'
export default defineConfig({
// ...
transformers: [
transformerHash({
// options
}),
],
})
<div class="flex items-center justify-center hover:text-red"></div>
Will be transformed to:
<div class="222f 7155 a503 hover:5d96"></div>
export interface TransformerHashOptions {
/**
* Custom hash function
*/
hashfn?: (input: string) => string
}
MIT License © 2023-PRESENT Chris