Skip to content

unpreset/unocss-transformer-hash

Repository files navigation

unocss-transformer-hash

A Unocss transformer hash template.

npm version npm downloads License

Install

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
    }),
  ],
})

Usage

<div class="flex items-center justify-center hover:text-red"></div>

Will be transformed to:

<div class="222f 7155 a503 hover:5d96"></div>

Options

export interface TransformerHashOptions {
  /**
   * Custom hash function
   */
  hashfn?: (input: string) => string
}

License

MIT License © 2023-PRESENT Chris