@unocss/preset-uno 0.58.9 → 0.59.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/package.json +23 -18
- package/dist/colors.cjs +0 -16
- package/dist/colors.d.cts +0 -1
- package/dist/index.cjs +0 -85
- package/dist/index.d.cts +0 -14
- package/dist/theme.cjs +0 -16
- package/dist/theme.d.cts +0 -3
- package/dist/utils.cjs +0 -16
- package/dist/utils.d.cts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-uno",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.59.0",
|
|
4
5
|
"description": "The default preset for UnoCSS",
|
|
5
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
7
|
"license": "MIT",
|
|
@@ -21,39 +22,43 @@
|
|
|
21
22
|
"sideEffects": false,
|
|
22
23
|
"exports": {
|
|
23
24
|
".": {
|
|
24
|
-
"types": "./dist/index.d.
|
|
25
|
-
"
|
|
26
|
-
"require": "./dist/index.cjs"
|
|
25
|
+
"types": "./dist/index.d.mts",
|
|
26
|
+
"default": "./dist/index.mjs"
|
|
27
27
|
},
|
|
28
28
|
"./theme": {
|
|
29
|
-
"types": "./dist/theme.d.
|
|
30
|
-
"
|
|
31
|
-
"require": "./dist/theme.cjs"
|
|
29
|
+
"types": "./dist/theme.d.mts",
|
|
30
|
+
"default": "./dist/theme.mjs"
|
|
32
31
|
},
|
|
33
32
|
"./colors": {
|
|
34
|
-
"types": "./dist/colors.d.
|
|
35
|
-
"
|
|
36
|
-
"require": "./dist/colors.cjs"
|
|
33
|
+
"types": "./dist/colors.d.mts",
|
|
34
|
+
"default": "./dist/colors.mjs"
|
|
37
35
|
},
|
|
38
36
|
"./utils": {
|
|
39
|
-
"types": "./dist/utils.d.
|
|
40
|
-
"
|
|
41
|
-
"require": "./dist/utils.cjs"
|
|
37
|
+
"types": "./dist/utils.d.mts",
|
|
38
|
+
"default": "./dist/utils.mjs"
|
|
42
39
|
},
|
|
43
40
|
"./*": "./*"
|
|
44
41
|
},
|
|
45
|
-
"main": "dist/index.
|
|
42
|
+
"main": "dist/index.mjs",
|
|
46
43
|
"module": "dist/index.mjs",
|
|
47
44
|
"types": "dist/index.d.ts",
|
|
45
|
+
"typesVersions": {
|
|
46
|
+
"*": {
|
|
47
|
+
"*": [
|
|
48
|
+
"./dist/*",
|
|
49
|
+
"./*"
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
},
|
|
48
53
|
"files": [
|
|
49
54
|
"*.css",
|
|
50
55
|
"dist"
|
|
51
56
|
],
|
|
52
57
|
"dependencies": {
|
|
53
|
-
"@unocss/core": "0.
|
|
54
|
-
"@unocss/preset-mini": "0.
|
|
55
|
-
"@unocss/rule-utils": "0.
|
|
56
|
-
"@unocss/preset-wind": "0.
|
|
58
|
+
"@unocss/core": "0.59.0",
|
|
59
|
+
"@unocss/preset-mini": "0.59.0",
|
|
60
|
+
"@unocss/rule-utils": "0.59.0",
|
|
61
|
+
"@unocss/preset-wind": "0.59.0"
|
|
57
62
|
},
|
|
58
63
|
"scripts": {
|
|
59
64
|
"build": "unbuild",
|
package/dist/colors.cjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const colors = require('@unocss/preset-mini/colors');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.prototype.hasOwnProperty.call(colors, '__proto__') &&
|
|
8
|
-
!Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
|
|
9
|
-
Object.defineProperty(exports, '__proto__', {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
value: colors['__proto__']
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
Object.keys(colors).forEach(function (k) {
|
|
15
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = colors[k];
|
|
16
|
-
});
|
package/dist/colors.d.cts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@unocss/preset-mini/colors';
|
package/dist/index.cjs
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const core = require('@unocss/core');
|
|
6
|
-
const presetWind = require('@unocss/preset-wind');
|
|
7
|
-
const ruleUtils = require('@unocss/rule-utils');
|
|
8
|
-
|
|
9
|
-
function mixComponent(v1, v2, w) {
|
|
10
|
-
return `calc(${v2} + (${v1} - ${v2}) * ${w} / 100)`;
|
|
11
|
-
}
|
|
12
|
-
function mixColor(color1, color2, weight) {
|
|
13
|
-
const colors = [color1, color2];
|
|
14
|
-
const cssColors = [];
|
|
15
|
-
for (let c = 0; c < 2; c++) {
|
|
16
|
-
const color = typeof colors[c] === "string" ? ruleUtils.parseCssColor(colors[c]) : colors[c];
|
|
17
|
-
if (!color || !["rgb", "rgba"].includes(color.type))
|
|
18
|
-
return;
|
|
19
|
-
cssColors.push(color);
|
|
20
|
-
}
|
|
21
|
-
const newComponents = [];
|
|
22
|
-
for (let x = 0; x < 3; x++)
|
|
23
|
-
newComponents.push(mixComponent(cssColors[0].components[x], cssColors[1].components[x], weight));
|
|
24
|
-
return {
|
|
25
|
-
type: "rgb",
|
|
26
|
-
components: newComponents,
|
|
27
|
-
alpha: mixComponent(cssColors[0].alpha ?? 1, cssColors[1].alpha ?? 1, weight)
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
function tint(color, weight) {
|
|
31
|
-
return mixColor("#fff", color, weight);
|
|
32
|
-
}
|
|
33
|
-
function shade(color, weight) {
|
|
34
|
-
return mixColor("#000", color, weight);
|
|
35
|
-
}
|
|
36
|
-
function shift(color, weight) {
|
|
37
|
-
const num = Number.parseFloat(`${weight}`);
|
|
38
|
-
if (!Number.isNaN(num))
|
|
39
|
-
return num > 0 ? shade(color, weight) : tint(color, -num);
|
|
40
|
-
}
|
|
41
|
-
const fns = { tint, shade, shift };
|
|
42
|
-
function variantColorMix() {
|
|
43
|
-
let re;
|
|
44
|
-
return {
|
|
45
|
-
name: "mix",
|
|
46
|
-
match(matcher, ctx) {
|
|
47
|
-
if (!re)
|
|
48
|
-
re = new RegExp(`^mix-(tint|shade|shift)-(-?\\d{1,3})(?:${ctx.generator.config.separators.join("|")})`);
|
|
49
|
-
const m = matcher.match(re);
|
|
50
|
-
if (m) {
|
|
51
|
-
return {
|
|
52
|
-
matcher: matcher.slice(m[0].length),
|
|
53
|
-
body: (body) => {
|
|
54
|
-
body.forEach((v) => {
|
|
55
|
-
if (v[1]) {
|
|
56
|
-
const color = ruleUtils.parseCssColor(`${v[1]}`);
|
|
57
|
-
if (color) {
|
|
58
|
-
const mixed = fns[m[1]](color, m[2]);
|
|
59
|
-
if (mixed)
|
|
60
|
-
v[1] = ruleUtils.colorToString(mixed);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
return body;
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const presetUno = core.definePreset((options = {}) => {
|
|
73
|
-
const wind = presetWind.presetWind(options);
|
|
74
|
-
return {
|
|
75
|
-
...wind,
|
|
76
|
-
name: "@unocss/preset-uno",
|
|
77
|
-
variants: [
|
|
78
|
-
...wind.variants,
|
|
79
|
-
variantColorMix()
|
|
80
|
-
]
|
|
81
|
-
};
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
exports.default = presetUno;
|
|
85
|
-
exports.presetUno = presetUno;
|
package/dist/index.d.cts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as _unocss_core from '@unocss/core';
|
|
2
|
-
import { PresetMiniOptions, Theme } from '@unocss/preset-mini';
|
|
3
|
-
export { Theme } from '@unocss/preset-mini';
|
|
4
|
-
|
|
5
|
-
interface PresetUnoOptions extends PresetMiniOptions {
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* The defult UnoCSS preset, provide Tailwind-like utilities with some additional features.
|
|
9
|
-
*
|
|
10
|
-
* @see https://unocss.dev/presets/uno
|
|
11
|
-
*/
|
|
12
|
-
declare const presetUno: _unocss_core.PresetFactory<Theme, PresetUnoOptions>;
|
|
13
|
-
|
|
14
|
-
export { type PresetUnoOptions, presetUno as default, presetUno };
|
package/dist/theme.cjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const theme = require('@unocss/preset-mini/theme');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.prototype.hasOwnProperty.call(theme, '__proto__') &&
|
|
8
|
-
!Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
|
|
9
|
-
Object.defineProperty(exports, '__proto__', {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
value: theme['__proto__']
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
Object.keys(theme).forEach(function (k) {
|
|
15
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = theme[k];
|
|
16
|
-
});
|
package/dist/theme.d.cts
DELETED
package/dist/utils.cjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const ruleUtils = require('@unocss/rule-utils');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.prototype.hasOwnProperty.call(ruleUtils, '__proto__') &&
|
|
8
|
-
!Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
|
|
9
|
-
Object.defineProperty(exports, '__proto__', {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
value: ruleUtils['__proto__']
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
Object.keys(ruleUtils).forEach(function (k) {
|
|
15
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = ruleUtils[k];
|
|
16
|
-
});
|
package/dist/utils.d.cts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@unocss/rule-utils';
|