@unocss/preset-mini 0.44.4 → 0.44.5
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/chunks/colors2.cjs +18 -6
- package/dist/chunks/colors2.mjs +18 -6
- package/package.json +2 -2
package/dist/chunks/colors2.cjs
CHANGED
|
@@ -222,11 +222,23 @@ function bracketWithType(str, type) {
|
|
|
222
222
|
base = str.slice(1, -1);
|
|
223
223
|
else if (type && match[1] === type)
|
|
224
224
|
base = str.slice(match[0].length, -1);
|
|
225
|
-
if (base
|
|
226
|
-
return
|
|
227
|
-
|
|
228
|
-
|
|
225
|
+
if (!base)
|
|
226
|
+
return;
|
|
227
|
+
let curly = 0;
|
|
228
|
+
for (const i of base) {
|
|
229
|
+
if (i === "[") {
|
|
230
|
+
curly += 1;
|
|
231
|
+
} else if (i === "]") {
|
|
232
|
+
curly -= 1;
|
|
233
|
+
if (curly < 0)
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
229
236
|
}
|
|
237
|
+
if (curly)
|
|
238
|
+
return;
|
|
239
|
+
return base.replace(/(url\(.*?\))/g, (v) => v.replace(/_/g, "\\_")).replace(/([^\\])_/g, "$1 ").replace(/(?:calc|clamp|max|min)\((.*)/g, (v) => {
|
|
240
|
+
return v.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, "$1 $2 ");
|
|
241
|
+
});
|
|
230
242
|
}
|
|
231
243
|
}
|
|
232
244
|
function bracket(str) {
|
|
@@ -342,9 +354,9 @@ function parseColor$1(body, theme) {
|
|
|
342
354
|
let color;
|
|
343
355
|
const bracket = handler.bracketOfColor(main);
|
|
344
356
|
const bracketOrMain = bracket || main;
|
|
345
|
-
if (bracketOrMain.
|
|
357
|
+
if (bracketOrMain.match(/^#[\da-fA-F]+/g))
|
|
346
358
|
color = bracketOrMain;
|
|
347
|
-
else if (bracketOrMain.
|
|
359
|
+
else if (bracketOrMain.match(/^hex-[\da-fA-F]+/g))
|
|
348
360
|
color = `#${bracketOrMain.slice(4)}`;
|
|
349
361
|
else if (main.startsWith("$"))
|
|
350
362
|
color = handler.cssvar(main);
|
package/dist/chunks/colors2.mjs
CHANGED
|
@@ -220,11 +220,23 @@ function bracketWithType(str, type) {
|
|
|
220
220
|
base = str.slice(1, -1);
|
|
221
221
|
else if (type && match[1] === type)
|
|
222
222
|
base = str.slice(match[0].length, -1);
|
|
223
|
-
if (base
|
|
224
|
-
return
|
|
225
|
-
|
|
226
|
-
|
|
223
|
+
if (!base)
|
|
224
|
+
return;
|
|
225
|
+
let curly = 0;
|
|
226
|
+
for (const i of base) {
|
|
227
|
+
if (i === "[") {
|
|
228
|
+
curly += 1;
|
|
229
|
+
} else if (i === "]") {
|
|
230
|
+
curly -= 1;
|
|
231
|
+
if (curly < 0)
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
227
234
|
}
|
|
235
|
+
if (curly)
|
|
236
|
+
return;
|
|
237
|
+
return base.replace(/(url\(.*?\))/g, (v) => v.replace(/_/g, "\\_")).replace(/([^\\])_/g, "$1 ").replace(/(?:calc|clamp|max|min)\((.*)/g, (v) => {
|
|
238
|
+
return v.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, "$1 $2 ");
|
|
239
|
+
});
|
|
228
240
|
}
|
|
229
241
|
}
|
|
230
242
|
function bracket(str) {
|
|
@@ -340,9 +352,9 @@ function parseColor$1(body, theme) {
|
|
|
340
352
|
let color;
|
|
341
353
|
const bracket = handler.bracketOfColor(main);
|
|
342
354
|
const bracketOrMain = bracket || main;
|
|
343
|
-
if (bracketOrMain.
|
|
355
|
+
if (bracketOrMain.match(/^#[\da-fA-F]+/g))
|
|
344
356
|
color = bracketOrMain;
|
|
345
|
-
else if (bracketOrMain.
|
|
357
|
+
else if (bracketOrMain.match(/^hex-[\da-fA-F]+/g))
|
|
346
358
|
color = `#${bracketOrMain.slice(4)}`;
|
|
347
359
|
else if (main.startsWith("$"))
|
|
348
360
|
color = handler.cssvar(main);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-mini",
|
|
3
|
-
"version": "0.44.
|
|
3
|
+
"version": "0.44.5",
|
|
4
4
|
"description": "The minimal preset for UnoCSS",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"*.css"
|
|
62
62
|
],
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@unocss/core": "0.44.
|
|
64
|
+
"@unocss/core": "0.44.5"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
67
|
"build": "unbuild",
|