0.1.0 • Published 4 months ago

unplugin-unocss-config v0.1.0

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

unplugin-unocss-config

NPM version

Use uno config in run-time.

Usage

<script lang='ts' setup>
console.log(__UNO__)
console.log(__UNO_CONFIG__)
console.log(__UNO_THEME__)

console.log(import.meta.env.__UNO__)
console.log(import.meta.env.__UNO_CONFIG__)
console.log(import.meta.env.__UNO_THEME__)

const presets = __UNO_CONFIG__.presets?.map((p: any) => p.name)
const transformers = import.meta.env.__UNO_CONFIG__.transformers?.map((t: any) => t.name)
</script>

Install

pnpm add unplugin-unocss-config
// vite.config.ts
import UnoCSSConfig from 'unplugin-unocss-config/vite'

export default defineConfig({
  plugins: [
    UnoCSSConfig(),
  ],
})

Type

// vite-env.d.ts
/// <reference types="unplugin-unocss-config/client" />

Example: playground/

// nuxt.config.js
export default {
  buildModules: [
    ['unplugin-unocss-config/nuxt', { /* options */ }],
  ],
}

This module works for both Nuxt 2 and Nuxt Vite

License

MIT License © 2023-PRESENT Chris

0.1.0

4 months ago

0.0.10

5 months ago

0.0.11

5 months ago

0.0.9

5 months ago

0.0.8

5 months ago

0.0.7

5 months ago

0.0.4

5 months ago

0.0.3

5 months ago

0.0.2

5 months ago