JSPM

@unocss/runtime

0.12.18
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5941
  • Score
    100M100P100Q124324F
  • License MIT

CSS-in-JS Runtime for UnoCSS

Package Exports

  • @unocss/runtime

Readme

@unocss/runtime

Expiremental CSS-in-JS runtime of UnoCSS.

CDN Usage

Add this line to your index.html and play:

<script src="https://unpkg.com/@unocss/runtime"></script>

To configure UnoCSS (optional):

<script>
// pass unocss options
window.__unocss = {
  rules: [
    // custom rules...
  ],
  presets: [
    // custom presets...
  ],
  // ...
}
</script>

By default, @unocss/preset-uno will be applied.

CDN Builds

Core

Without any preset:

<script src="https://unpkg.com/@unocss/runtime/core.global.js"></script>
Uno (default)

With @unocss/preset-uno preset:

<script src="https://unpkg.com/@unocss/runtime/uno.global.js"></script>
Attributify

With @unocss/preset-uno and @unocss/preset-attributify presets:

<script src="https://unpkg.com/@unocss/runtime/attributify.global.js"></script>

Bundler Usage

npm i @unocss/runtime
import initUnocssRuntime from '@unocss/runtime'

initUnocssRuntime({ /* options */ })

License

MIT License © 2021 Anthony Fu