@unocss/preset-uno 65.4.3 → 66.0.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 +1 -5
- package/dist/colors.d.mts +1 -1
- package/dist/colors.d.ts +1 -1
- package/dist/colors.mjs +1 -1
- package/dist/index.d.mts +4 -6
- package/dist/index.d.ts +4 -6
- package/dist/index.mjs +3 -71
- package/dist/theme.d.mts +3 -3
- package/dist/theme.d.ts +3 -3
- package/dist/theme.mjs +1 -1
- package/dist/utils.d.mts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.mjs +1 -1
- package/package.json +5 -7
package/README.md
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
# @unocss/preset-uno
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Documentation
|
|
6
|
-
|
|
7
|
-
Please refer to the [documentation](https://unocss.dev/presets/uno).
|
|
3
|
+
This package is deprecated and renamed to `@unocss/preset-wind3`.
|
|
8
4
|
|
|
9
5
|
## License
|
|
10
6
|
|
package/dist/colors.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '@unocss/preset-
|
|
1
|
+
export * from '@unocss/preset-wind3/colors';
|
package/dist/colors.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '@unocss/preset-
|
|
1
|
+
export * from '@unocss/preset-wind3/colors';
|
package/dist/colors.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '@unocss/preset-
|
|
1
|
+
export * from '@unocss/preset-wind3/colors';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import * as _unocss_core from '@unocss/core';
|
|
2
|
-
import {
|
|
3
|
-
export { Theme } from '@unocss/preset-
|
|
2
|
+
import { Theme, PresetWind3Options } from '@unocss/preset-wind3';
|
|
3
|
+
export { Theme } from '@unocss/preset-wind3';
|
|
4
4
|
|
|
5
|
-
interface PresetUnoOptions extends
|
|
5
|
+
interface PresetUnoOptions extends PresetWind3Options {
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* @see https://unocss.dev/presets/uno
|
|
8
|
+
* @deprecated Use `presetWind3` from `@unocss/preset-wind3` instead
|
|
11
9
|
*/
|
|
12
10
|
declare const presetUno: _unocss_core.PresetFactory<Theme, PresetUnoOptions>;
|
|
13
11
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import * as _unocss_core from '@unocss/core';
|
|
2
|
-
import {
|
|
3
|
-
export { Theme } from '@unocss/preset-
|
|
2
|
+
import { Theme, PresetWind3Options } from '@unocss/preset-wind3';
|
|
3
|
+
export { Theme } from '@unocss/preset-wind3';
|
|
4
4
|
|
|
5
|
-
interface PresetUnoOptions extends
|
|
5
|
+
interface PresetUnoOptions extends PresetWind3Options {
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* @see https://unocss.dev/presets/uno
|
|
8
|
+
* @deprecated Use `presetWind3` from `@unocss/preset-wind3` instead
|
|
11
9
|
*/
|
|
12
10
|
declare const presetUno: _unocss_core.PresetFactory<Theme, PresetUnoOptions>;
|
|
13
11
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,79 +1,11 @@
|
|
|
1
1
|
import { definePreset } from '@unocss/core';
|
|
2
|
-
import {
|
|
3
|
-
import { parseCssColor, colorToString } from '@unocss/rule-utils';
|
|
4
|
-
|
|
5
|
-
function mixComponent(v1, v2, w) {
|
|
6
|
-
return `calc(${v2} + (${v1} - ${v2}) * ${w} / 100)`;
|
|
7
|
-
}
|
|
8
|
-
function mixColor(color1, color2, weight) {
|
|
9
|
-
const colors = [color1, color2];
|
|
10
|
-
const cssColors = [];
|
|
11
|
-
for (let c = 0; c < 2; c++) {
|
|
12
|
-
const color = typeof colors[c] === "string" ? parseCssColor(colors[c]) : colors[c];
|
|
13
|
-
if (!color || !["rgb", "rgba"].includes(color.type))
|
|
14
|
-
return;
|
|
15
|
-
cssColors.push(color);
|
|
16
|
-
}
|
|
17
|
-
const newComponents = [];
|
|
18
|
-
for (let x = 0; x < 3; x++)
|
|
19
|
-
newComponents.push(mixComponent(cssColors[0].components[x], cssColors[1].components[x], weight));
|
|
20
|
-
return {
|
|
21
|
-
type: "rgb",
|
|
22
|
-
components: newComponents,
|
|
23
|
-
alpha: mixComponent(cssColors[0].alpha ?? 1, cssColors[1].alpha ?? 1, weight)
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
function tint(color, weight) {
|
|
27
|
-
return mixColor("#fff", color, weight);
|
|
28
|
-
}
|
|
29
|
-
function shade(color, weight) {
|
|
30
|
-
return mixColor("#000", color, weight);
|
|
31
|
-
}
|
|
32
|
-
function shift(color, weight) {
|
|
33
|
-
const num = Number.parseFloat(`${weight}`);
|
|
34
|
-
if (!Number.isNaN(num))
|
|
35
|
-
return num > 0 ? shade(color, weight) : tint(color, -num);
|
|
36
|
-
}
|
|
37
|
-
const fns = { tint, shade, shift };
|
|
38
|
-
function variantColorMix() {
|
|
39
|
-
let re;
|
|
40
|
-
return {
|
|
41
|
-
name: "mix",
|
|
42
|
-
match(matcher, ctx) {
|
|
43
|
-
if (!re)
|
|
44
|
-
re = new RegExp(`^mix-(tint|shade|shift)-(-?\\d{1,3})(?:${ctx.generator.config.separators.join("|")})`);
|
|
45
|
-
const m = matcher.match(re);
|
|
46
|
-
if (m) {
|
|
47
|
-
return {
|
|
48
|
-
matcher: matcher.slice(m[0].length),
|
|
49
|
-
body: (body) => {
|
|
50
|
-
body.forEach((v) => {
|
|
51
|
-
if (v[1]) {
|
|
52
|
-
const color = parseCssColor(`${v[1]}`);
|
|
53
|
-
if (color) {
|
|
54
|
-
const mixed = fns[m[1]](color, m[2]);
|
|
55
|
-
if (mixed)
|
|
56
|
-
v[1] = colorToString(mixed);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
return body;
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
}
|
|
2
|
+
import { presetWind3 } from '@unocss/preset-wind3';
|
|
67
3
|
|
|
68
4
|
const presetUno = definePreset((options = {}) => {
|
|
69
|
-
const wind =
|
|
5
|
+
const wind = presetWind3(options);
|
|
70
6
|
return {
|
|
71
7
|
...wind,
|
|
72
|
-
name: "@unocss/preset-uno"
|
|
73
|
-
variants: [
|
|
74
|
-
...wind.variants,
|
|
75
|
-
variantColorMix()
|
|
76
|
-
]
|
|
8
|
+
name: "@unocss/preset-uno"
|
|
77
9
|
};
|
|
78
10
|
});
|
|
79
11
|
|
package/dist/theme.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from '@unocss/preset-
|
|
2
|
-
import '@unocss/
|
|
3
|
-
import '@unocss/preset-
|
|
1
|
+
export * from '@unocss/preset-wind3/theme';
|
|
2
|
+
import '@unocss/preset-wind3/utils';
|
|
3
|
+
import '@unocss/preset-wind3/colors';
|
package/dist/theme.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from '@unocss/preset-
|
|
2
|
-
import '@unocss/
|
|
3
|
-
import '@unocss/preset-
|
|
1
|
+
export * from '@unocss/preset-wind3/theme';
|
|
2
|
+
import '@unocss/preset-wind3/utils';
|
|
3
|
+
import '@unocss/preset-wind3/colors';
|
package/dist/theme.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '@unocss/preset-
|
|
1
|
+
export * from '@unocss/preset-wind3/theme';
|
package/dist/utils.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '@unocss/
|
|
1
|
+
export * from '@unocss/preset-wind3/utils';
|
package/dist/utils.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '@unocss/
|
|
1
|
+
export * from '@unocss/preset-wind3/utils';
|
package/dist/utils.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '@unocss/
|
|
1
|
+
export * from '@unocss/preset-wind3/utils';
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-uno",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
5
|
-
"description": "
|
|
4
|
+
"version": "66.0.0",
|
|
5
|
+
"description": "Deprecated, renamed to `@unocss/preset-wind3`",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"funding": "https://github.com/sponsors/antfu",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
12
|
"url": "https://github.com/unocss/unocss",
|
|
13
|
-
"directory": "packages-
|
|
13
|
+
"directory": "packages-deprecated/preset-uno"
|
|
14
14
|
},
|
|
15
15
|
"bugs": {
|
|
16
16
|
"url": "https://github.com/unocss/unocss/issues"
|
|
@@ -55,10 +55,8 @@
|
|
|
55
55
|
"dist"
|
|
56
56
|
],
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@unocss/core": "
|
|
59
|
-
"@unocss/preset-
|
|
60
|
-
"@unocss/preset-wind": "65.4.3",
|
|
61
|
-
"@unocss/rule-utils": "65.4.3"
|
|
58
|
+
"@unocss/core": "66.0.0",
|
|
59
|
+
"@unocss/preset-wind3": "66.0.0"
|
|
62
60
|
},
|
|
63
61
|
"scripts": {
|
|
64
62
|
"build": "unbuild",
|