0.2.5 • Published 3 months ago

unocss-transformer-attribute-values-group v0.2.5

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

npm

Installation

pnpm add -D unocss-transformer-attribute-values-group
// uno.config.ts
import { defineConfig } from 'unocss'
import transformerAttrValuesGroup from 'unocss-transformer-attribute-values-group'

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

Usage:

<script setup lang="ts">
const type = ref<'number' | 'text'>()
const name = ref<'jack' | 'tom'>()

function changeTypeAndName() {
  // ......
}
</script>

<template>
  <input
    :type="type"
    class="[&[type=(number text)]]:c-red"
  >
  <div
    :data-name="name"
    class="data-[name=(jack tom)]:c-red"
  />
</template>

transformed like:

<input class="[&[type=number],&[type=text]]:c-red" />
<div class="data-[name=jack]:c-red data-[name=tom]:c-red" />

tests for more details.

0.2.5

3 months ago

0.2.4

5 months ago

0.2.3

8 months ago

0.2.2

12 months ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.4

1 year ago

0.1.5

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago