@unocss/preset-attributify 0.45.29 → 0.46.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 +12 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -198,6 +198,18 @@ declare global {
|
|
|
198
198
|
}
|
|
199
199
|
```
|
|
200
200
|
|
|
201
|
+
### Preact
|
|
202
|
+
|
|
203
|
+
```ts
|
|
204
|
+
import type { AttributifyAttributes } from '@unocss/preset-attributify'
|
|
205
|
+
|
|
206
|
+
declare module 'preact' {
|
|
207
|
+
namespace JSX {
|
|
208
|
+
interface HTMLAttributes extends AttributifyAttributes {}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
```
|
|
212
|
+
|
|
201
213
|
### Attributify with Prefix
|
|
202
214
|
|
|
203
215
|
```ts
|
package/dist/index.cjs
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const core = require('@unocss/core');
|
|
6
6
|
|
|
7
|
-
const variantsRE = /^(
|
|
7
|
+
const variantsRE = /^(?!.*\[(?:[^:]+):(?:.+)\]$)((?:.+:)?!?)?(.*)$/;
|
|
8
8
|
const variantAttributify = (options = {}) => {
|
|
9
9
|
const prefix = options.prefix ?? "un-";
|
|
10
10
|
const prefixedOnly = options.prefixedOnly ?? false;
|
package/dist/index.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ declare type StringNumberCompositionPrefix = 'op' | 'opacity' | 'fw' | 'p' | 'm'
|
|
|
61
61
|
declare type StringNumberComposition = `${StringNumberCompositionPrefix}${number}${'px' | ''}`;
|
|
62
62
|
declare type PseudoPrefix = 'active' | 'before' | 'after' | 'dark' | 'light' | 'first' | 'last' | 'focus' | 'hover' | 'link' | 'root' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'enabled' | 'disabled' | 'all' | 'children';
|
|
63
63
|
/** Some words can be used to separate utilities, such as font="mono light", text="sm white" */
|
|
64
|
-
declare type SeparateEnabled = 'align' | 'animate' | 'backdrop' | 'bg' | 'blend' | 'border' | 'box' | 'container' | 'content' | 'cursor' | 'display' | 'divide' | 'filter' | 'flex' | 'font' | 'gap' | 'gradient' | 'grid' | 'h' | 'icon' | 'justify' | 'list' | 'm' | 'opacity' | 'order' | 'outline' | 'overflow' | 'p' | 'place' | 'pos' | 'ring' | 'select' | 'shadow' | 'space' | 'table' | 'text' | 'transform' | 'transition' | 'underline' | 'w' | 'z' | PseudoPrefix;
|
|
64
|
+
declare type SeparateEnabled = 'align' | 'animate' | 'backdrop' | 'bg' | 'blend' | 'border' | 'box' | 'container' | 'content' | 'cursor' | 'display' | 'divide' | 'filter' | 'flex' | 'font' | 'gap' | 'gradient' | 'grid' | 'h' | 'icon' | 'items' | 'justify' | 'list' | 'm' | 'opacity' | 'order' | 'outline' | 'overflow' | 'p' | 'place' | 'pos' | 'ring' | 'select' | 'shadow' | 'space' | 'table' | 'text' | 'transform' | 'transition' | 'underline' | 'w' | 'z' | PseudoPrefix;
|
|
65
65
|
declare type BasicAttributes = StringNumberComposition | SpecialSingleWord | TwoStringsComposition | SeparateEnabled;
|
|
66
66
|
declare type AttributifyNames<Prefix extends string = ''> = `${Prefix}${BasicAttributes}` | `${Prefix}${PseudoPrefix}:${BasicAttributes}`;
|
|
67
67
|
interface AttributifyAttributes extends Partial<Record<AttributifyNames, string | boolean>> {
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isAttributifySelector, isValidSelector, extractorSplit } from '@unocss/core';
|
|
2
2
|
|
|
3
|
-
const variantsRE = /^(
|
|
3
|
+
const variantsRE = /^(?!.*\[(?:[^:]+):(?:.+)\]$)((?:.+:)?!?)?(.*)$/;
|
|
4
4
|
const variantAttributify = (options = {}) => {
|
|
5
5
|
const prefix = options.prefix ?? "un-";
|
|
6
6
|
const prefixedOnly = options.prefixedOnly ?? false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-attributify",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.46.0",
|
|
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.46.0"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "unbuild",
|