@unocss/preset-attributify 0.42.1 → 0.43.2

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.
Files changed (2) hide show
  1. package/README.md +32 -0
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -83,6 +83,38 @@ now can be
83
83
  <div m-2 rounded text-teal-400 />
84
84
  ```
85
85
 
86
+ ### Properties Conflicts
87
+
88
+ 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.
89
+
90
+ For example:
91
+
92
+ ```html
93
+ <a text="red">This conflicts with links' `text` prop</a>
94
+ <!-- to -->
95
+ <a un-text="red">Text color to red</a>
96
+ ```
97
+
98
+ Prefix is optional by default, if you want to enforce the usage of prefix, set
99
+
100
+ ```ts
101
+ presetAttributify({
102
+ prefix: 'un-',
103
+ prefixedOnly: true, // <--
104
+ })
105
+ ```
106
+
107
+ You can also disable the scanning for certain attributes by:
108
+
109
+ ```ts
110
+ presetAttributify({
111
+ ignoreAttributes: [
112
+ 'text'
113
+ // ...
114
+ ]
115
+ })
116
+ ```
117
+
86
118
  ## TypeScript Support (JSX/TSX)
87
119
 
88
120
  Create `shims.d.ts` with the following content:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/preset-attributify",
3
- "version": "0.42.1",
3
+ "version": "0.43.2",
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.42.1"
36
+ "@unocss/core": "0.43.2"
37
37
  },
38
38
  "scripts": {
39
39
  "build": "unbuild",