@unocss/preset-attributify 0.44.7 → 0.45.4
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 +3 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -71,7 +71,7 @@ Can be written as
|
|
|
71
71
|
|
|
72
72
|
In addition to Windi CSS's Attributify Mode, this presets also supports valueless attributes.
|
|
73
73
|
|
|
74
|
-
For example,
|
|
74
|
+
For example,
|
|
75
75
|
|
|
76
76
|
```html
|
|
77
77
|
<div class="m-2 rounded text-teal-400" />
|
|
@@ -83,6 +83,8 @@ now can be
|
|
|
83
83
|
<div m-2 rounded text-teal-400 />
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
+
> Note: If you are using JSX, `<div foo>` might be transformed to `<div foo={true}>` which will make the generate CSS from UnoCSS failed to match the attributes. To solve this, you might want to try [`transformer-attributify-jsx`](https://github.com/unocss/unocss/tree/main/packages/transformer-attributify-jsx) along with this preset.
|
|
87
|
+
|
|
86
88
|
### Properties Conflicts
|
|
87
89
|
|
|
88
90
|
If the name of the attributes mode ever conflicts with the elements' or components' properties, you can add `un-` prefix to be specific to UnoCSS's attributify mode.
|
package/dist/index.cjs
CHANGED
|
@@ -118,7 +118,7 @@ const strippedPrefixes = [
|
|
|
118
118
|
];
|
|
119
119
|
const splitterRE = /[\s'"`;]+/g;
|
|
120
120
|
const elementRE = /<\w(?=.*>)[\w:\.$-]*\s((?:['"`\{].*?['"`\}]|.*?)*?)>/gs;
|
|
121
|
-
const valuedAttributeRE = /([?]|(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:!%-]+)(?:=(["'])([^\2]*?)\2)?/g;
|
|
121
|
+
const valuedAttributeRE = /([?]|(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:!%-]+)(?:={?(["'])([^\2]*?)\2}?)?/g;
|
|
122
122
|
const defaultIgnoreAttributes = ["placeholder"];
|
|
123
123
|
const extractorAttributify = (options) => {
|
|
124
124
|
const ignoreAttributes = options?.ignoreAttributes ?? defaultIgnoreAttributes;
|
package/dist/index.mjs
CHANGED
|
@@ -114,7 +114,7 @@ const strippedPrefixes = [
|
|
|
114
114
|
];
|
|
115
115
|
const splitterRE = /[\s'"`;]+/g;
|
|
116
116
|
const elementRE = /<\w(?=.*>)[\w:\.$-]*\s((?:['"`\{].*?['"`\}]|.*?)*?)>/gs;
|
|
117
|
-
const valuedAttributeRE = /([?]|(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:!%-]+)(?:=(["'])([^\2]*?)\2)?/g;
|
|
117
|
+
const valuedAttributeRE = /([?]|(?!\d|-{2}|-\d)[a-zA-Z0-9\u00A0-\uFFFF-_:!%-]+)(?:={?(["'])([^\2]*?)\2}?)?/g;
|
|
118
118
|
const defaultIgnoreAttributes = ["placeholder"];
|
|
119
119
|
const extractorAttributify = (options) => {
|
|
120
120
|
const ignoreAttributes = options?.ignoreAttributes ?? defaultIgnoreAttributes;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-attributify",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.45.4",
|
|
4
4
|
"description": "Attributify 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.
|
|
36
|
+
"@unocss/core": "0.45.4"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "unbuild",
|