@unocss/rule-utils 0.60.3 → 0.61.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/dist/index.d.mts +34 -2
- package/dist/index.d.ts +34 -2
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { VariantHandlerContext, VariantObject } from '@unocss/core';
|
|
2
2
|
|
|
3
|
+
interface CSSColorValue {
|
|
4
|
+
type: string;
|
|
5
|
+
components: (string | number)[];
|
|
6
|
+
alpha: string | number | undefined;
|
|
7
|
+
}
|
|
8
|
+
type RGBAColorValue = [number, number, number, number] | [number, number, number];
|
|
9
|
+
interface ParsedColorValue {
|
|
10
|
+
/**
|
|
11
|
+
* Parsed color value.
|
|
12
|
+
*/
|
|
13
|
+
color?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Parsed opacity value.
|
|
16
|
+
*/
|
|
17
|
+
opacity: string;
|
|
18
|
+
/**
|
|
19
|
+
* Color name.
|
|
20
|
+
*/
|
|
21
|
+
name: string;
|
|
22
|
+
/**
|
|
23
|
+
* Color scale, preferably 000 - 999.
|
|
24
|
+
*/
|
|
25
|
+
no: string;
|
|
26
|
+
/**
|
|
27
|
+
* {@link CSSColorValue}
|
|
28
|
+
*/
|
|
29
|
+
cssColor: CSSColorValue | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Parsed alpha value from opacity
|
|
32
|
+
*/
|
|
33
|
+
alpha: string | number | undefined;
|
|
34
|
+
}
|
|
3
35
|
declare function hex2rgba(hex?: string): RGBAColorValue | undefined;
|
|
4
36
|
declare function parseCssColor(str?: string): CSSColorValue | undefined;
|
|
5
37
|
declare function colorOpacityToString(color: CSSColorValue): string | number;
|
|
@@ -30,4 +62,4 @@ declare function hasThemeFn(str: string): boolean;
|
|
|
30
62
|
declare function transformThemeFn(code: string, theme: Record<string, any>, throwOnMissing?: boolean): string;
|
|
31
63
|
declare function transformThemeString(code: string, theme: Record<string, any>, throwOnMissing?: boolean): string | undefined;
|
|
32
64
|
|
|
33
|
-
export { type ValueHandler, type ValueHandlerCallback, colorOpacityToString, colorToString, createValueHandler, getBracket, getStringComponent, getStringComponents, hasThemeFn, hex2rgba, parseCssColor, themeFnRE, transformThemeFn, transformThemeString, variantGetBracket, variantGetParameter, variantMatcher, variantParentMatcher };
|
|
65
|
+
export { type CSSColorValue, type ParsedColorValue, type RGBAColorValue, type ValueHandler, type ValueHandlerCallback, colorOpacityToString, colorToString, createValueHandler, getBracket, getStringComponent, getStringComponents, hasThemeFn, hex2rgba, parseCssColor, themeFnRE, transformThemeFn, transformThemeString, variantGetBracket, variantGetParameter, variantMatcher, variantParentMatcher };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { VariantHandlerContext, VariantObject } from '@unocss/core';
|
|
2
2
|
|
|
3
|
+
interface CSSColorValue {
|
|
4
|
+
type: string;
|
|
5
|
+
components: (string | number)[];
|
|
6
|
+
alpha: string | number | undefined;
|
|
7
|
+
}
|
|
8
|
+
type RGBAColorValue = [number, number, number, number] | [number, number, number];
|
|
9
|
+
interface ParsedColorValue {
|
|
10
|
+
/**
|
|
11
|
+
* Parsed color value.
|
|
12
|
+
*/
|
|
13
|
+
color?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Parsed opacity value.
|
|
16
|
+
*/
|
|
17
|
+
opacity: string;
|
|
18
|
+
/**
|
|
19
|
+
* Color name.
|
|
20
|
+
*/
|
|
21
|
+
name: string;
|
|
22
|
+
/**
|
|
23
|
+
* Color scale, preferably 000 - 999.
|
|
24
|
+
*/
|
|
25
|
+
no: string;
|
|
26
|
+
/**
|
|
27
|
+
* {@link CSSColorValue}
|
|
28
|
+
*/
|
|
29
|
+
cssColor: CSSColorValue | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Parsed alpha value from opacity
|
|
32
|
+
*/
|
|
33
|
+
alpha: string | number | undefined;
|
|
34
|
+
}
|
|
3
35
|
declare function hex2rgba(hex?: string): RGBAColorValue | undefined;
|
|
4
36
|
declare function parseCssColor(str?: string): CSSColorValue | undefined;
|
|
5
37
|
declare function colorOpacityToString(color: CSSColorValue): string | number;
|
|
@@ -30,4 +62,4 @@ declare function hasThemeFn(str: string): boolean;
|
|
|
30
62
|
declare function transformThemeFn(code: string, theme: Record<string, any>, throwOnMissing?: boolean): string;
|
|
31
63
|
declare function transformThemeString(code: string, theme: Record<string, any>, throwOnMissing?: boolean): string | undefined;
|
|
32
64
|
|
|
33
|
-
export { type ValueHandler, type ValueHandlerCallback, colorOpacityToString, colorToString, createValueHandler, getBracket, getStringComponent, getStringComponents, hasThemeFn, hex2rgba, parseCssColor, themeFnRE, transformThemeFn, transformThemeString, variantGetBracket, variantGetParameter, variantMatcher, variantParentMatcher };
|
|
65
|
+
export { type CSSColorValue, type ParsedColorValue, type RGBAColorValue, type ValueHandler, type ValueHandlerCallback, colorOpacityToString, colorToString, createValueHandler, getBracket, getStringComponent, getStringComponents, hasThemeFn, hex2rgba, parseCssColor, themeFnRE, transformThemeFn, transformThemeString, variantGetBracket, variantGetParameter, variantMatcher, variantParentMatcher };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/rule-utils",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.61.0",
|
|
5
5
|
"description": "Utilities for UnoCSS",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"magic-string": "^0.30.10",
|
|
37
|
-
"@unocss/core": "^0.
|
|
37
|
+
"@unocss/core": "^0.61.0"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "unbuild",
|