snipe/web/node_modules/@unocss/transformer-compile-class
pyr0ball 7a704441a6 feat(snipe): Vue 3 frontend scaffold + Docker web service
- web/: Vue 3 + Vite + UnoCSS + Pinia, dark tactical theme (amber/#0d1117)
- AppNav, ListingCard, SearchView with filters/sort, composables
  (useSnipeMode, useKonamiCode, useMotion), Pinia search store
- Steal shimmer, auction countdown, Snipe Mode easter egg all native in Vue
- docker/web/: nginx + multi-stage Dockerfile (node build → nginx serve)
- compose.yml: api (8510) + web (8509) services
- Dockerfile CMD updated to uvicorn for upcoming FastAPI layer
- Clean build: 0 TS errors, 380 modules
2026-03-25 15:11:35 -07:00
..
LICENSE feat(snipe): Vue 3 frontend scaffold + Docker web service 2026-03-25 15:11:35 -07:00
package.json feat(snipe): Vue 3 frontend scaffold + Docker web service 2026-03-25 15:11:35 -07:00
README.md feat(snipe): Vue 3 frontend scaffold + Docker web service 2026-03-25 15:11:35 -07:00

@unocss/transformer-compile-class

Compile group of classes into one class. Inspired by WindiCSS's compilation mode and #948 by @UltraCakeBakery.

Install

npm i -D @unocss/transformer-compile-class
import transformerCompileClass from '@unocss/transformer-compile-class'
// uno.config.ts
import { defineConfig } from 'unocss'

export default defineConfig({
  // ...
  transformers: [
    transformerCompileClass(),
  ],
})

Usage

At the begin of your class strings, add :uno: at the begin of the strings to mark them for compilation. For example:

<div class=":uno: text-center sm:text-left">
  <div class=":uno: text-sm font-bold hover:text-red" />
</div>

Will be compiled to:

<div class="uno-qlmcrp">
  <div class="uno-0qw2gr" />
</div>
.uno-qlmcrp {
  text-align: center;
}
.uno-0qw2gr {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 700;
}
.uno-0qw2gr:hover {
  --un-text-opacity: 1;
  color: rgb(248 113 113 / var(--un-text-opacity));
}
@media (min-width: 640px) {
  .uno-qlmcrp {
    text-align: left;
  }
}

Options

You can config the trigger string and prefix for compile class with the options. Refers to the types for details.

License

MIT License © 2021-PRESENT Anthony Fu