@unocss/preset-mini 0.54.0 → 0.54.2
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.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/rules.cjs +1 -1
- package/dist/rules.mjs +1 -1
- package/dist/shared/{preset-mini.31fe3ff4.mjs → preset-mini.1b0eb763.mjs} +36 -4
- package/dist/shared/{preset-mini.345a6f11.cjs → preset-mini.4554257a.cjs} +36 -4
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const extractorArbitraryVariants = require('@unocss/extractor-arbitrary-variants');
|
|
6
6
|
const core = require('@unocss/core');
|
|
7
7
|
require('./shared/preset-mini.78d4899a.cjs');
|
|
8
|
-
const _default$1 = require('./shared/preset-mini.
|
|
8
|
+
const _default$1 = require('./shared/preset-mini.4554257a.cjs');
|
|
9
9
|
const colors$1 = require('./shared/preset-mini.a21c5071.cjs');
|
|
10
10
|
const colors = require('./shared/preset-mini.f3fc54d2.cjs');
|
|
11
11
|
const _default = require('./shared/preset-mini.b22ca5de.cjs');
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { extractorArbitraryVariants } from '@unocss/extractor-arbitrary-variants';
|
|
2
2
|
import { entriesToCss, toArray } from '@unocss/core';
|
|
3
3
|
import './shared/preset-mini.830250eb.mjs';
|
|
4
|
-
import { r as rules } from './shared/preset-mini.
|
|
4
|
+
import { r as rules } from './shared/preset-mini.1b0eb763.mjs';
|
|
5
5
|
export { p as parseColor } from './shared/preset-mini.6c1c8016.mjs';
|
|
6
6
|
export { c as colors } from './shared/preset-mini.1c66bf79.mjs';
|
|
7
7
|
import { t as theme } from './shared/preset-mini.e7d18afd.mjs';
|
package/dist/rules.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const transform = require('./shared/preset-mini.78d4899a.cjs');
|
|
6
|
-
const _default = require('./shared/preset-mini.
|
|
6
|
+
const _default = require('./shared/preset-mini.4554257a.cjs');
|
|
7
7
|
require('./shared/preset-mini.a21c5071.cjs');
|
|
8
8
|
require('@unocss/core');
|
|
9
9
|
|
package/dist/rules.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { E as alignments, B as appearance, q as appearances, b as bgColors, T as borderStyles, a as borders, m as boxShadows, R as boxShadowsBase, K as boxSizing, y as breaks, c as colorScheme, O as contains, e as contentVisibility, f as contents, n as cursors, d as displays, G as flexGridJustifiesAlignments, I as floats, l as fontSmoothings, k as fontStyles, U as handlerBorderStyle, H as insets, D as justifies, o as opacity, C as orders, A as outline, z as overflows, F as placements, s as pointerEvents, p as positions, u as resizes, S as ringBase, r as rings, i as textAligns, j as textColors, g as textDecorations, t as textOverflows, h as textTransforms, P as textWraps, Q as transformBase, M as transforms, L as transitions, w as userSelects, V as varEmpty, v as verticalAligns, x as whitespaces, N as willChange, J as zIndexes } from './shared/preset-mini.830250eb.mjs';
|
|
2
|
-
export { b as aspectRatio, c as containerParent, l as cssProperty, k as cssVariables, f as flex, e as fonts, g as gaps, a as grids, m as margins, p as paddings, q as questionMark, r as rules, s as sizes, d as svgUtilities, t as tabSizes, h as textIndents, j as textShadows, i as textStrokes } from './shared/preset-mini.
|
|
2
|
+
export { b as aspectRatio, c as containerParent, l as cssProperty, k as cssVariables, f as flex, e as fonts, g as gaps, a as grids, m as margins, p as paddings, q as questionMark, r as rules, s as sizes, d as svgUtilities, t as tabSizes, h as textIndents, j as textShadows, i as textStrokes } from './shared/preset-mini.1b0eb763.mjs';
|
|
3
3
|
import './shared/preset-mini.6c1c8016.mjs';
|
|
4
4
|
import '@unocss/core';
|
|
@@ -61,7 +61,7 @@ const fonts = [
|
|
|
61
61
|
},
|
|
62
62
|
{ autocomplete: "text-$fontSize" }
|
|
63
63
|
],
|
|
64
|
-
[/^text-size-(.+)$/, ([, s], { theme }) => {
|
|
64
|
+
[/^(?:text|font)-size-(.+)$/, ([, s], { theme }) => {
|
|
65
65
|
const themed = toArray(theme.fontSize?.[s]);
|
|
66
66
|
const size = themed?.[0] ?? h.bracket.cssvar.global.rem(s);
|
|
67
67
|
if (size != null)
|
|
@@ -307,11 +307,43 @@ const cssVariables = [
|
|
|
307
307
|
}]
|
|
308
308
|
];
|
|
309
309
|
const cssProperty = [
|
|
310
|
-
[/^\[(
|
|
311
|
-
if (!
|
|
312
|
-
return
|
|
310
|
+
[/^\[(.*)\]$/, ([_, body]) => {
|
|
311
|
+
if (!body.includes(":"))
|
|
312
|
+
return;
|
|
313
|
+
const [prop, ...rest] = body.split(":");
|
|
314
|
+
const value = rest.join(":");
|
|
315
|
+
if (!isURI(body) && prop.match(/^[a-z-]+$/) && isValidCSSBody(value)) {
|
|
316
|
+
const parsed = h.bracket(`[${value}]`);
|
|
317
|
+
if (parsed)
|
|
318
|
+
return { [prop]: parsed };
|
|
319
|
+
}
|
|
313
320
|
}]
|
|
314
321
|
];
|
|
322
|
+
function isValidCSSBody(body) {
|
|
323
|
+
let i = 0;
|
|
324
|
+
function findUntil(c) {
|
|
325
|
+
while (i < body.length) {
|
|
326
|
+
i += 1;
|
|
327
|
+
const char = body[i];
|
|
328
|
+
if (char === c)
|
|
329
|
+
return true;
|
|
330
|
+
}
|
|
331
|
+
return false;
|
|
332
|
+
}
|
|
333
|
+
for (i = 0; i < body.length; i++) {
|
|
334
|
+
const c = body[i];
|
|
335
|
+
if ("\"`'".includes(c)) {
|
|
336
|
+
if (!findUntil(c))
|
|
337
|
+
return false;
|
|
338
|
+
} else if (c === "(") {
|
|
339
|
+
if (!findUntil(")"))
|
|
340
|
+
return false;
|
|
341
|
+
} else if ("[]{}:".includes(c)) {
|
|
342
|
+
return false;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
return true;
|
|
346
|
+
}
|
|
315
347
|
function isURI(declaration) {
|
|
316
348
|
if (!declaration.includes("://"))
|
|
317
349
|
return false;
|
|
@@ -63,7 +63,7 @@ const fonts = [
|
|
|
63
63
|
},
|
|
64
64
|
{ autocomplete: "text-$fontSize" }
|
|
65
65
|
],
|
|
66
|
-
[/^text-size-(.+)$/, ([, s], { theme }) => {
|
|
66
|
+
[/^(?:text|font)-size-(.+)$/, ([, s], { theme }) => {
|
|
67
67
|
const themed = core.toArray(theme.fontSize?.[s]);
|
|
68
68
|
const size = themed?.[0] ?? colors.h.bracket.cssvar.global.rem(s);
|
|
69
69
|
if (size != null)
|
|
@@ -309,11 +309,43 @@ const cssVariables = [
|
|
|
309
309
|
}]
|
|
310
310
|
];
|
|
311
311
|
const cssProperty = [
|
|
312
|
-
[/^\[(
|
|
313
|
-
if (!
|
|
314
|
-
return
|
|
312
|
+
[/^\[(.*)\]$/, ([_, body]) => {
|
|
313
|
+
if (!body.includes(":"))
|
|
314
|
+
return;
|
|
315
|
+
const [prop, ...rest] = body.split(":");
|
|
316
|
+
const value = rest.join(":");
|
|
317
|
+
if (!isURI(body) && prop.match(/^[a-z-]+$/) && isValidCSSBody(value)) {
|
|
318
|
+
const parsed = colors.h.bracket(`[${value}]`);
|
|
319
|
+
if (parsed)
|
|
320
|
+
return { [prop]: parsed };
|
|
321
|
+
}
|
|
315
322
|
}]
|
|
316
323
|
];
|
|
324
|
+
function isValidCSSBody(body) {
|
|
325
|
+
let i = 0;
|
|
326
|
+
function findUntil(c) {
|
|
327
|
+
while (i < body.length) {
|
|
328
|
+
i += 1;
|
|
329
|
+
const char = body[i];
|
|
330
|
+
if (char === c)
|
|
331
|
+
return true;
|
|
332
|
+
}
|
|
333
|
+
return false;
|
|
334
|
+
}
|
|
335
|
+
for (i = 0; i < body.length; i++) {
|
|
336
|
+
const c = body[i];
|
|
337
|
+
if ("\"`'".includes(c)) {
|
|
338
|
+
if (!findUntil(c))
|
|
339
|
+
return false;
|
|
340
|
+
} else if (c === "(") {
|
|
341
|
+
if (!findUntil(")"))
|
|
342
|
+
return false;
|
|
343
|
+
} else if ("[]{}:".includes(c)) {
|
|
344
|
+
return false;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
return true;
|
|
348
|
+
}
|
|
317
349
|
function isURI(declaration) {
|
|
318
350
|
if (!declaration.includes("://"))
|
|
319
351
|
return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-mini",
|
|
3
|
-
"version": "0.54.
|
|
3
|
+
"version": "0.54.2",
|
|
4
4
|
"description": "The minimal preset for UnoCSS",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"*.css"
|
|
62
62
|
],
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@unocss/core": "0.54.
|
|
65
|
-
"@unocss/extractor-arbitrary-variants": "0.54.
|
|
64
|
+
"@unocss/core": "0.54.2",
|
|
65
|
+
"@unocss/extractor-arbitrary-variants": "0.54.2"
|
|
66
66
|
},
|
|
67
67
|
"scripts": {
|
|
68
68
|
"build": "unbuild",
|