@unocss/preset-tagify 0.50.8 → 0.51.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,74 +2,9 @@
2
2
 
3
3
  Tagify Mode for [UnoCSS](https://github.com/unocss/unocss).
4
4
 
5
- ## Installation
5
+ ## Documentation
6
6
 
7
- ```bash
8
- npm i -D @unocss/preset-tagify
9
- ```
10
-
11
- ```ts
12
- import presetTagify from '@unocss/preset-tagify'
13
-
14
- UnoCSS({
15
- presets: [
16
- presetTagify({ /* options */ }),
17
- // ...other presets
18
- ],
19
- })
20
- ```
21
-
22
- ## Tagify Mode
23
-
24
- This preset can come in handy when you only need a single unocss rule to be apply on an element.
25
-
26
- ```html
27
- <span class="text-red"> red text </span>
28
- <div class="flex"> flexbox </div>
29
- I'm feeling <span class="i-line-md-emoji-grin"></span> today!
30
- ```
31
-
32
- With tagify mode, you can embed CSS styles into HTML tags:
33
-
34
- ```html
35
- <text-red> red text </text-red>
36
- <flex> flexbox </flex>
37
- I'm feeling <i-line-md-emoji-grin /> today!
38
- ```
39
-
40
- The HTML above works exactly as you would expect.
41
-
42
- ## With Prefix
43
-
44
- ```js
45
- presetTagify({
46
- prefix: 'un-'
47
- })
48
- ```
49
-
50
- ```html
51
- <!-- this will be matched -->
52
- <un-flex> </un-flex>
53
- <!-- this will not be matched -->
54
- <flex> </flex>
55
- ```
56
-
57
- ## Extra Properties
58
-
59
- You can inject extra properties to the matched rules:
60
-
61
- ```js
62
- presetTagify({
63
- // adds display: inline-block to matched icons
64
- extraProperties: matched => matched.startsWith('i-')
65
- ? { display: 'inline-block' }
66
- : { }
67
- })
68
- presetTagify({
69
- // extraProperties can also be a plain object
70
- extraProperties: { display: 'block' }
71
- })
72
- ```
7
+ Please refer to the [documentation](https://unocss.dev/presets/tagify).
73
8
 
74
9
  ## License
75
10
 
package/dist/index.cjs CHANGED
@@ -2,8 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const core = require('@unocss/core');
6
-
7
5
  const MARKER = "__TAGIFY__";
8
6
  const htmlTagRE = /<([\w\d-:]+)/g;
9
7
  function extractorTagify(options) {
@@ -66,12 +64,11 @@ function tagifyPreset(options = {}) {
66
64
  const extractors = [
67
65
  extractorTagify(options)
68
66
  ];
69
- if (defaultExtractor)
70
- extractors.push(core.extractorSplit);
71
67
  return {
72
68
  name: "@unocss/preset-tagify",
73
69
  variants,
74
- extractors
70
+ extractors,
71
+ extractorDefault: defaultExtractor ? void 0 : false
75
72
  };
76
73
  }
77
74
 
package/dist/index.mjs CHANGED
@@ -1,5 +1,3 @@
1
- import { extractorSplit } from '@unocss/core';
2
-
3
1
  const MARKER = "__TAGIFY__";
4
2
  const htmlTagRE = /<([\w\d-:]+)/g;
5
3
  function extractorTagify(options) {
@@ -62,12 +60,11 @@ function tagifyPreset(options = {}) {
62
60
  const extractors = [
63
61
  extractorTagify(options)
64
62
  ];
65
- if (defaultExtractor)
66
- extractors.push(extractorSplit);
67
63
  return {
68
64
  name: "@unocss/preset-tagify",
69
65
  variants,
70
- extractors
66
+ extractors,
67
+ extractorDefault: defaultExtractor ? void 0 : false
71
68
  };
72
69
  }
73
70
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/preset-tagify",
3
- "version": "0.50.8",
3
+ "version": "0.51.0",
4
4
  "description": "Tagify preset for UnoCSS",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -33,7 +33,7 @@
33
33
  "dist"
34
34
  ],
35
35
  "dependencies": {
36
- "@unocss/core": "0.50.8"
36
+ "@unocss/core": "0.51.0"
37
37
  },
38
38
  "scripts": {
39
39
  "build": "unbuild",