Socket
Socket
Sign inDemoInstall

@unocss/preset-tagify

Package Overview
Dependencies
Maintainers
1
Versions
186
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@unocss/preset-tagify

Tagify preset for UnoCSS


Version published
Weekly downloads
171K
decreased by-3.16%
Maintainers
1
Weekly downloads
 
Created
Source

@unocss/preset-tagify

Tagify Mode for UnoCSS.

Installation

npm i -D @unocss/preset-tagify
import presetTagify from '@unocss/preset-tagify'

Unocss({
  presets: [
    presetTagify({ /* options */ }),
    // ...other presets
  ],
})

Tagify Mode

This preset can come in handy when you only need a single unocss rule to be apply on an element.

<span class="text-red"> red text </span>
<div class="flex"> flexbox </div>
I'm feeling <span class="i-line-md-emoji-grin"></span> today!

With tagify mode, you can embed CSS styles into HTML tags:

<text-red> red text </text-red>
<flex> flexbox </flex>
I'm feeling <i-line-md-emoji-grin /> today!

The HTML above works exactly as you would expect.

With Prefix

presetTagify({
  prefix: 'un-'
})
<!-- this will be matched -->
<un-flex> </un-flex>
<!-- this will not be matched -->
<flex> </flex>

Extra Properties

You can inject extra properties to the matched rules:

presetTagify({
  // adds display: inline-block to matched icons
  extraProperties: matched => matched.startsWith('i-')
    ? { display: 'inline-block' }
    : { }
})
presetTagify({
  // extraProperties can also be a plain object
  extraProperties: { display: 'block' }
})

License

MIT License © 2022-PRESENT Jeff Zou MIT License © 2022-PRESENT Anthony Fu

Keywords

FAQs

Package last updated on 14 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc