@unocss/preset-mini 0.22.1 → 0.22.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/chunks/default2.cjs +115 -125
- package/dist/chunks/default2.mjs +116 -127
- package/dist/chunks/utilities.cjs +2 -0
- package/dist/chunks/utilities.mjs +2 -0
- package/dist/rules.cjs +1 -0
- package/dist/rules.d.ts +2 -2
- package/dist/rules.mjs +1 -1
- package/package.json +2 -2
package/dist/chunks/default2.cjs
CHANGED
|
@@ -210,6 +210,117 @@ const flex = [
|
|
|
210
210
|
["flex-nowrap", { "flex-wrap": "nowrap" }]
|
|
211
211
|
];
|
|
212
212
|
|
|
213
|
+
const varEmpty = "var(--un-empty,/*!*/ /*!*/)";
|
|
214
|
+
const displays = [
|
|
215
|
+
["inline", { display: "inline" }],
|
|
216
|
+
["block", { display: "block" }],
|
|
217
|
+
["inline-block", { display: "inline-block" }],
|
|
218
|
+
["contents", { display: "contents" }],
|
|
219
|
+
["flow-root", { display: "flow-root" }],
|
|
220
|
+
["list-item", { display: "list-item" }],
|
|
221
|
+
["hidden", { display: "none" }]
|
|
222
|
+
];
|
|
223
|
+
const appearances = [
|
|
224
|
+
["visible", { visibility: "visible" }],
|
|
225
|
+
["invisible", { visibility: "hidden" }],
|
|
226
|
+
["backface-visible", { "backface-visibility": "visible" }],
|
|
227
|
+
["backface-hidden", { "backface-visibility": "hidden" }]
|
|
228
|
+
];
|
|
229
|
+
const cursors = [
|
|
230
|
+
[/^cursor-(.+)$/, ([, c]) => ({ cursor: c })]
|
|
231
|
+
];
|
|
232
|
+
const pointerEvents = [
|
|
233
|
+
["pointer-events-auto", { "pointer-events": "auto" }],
|
|
234
|
+
["pointer-events-none", { "pointer-events": "none" }]
|
|
235
|
+
];
|
|
236
|
+
const resizes = [
|
|
237
|
+
["resize-x", { resize: "horizontal" }],
|
|
238
|
+
["resize-y", { resize: "vertical" }],
|
|
239
|
+
["resize", { resize: "both" }],
|
|
240
|
+
["resize-none", { resize: "none" }]
|
|
241
|
+
];
|
|
242
|
+
const userSelects = [
|
|
243
|
+
["select-auto", { "user-select": "auto" }],
|
|
244
|
+
["select-all", { "user-select": "all" }],
|
|
245
|
+
["select-text", { "user-select": "text" }],
|
|
246
|
+
["select-none", { "user-select": "none" }]
|
|
247
|
+
];
|
|
248
|
+
const whitespaces = [
|
|
249
|
+
[/^(?:whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap)$/, ([, v]) => ({ "white-space": v })]
|
|
250
|
+
];
|
|
251
|
+
const contents = [
|
|
252
|
+
["content-empty", { content: '""' }],
|
|
253
|
+
["content-none", { content: '""' }]
|
|
254
|
+
];
|
|
255
|
+
const breaks = [
|
|
256
|
+
["break-normal", { "overflow-wrap": "normal", "word-break": "normal" }],
|
|
257
|
+
["break-words", { "overflow-wrap": "break-word" }],
|
|
258
|
+
["break-all", { "word-break": "break-all" }]
|
|
259
|
+
];
|
|
260
|
+
const textOverflows = [
|
|
261
|
+
["truncate", { "overflow": "hidden", "text-overflow": "ellipsis", "white-space": "nowrap" }],
|
|
262
|
+
["text-ellipsis", { "text-overflow": "ellipsis" }],
|
|
263
|
+
["text-clip", { "text-overflow": "clip" }]
|
|
264
|
+
];
|
|
265
|
+
const textTransforms = [
|
|
266
|
+
["case-upper", { "text-transform": "uppercase" }],
|
|
267
|
+
["case-lower", { "text-transform": "lowercase" }],
|
|
268
|
+
["case-capital", { "text-transform": "capitalize" }],
|
|
269
|
+
["case-normal", { "text-transform": "none" }]
|
|
270
|
+
];
|
|
271
|
+
const fontStyles = [
|
|
272
|
+
["italic", { "font-style": "italic" }],
|
|
273
|
+
["not-italic", { "font-style": "normal" }]
|
|
274
|
+
];
|
|
275
|
+
const fontSmoothings = [
|
|
276
|
+
["antialiased", {
|
|
277
|
+
"-webkit-font-smoothing": "antialiased",
|
|
278
|
+
"-moz-osx-font-smoothing": "grayscale",
|
|
279
|
+
"font-smoothing": "grayscale"
|
|
280
|
+
}],
|
|
281
|
+
["subpixel-antialiased", {
|
|
282
|
+
"-webkit-font-smoothing": "auto",
|
|
283
|
+
"-moz-osx-font-smoothing": "auto",
|
|
284
|
+
"font-smoothing": "auto"
|
|
285
|
+
}]
|
|
286
|
+
];
|
|
287
|
+
|
|
288
|
+
const shadowBase = {
|
|
289
|
+
[core.CONTROL_SHORTCUT_NO_MERGE]: "",
|
|
290
|
+
"--un-ring-offset-shadow": "0 0 #0000",
|
|
291
|
+
"--un-ring-shadow": "0 0 #0000",
|
|
292
|
+
"--un-shadow-inset": varEmpty,
|
|
293
|
+
"--un-shadow": "0 0 #0000"
|
|
294
|
+
};
|
|
295
|
+
const colorableShadows = (shadows, colorVar) => {
|
|
296
|
+
const colored = [];
|
|
297
|
+
shadows = core.toArray(shadows);
|
|
298
|
+
for (let i = 0; i < shadows.length; i++) {
|
|
299
|
+
const [size, color] = shadows[i].split(/\s(\S+)$/);
|
|
300
|
+
if (color.split("(").length !== color.split(")").length)
|
|
301
|
+
return shadows;
|
|
302
|
+
colored.push(`${size} var(${colorVar}, ${color})`);
|
|
303
|
+
}
|
|
304
|
+
return colored;
|
|
305
|
+
};
|
|
306
|
+
const boxShadows = [
|
|
307
|
+
[/^shadow(?:-(.+))?$/, ([, d], { theme }) => {
|
|
308
|
+
const v = theme.boxShadow?.[d || "DEFAULT"];
|
|
309
|
+
if (v) {
|
|
310
|
+
return [
|
|
311
|
+
shadowBase,
|
|
312
|
+
{
|
|
313
|
+
"--un-shadow": colorableShadows(v, "--un-shadow-color").join(","),
|
|
314
|
+
"box-shadow": "var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow)"
|
|
315
|
+
}
|
|
316
|
+
];
|
|
317
|
+
}
|
|
318
|
+
}],
|
|
319
|
+
[/^shadow-(.+)$/, utilities.colorResolver("--un-shadow-color", "shadow")],
|
|
320
|
+
[/^shadow-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-shadow-opacity": utilities.handler.bracket.percent.cssvar(opacity) })],
|
|
321
|
+
["shadow-inset", { "--un-shadow-inset": "inset" }]
|
|
322
|
+
];
|
|
323
|
+
|
|
213
324
|
const weightMap = {
|
|
214
325
|
thin: "100",
|
|
215
326
|
extralight: "200",
|
|
@@ -264,25 +375,14 @@ const textShadows = [
|
|
|
264
375
|
[/^text-shadow(?:-(.+))?$/, ([, s], { theme }) => {
|
|
265
376
|
const v = theme.textShadow?.[s || "DEFAULT"];
|
|
266
377
|
if (v != null) {
|
|
267
|
-
const shadow = core.toArray(v);
|
|
268
|
-
const colored = shadow.map((s2) => s2.replace(/\s\S+$/, " var(--un-text-shadow-color)"));
|
|
269
378
|
return {
|
|
270
|
-
"--un-text-shadow": shadow.join(","),
|
|
271
|
-
"--un-text-shadow-colored": colored.join(","),
|
|
379
|
+
"--un-text-shadow": colorableShadows(v, "--un-text-shadow-color").join(","),
|
|
272
380
|
"text-shadow": "var(--un-text-shadow)"
|
|
273
381
|
};
|
|
274
382
|
}
|
|
275
383
|
return { "text-shadow": utilities.handler.bracket.cssvar(s) };
|
|
276
384
|
}],
|
|
277
|
-
[/^text-shadow-color-(.+)$/, (
|
|
278
|
-
const color = utilities.colorResolver("--un-text-shadow-color", "text-shadow")(m, ctx);
|
|
279
|
-
if (color) {
|
|
280
|
-
return {
|
|
281
|
-
...color,
|
|
282
|
-
"--un-text-shadow": "var(--un-text-shadow-colored)"
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
|
-
}],
|
|
385
|
+
[/^text-shadow-color-(.+)$/, utilities.colorResolver("--un-text-shadow-color", "text-shadow")],
|
|
286
386
|
[/^text-shadow-color-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-shadow-opacity": utilities.handler.bracket.percent(opacity) })]
|
|
287
387
|
];
|
|
288
388
|
|
|
@@ -429,6 +529,7 @@ function handleInsetValues([, d, v]) {
|
|
|
429
529
|
const insets = [
|
|
430
530
|
[/^(?:position-|pos-)?inset-(.+)$/, ([, v]) => ({ inset: handleInsetValue(v) })],
|
|
431
531
|
[/^(?:position-|pos-)?inset-([xy])-(.+)$/, handleInsetValues],
|
|
532
|
+
[/^(?:position-|pos-)?inset-([rltbse])-(.+)$/, handleInsetValues],
|
|
432
533
|
[/^(?:position-|pos-)?inset-(block|inline)-(.+)$/, handleInsetValues],
|
|
433
534
|
[/^(?:position-|pos-)?inset-([bi][se])-(.+)$/, handleInsetValues],
|
|
434
535
|
[/^(?:position-|pos-)?(top|left|right|bottom)-(.+)$/, ([, d, v]) => ({ [d]: handleInsetValue(v) })]
|
|
@@ -451,118 +552,6 @@ const boxSizing = [
|
|
|
451
552
|
["box-content", { "box-sizing": "content-box" }]
|
|
452
553
|
];
|
|
453
554
|
|
|
454
|
-
const varEmpty = "var(--un-empty,/*!*/ /*!*/)";
|
|
455
|
-
const displays = [
|
|
456
|
-
["inline", { display: "inline" }],
|
|
457
|
-
["block", { display: "block" }],
|
|
458
|
-
["inline-block", { display: "inline-block" }],
|
|
459
|
-
["contents", { display: "contents" }],
|
|
460
|
-
["flow-root", { display: "flow-root" }],
|
|
461
|
-
["list-item", { display: "list-item" }],
|
|
462
|
-
["hidden", { display: "none" }]
|
|
463
|
-
];
|
|
464
|
-
const appearances = [
|
|
465
|
-
["visible", { visibility: "visible" }],
|
|
466
|
-
["invisible", { visibility: "hidden" }],
|
|
467
|
-
["backface-visible", { "backface-visibility": "visible" }],
|
|
468
|
-
["backface-hidden", { "backface-visibility": "hidden" }]
|
|
469
|
-
];
|
|
470
|
-
const cursors = [
|
|
471
|
-
[/^cursor-(.+)$/, ([, c]) => ({ cursor: c })]
|
|
472
|
-
];
|
|
473
|
-
const pointerEvents = [
|
|
474
|
-
["pointer-events-auto", { "pointer-events": "auto" }],
|
|
475
|
-
["pointer-events-none", { "pointer-events": "none" }]
|
|
476
|
-
];
|
|
477
|
-
const resizes = [
|
|
478
|
-
["resize-x", { resize: "horizontal" }],
|
|
479
|
-
["resize-y", { resize: "vertical" }],
|
|
480
|
-
["resize", { resize: "both" }],
|
|
481
|
-
["resize-none", { resize: "none" }]
|
|
482
|
-
];
|
|
483
|
-
const userSelects = [
|
|
484
|
-
["select-auto", { "user-select": "auto" }],
|
|
485
|
-
["select-all", { "user-select": "all" }],
|
|
486
|
-
["select-text", { "user-select": "text" }],
|
|
487
|
-
["select-none", { "user-select": "none" }]
|
|
488
|
-
];
|
|
489
|
-
const whitespaces = [
|
|
490
|
-
[/^(?:whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap)$/, ([, v]) => ({ "white-space": v })]
|
|
491
|
-
];
|
|
492
|
-
const contents = [
|
|
493
|
-
["content-empty", { content: '""' }],
|
|
494
|
-
["content-none", { content: '""' }]
|
|
495
|
-
];
|
|
496
|
-
const breaks = [
|
|
497
|
-
["break-normal", { "overflow-wrap": "normal", "word-break": "normal" }],
|
|
498
|
-
["break-words", { "overflow-wrap": "break-word" }],
|
|
499
|
-
["break-all", { "word-break": "break-all" }]
|
|
500
|
-
];
|
|
501
|
-
const textOverflows = [
|
|
502
|
-
["truncate", { "overflow": "hidden", "text-overflow": "ellipsis", "white-space": "nowrap" }],
|
|
503
|
-
["text-ellipsis", { "text-overflow": "ellipsis" }],
|
|
504
|
-
["text-clip", { "text-overflow": "clip" }]
|
|
505
|
-
];
|
|
506
|
-
const textTransforms = [
|
|
507
|
-
["case-upper", { "text-transform": "uppercase" }],
|
|
508
|
-
["case-lower", { "text-transform": "lowercase" }],
|
|
509
|
-
["case-capital", { "text-transform": "capitalize" }],
|
|
510
|
-
["case-normal", { "text-transform": "none" }]
|
|
511
|
-
];
|
|
512
|
-
const fontStyles = [
|
|
513
|
-
["italic", { "font-style": "italic" }],
|
|
514
|
-
["not-italic", { "font-style": "normal" }]
|
|
515
|
-
];
|
|
516
|
-
const fontSmoothings = [
|
|
517
|
-
["antialiased", {
|
|
518
|
-
"-webkit-font-smoothing": "antialiased",
|
|
519
|
-
"-moz-osx-font-smoothing": "grayscale",
|
|
520
|
-
"font-smoothing": "grayscale"
|
|
521
|
-
}],
|
|
522
|
-
["subpixel-antialiased", {
|
|
523
|
-
"-webkit-font-smoothing": "auto",
|
|
524
|
-
"-moz-osx-font-smoothing": "auto",
|
|
525
|
-
"font-smoothing": "auto"
|
|
526
|
-
}]
|
|
527
|
-
];
|
|
528
|
-
|
|
529
|
-
const shadowBase = {
|
|
530
|
-
[core.CONTROL_SHORTCUT_NO_MERGE]: "",
|
|
531
|
-
"--un-ring-offset-shadow": "0 0 #0000",
|
|
532
|
-
"--un-ring-shadow": "0 0 #0000",
|
|
533
|
-
"--un-shadow-inset": varEmpty,
|
|
534
|
-
"--un-shadow": "0 0 #0000",
|
|
535
|
-
"--un-shadow-colored": "0 0 #0000"
|
|
536
|
-
};
|
|
537
|
-
const boxShadows = [
|
|
538
|
-
[/^shadow(?:-(.+))?$/, ([, d], { theme }) => {
|
|
539
|
-
const v = theme.boxShadow?.[d || "DEFAULT"];
|
|
540
|
-
if (v) {
|
|
541
|
-
const shadow = core.toArray(v);
|
|
542
|
-
const colored = shadow.map((s) => s.replace(/\s\S+$/, " var(--un-shadow-color)"));
|
|
543
|
-
return [
|
|
544
|
-
shadowBase,
|
|
545
|
-
{
|
|
546
|
-
"--un-shadow": shadow.join(","),
|
|
547
|
-
"--un-shadow-colored": colored.join(","),
|
|
548
|
-
"box-shadow": "var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow)"
|
|
549
|
-
}
|
|
550
|
-
];
|
|
551
|
-
}
|
|
552
|
-
}],
|
|
553
|
-
[/^shadow-(.+)$/, (m, ctx) => {
|
|
554
|
-
const color = utilities.colorResolver("--un-shadow-color", "shadow")(m, ctx);
|
|
555
|
-
if (color) {
|
|
556
|
-
return {
|
|
557
|
-
...color,
|
|
558
|
-
"--un-shadow": "var(--un-shadow-colored)"
|
|
559
|
-
};
|
|
560
|
-
}
|
|
561
|
-
}],
|
|
562
|
-
[/^shadow-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-shadow-opacity": utilities.handler.bracket.percent.cssvar(opacity) })],
|
|
563
|
-
["shadow-inset", { "--un-shadow-inset": "inset" }]
|
|
564
|
-
];
|
|
565
|
-
|
|
566
555
|
const ringBase = {
|
|
567
556
|
"--un-ring-inset": varEmpty,
|
|
568
557
|
"--un-ring-offset-width": "0px",
|
|
@@ -939,6 +928,7 @@ exports.borders = borders;
|
|
|
939
928
|
exports.boxShadows = boxShadows;
|
|
940
929
|
exports.boxSizing = boxSizing;
|
|
941
930
|
exports.breaks = breaks;
|
|
931
|
+
exports.colorableShadows = colorableShadows;
|
|
942
932
|
exports.contents = contents;
|
|
943
933
|
exports.cssProperty = cssProperty;
|
|
944
934
|
exports.cssVariables = cssVariables;
|
package/dist/chunks/default2.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h as handler, c as colorResolver, d as directionMap, p as parseColor, a as cornerMap, i as insetMap, b as directionSize, e as positionMap, x as xyzMap } from './utilities.mjs';
|
|
2
|
-
import {
|
|
2
|
+
import { CONTROL_SHORTCUT_NO_MERGE, toArray } from '@unocss/core';
|
|
3
3
|
|
|
4
4
|
const verticalAlignAlias = {
|
|
5
5
|
mid: "middle",
|
|
@@ -208,6 +208,117 @@ const flex = [
|
|
|
208
208
|
["flex-nowrap", { "flex-wrap": "nowrap" }]
|
|
209
209
|
];
|
|
210
210
|
|
|
211
|
+
const varEmpty = "var(--un-empty,/*!*/ /*!*/)";
|
|
212
|
+
const displays = [
|
|
213
|
+
["inline", { display: "inline" }],
|
|
214
|
+
["block", { display: "block" }],
|
|
215
|
+
["inline-block", { display: "inline-block" }],
|
|
216
|
+
["contents", { display: "contents" }],
|
|
217
|
+
["flow-root", { display: "flow-root" }],
|
|
218
|
+
["list-item", { display: "list-item" }],
|
|
219
|
+
["hidden", { display: "none" }]
|
|
220
|
+
];
|
|
221
|
+
const appearances = [
|
|
222
|
+
["visible", { visibility: "visible" }],
|
|
223
|
+
["invisible", { visibility: "hidden" }],
|
|
224
|
+
["backface-visible", { "backface-visibility": "visible" }],
|
|
225
|
+
["backface-hidden", { "backface-visibility": "hidden" }]
|
|
226
|
+
];
|
|
227
|
+
const cursors = [
|
|
228
|
+
[/^cursor-(.+)$/, ([, c]) => ({ cursor: c })]
|
|
229
|
+
];
|
|
230
|
+
const pointerEvents = [
|
|
231
|
+
["pointer-events-auto", { "pointer-events": "auto" }],
|
|
232
|
+
["pointer-events-none", { "pointer-events": "none" }]
|
|
233
|
+
];
|
|
234
|
+
const resizes = [
|
|
235
|
+
["resize-x", { resize: "horizontal" }],
|
|
236
|
+
["resize-y", { resize: "vertical" }],
|
|
237
|
+
["resize", { resize: "both" }],
|
|
238
|
+
["resize-none", { resize: "none" }]
|
|
239
|
+
];
|
|
240
|
+
const userSelects = [
|
|
241
|
+
["select-auto", { "user-select": "auto" }],
|
|
242
|
+
["select-all", { "user-select": "all" }],
|
|
243
|
+
["select-text", { "user-select": "text" }],
|
|
244
|
+
["select-none", { "user-select": "none" }]
|
|
245
|
+
];
|
|
246
|
+
const whitespaces = [
|
|
247
|
+
[/^(?:whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap)$/, ([, v]) => ({ "white-space": v })]
|
|
248
|
+
];
|
|
249
|
+
const contents = [
|
|
250
|
+
["content-empty", { content: '""' }],
|
|
251
|
+
["content-none", { content: '""' }]
|
|
252
|
+
];
|
|
253
|
+
const breaks = [
|
|
254
|
+
["break-normal", { "overflow-wrap": "normal", "word-break": "normal" }],
|
|
255
|
+
["break-words", { "overflow-wrap": "break-word" }],
|
|
256
|
+
["break-all", { "word-break": "break-all" }]
|
|
257
|
+
];
|
|
258
|
+
const textOverflows = [
|
|
259
|
+
["truncate", { "overflow": "hidden", "text-overflow": "ellipsis", "white-space": "nowrap" }],
|
|
260
|
+
["text-ellipsis", { "text-overflow": "ellipsis" }],
|
|
261
|
+
["text-clip", { "text-overflow": "clip" }]
|
|
262
|
+
];
|
|
263
|
+
const textTransforms = [
|
|
264
|
+
["case-upper", { "text-transform": "uppercase" }],
|
|
265
|
+
["case-lower", { "text-transform": "lowercase" }],
|
|
266
|
+
["case-capital", { "text-transform": "capitalize" }],
|
|
267
|
+
["case-normal", { "text-transform": "none" }]
|
|
268
|
+
];
|
|
269
|
+
const fontStyles = [
|
|
270
|
+
["italic", { "font-style": "italic" }],
|
|
271
|
+
["not-italic", { "font-style": "normal" }]
|
|
272
|
+
];
|
|
273
|
+
const fontSmoothings = [
|
|
274
|
+
["antialiased", {
|
|
275
|
+
"-webkit-font-smoothing": "antialiased",
|
|
276
|
+
"-moz-osx-font-smoothing": "grayscale",
|
|
277
|
+
"font-smoothing": "grayscale"
|
|
278
|
+
}],
|
|
279
|
+
["subpixel-antialiased", {
|
|
280
|
+
"-webkit-font-smoothing": "auto",
|
|
281
|
+
"-moz-osx-font-smoothing": "auto",
|
|
282
|
+
"font-smoothing": "auto"
|
|
283
|
+
}]
|
|
284
|
+
];
|
|
285
|
+
|
|
286
|
+
const shadowBase = {
|
|
287
|
+
[CONTROL_SHORTCUT_NO_MERGE]: "",
|
|
288
|
+
"--un-ring-offset-shadow": "0 0 #0000",
|
|
289
|
+
"--un-ring-shadow": "0 0 #0000",
|
|
290
|
+
"--un-shadow-inset": varEmpty,
|
|
291
|
+
"--un-shadow": "0 0 #0000"
|
|
292
|
+
};
|
|
293
|
+
const colorableShadows = (shadows, colorVar) => {
|
|
294
|
+
const colored = [];
|
|
295
|
+
shadows = toArray(shadows);
|
|
296
|
+
for (let i = 0; i < shadows.length; i++) {
|
|
297
|
+
const [size, color] = shadows[i].split(/\s(\S+)$/);
|
|
298
|
+
if (color.split("(").length !== color.split(")").length)
|
|
299
|
+
return shadows;
|
|
300
|
+
colored.push(`${size} var(${colorVar}, ${color})`);
|
|
301
|
+
}
|
|
302
|
+
return colored;
|
|
303
|
+
};
|
|
304
|
+
const boxShadows = [
|
|
305
|
+
[/^shadow(?:-(.+))?$/, ([, d], { theme }) => {
|
|
306
|
+
const v = theme.boxShadow?.[d || "DEFAULT"];
|
|
307
|
+
if (v) {
|
|
308
|
+
return [
|
|
309
|
+
shadowBase,
|
|
310
|
+
{
|
|
311
|
+
"--un-shadow": colorableShadows(v, "--un-shadow-color").join(","),
|
|
312
|
+
"box-shadow": "var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow)"
|
|
313
|
+
}
|
|
314
|
+
];
|
|
315
|
+
}
|
|
316
|
+
}],
|
|
317
|
+
[/^shadow-(.+)$/, colorResolver("--un-shadow-color", "shadow")],
|
|
318
|
+
[/^shadow-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-shadow-opacity": handler.bracket.percent.cssvar(opacity) })],
|
|
319
|
+
["shadow-inset", { "--un-shadow-inset": "inset" }]
|
|
320
|
+
];
|
|
321
|
+
|
|
211
322
|
const weightMap = {
|
|
212
323
|
thin: "100",
|
|
213
324
|
extralight: "200",
|
|
@@ -262,25 +373,14 @@ const textShadows = [
|
|
|
262
373
|
[/^text-shadow(?:-(.+))?$/, ([, s], { theme }) => {
|
|
263
374
|
const v = theme.textShadow?.[s || "DEFAULT"];
|
|
264
375
|
if (v != null) {
|
|
265
|
-
const shadow = toArray(v);
|
|
266
|
-
const colored = shadow.map((s2) => s2.replace(/\s\S+$/, " var(--un-text-shadow-color)"));
|
|
267
376
|
return {
|
|
268
|
-
"--un-text-shadow": shadow.join(","),
|
|
269
|
-
"--un-text-shadow-colored": colored.join(","),
|
|
377
|
+
"--un-text-shadow": colorableShadows(v, "--un-text-shadow-color").join(","),
|
|
270
378
|
"text-shadow": "var(--un-text-shadow)"
|
|
271
379
|
};
|
|
272
380
|
}
|
|
273
381
|
return { "text-shadow": handler.bracket.cssvar(s) };
|
|
274
382
|
}],
|
|
275
|
-
[/^text-shadow-color-(.+)$/, (
|
|
276
|
-
const color = colorResolver("--un-text-shadow-color", "text-shadow")(m, ctx);
|
|
277
|
-
if (color) {
|
|
278
|
-
return {
|
|
279
|
-
...color,
|
|
280
|
-
"--un-text-shadow": "var(--un-text-shadow-colored)"
|
|
281
|
-
};
|
|
282
|
-
}
|
|
283
|
-
}],
|
|
383
|
+
[/^text-shadow-color-(.+)$/, colorResolver("--un-text-shadow-color", "text-shadow")],
|
|
284
384
|
[/^text-shadow-color-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-shadow-opacity": handler.bracket.percent(opacity) })]
|
|
285
385
|
];
|
|
286
386
|
|
|
@@ -427,6 +527,7 @@ function handleInsetValues([, d, v]) {
|
|
|
427
527
|
const insets = [
|
|
428
528
|
[/^(?:position-|pos-)?inset-(.+)$/, ([, v]) => ({ inset: handleInsetValue(v) })],
|
|
429
529
|
[/^(?:position-|pos-)?inset-([xy])-(.+)$/, handleInsetValues],
|
|
530
|
+
[/^(?:position-|pos-)?inset-([rltbse])-(.+)$/, handleInsetValues],
|
|
430
531
|
[/^(?:position-|pos-)?inset-(block|inline)-(.+)$/, handleInsetValues],
|
|
431
532
|
[/^(?:position-|pos-)?inset-([bi][se])-(.+)$/, handleInsetValues],
|
|
432
533
|
[/^(?:position-|pos-)?(top|left|right|bottom)-(.+)$/, ([, d, v]) => ({ [d]: handleInsetValue(v) })]
|
|
@@ -449,118 +550,6 @@ const boxSizing = [
|
|
|
449
550
|
["box-content", { "box-sizing": "content-box" }]
|
|
450
551
|
];
|
|
451
552
|
|
|
452
|
-
const varEmpty = "var(--un-empty,/*!*/ /*!*/)";
|
|
453
|
-
const displays = [
|
|
454
|
-
["inline", { display: "inline" }],
|
|
455
|
-
["block", { display: "block" }],
|
|
456
|
-
["inline-block", { display: "inline-block" }],
|
|
457
|
-
["contents", { display: "contents" }],
|
|
458
|
-
["flow-root", { display: "flow-root" }],
|
|
459
|
-
["list-item", { display: "list-item" }],
|
|
460
|
-
["hidden", { display: "none" }]
|
|
461
|
-
];
|
|
462
|
-
const appearances = [
|
|
463
|
-
["visible", { visibility: "visible" }],
|
|
464
|
-
["invisible", { visibility: "hidden" }],
|
|
465
|
-
["backface-visible", { "backface-visibility": "visible" }],
|
|
466
|
-
["backface-hidden", { "backface-visibility": "hidden" }]
|
|
467
|
-
];
|
|
468
|
-
const cursors = [
|
|
469
|
-
[/^cursor-(.+)$/, ([, c]) => ({ cursor: c })]
|
|
470
|
-
];
|
|
471
|
-
const pointerEvents = [
|
|
472
|
-
["pointer-events-auto", { "pointer-events": "auto" }],
|
|
473
|
-
["pointer-events-none", { "pointer-events": "none" }]
|
|
474
|
-
];
|
|
475
|
-
const resizes = [
|
|
476
|
-
["resize-x", { resize: "horizontal" }],
|
|
477
|
-
["resize-y", { resize: "vertical" }],
|
|
478
|
-
["resize", { resize: "both" }],
|
|
479
|
-
["resize-none", { resize: "none" }]
|
|
480
|
-
];
|
|
481
|
-
const userSelects = [
|
|
482
|
-
["select-auto", { "user-select": "auto" }],
|
|
483
|
-
["select-all", { "user-select": "all" }],
|
|
484
|
-
["select-text", { "user-select": "text" }],
|
|
485
|
-
["select-none", { "user-select": "none" }]
|
|
486
|
-
];
|
|
487
|
-
const whitespaces = [
|
|
488
|
-
[/^(?:whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap)$/, ([, v]) => ({ "white-space": v })]
|
|
489
|
-
];
|
|
490
|
-
const contents = [
|
|
491
|
-
["content-empty", { content: '""' }],
|
|
492
|
-
["content-none", { content: '""' }]
|
|
493
|
-
];
|
|
494
|
-
const breaks = [
|
|
495
|
-
["break-normal", { "overflow-wrap": "normal", "word-break": "normal" }],
|
|
496
|
-
["break-words", { "overflow-wrap": "break-word" }],
|
|
497
|
-
["break-all", { "word-break": "break-all" }]
|
|
498
|
-
];
|
|
499
|
-
const textOverflows = [
|
|
500
|
-
["truncate", { "overflow": "hidden", "text-overflow": "ellipsis", "white-space": "nowrap" }],
|
|
501
|
-
["text-ellipsis", { "text-overflow": "ellipsis" }],
|
|
502
|
-
["text-clip", { "text-overflow": "clip" }]
|
|
503
|
-
];
|
|
504
|
-
const textTransforms = [
|
|
505
|
-
["case-upper", { "text-transform": "uppercase" }],
|
|
506
|
-
["case-lower", { "text-transform": "lowercase" }],
|
|
507
|
-
["case-capital", { "text-transform": "capitalize" }],
|
|
508
|
-
["case-normal", { "text-transform": "none" }]
|
|
509
|
-
];
|
|
510
|
-
const fontStyles = [
|
|
511
|
-
["italic", { "font-style": "italic" }],
|
|
512
|
-
["not-italic", { "font-style": "normal" }]
|
|
513
|
-
];
|
|
514
|
-
const fontSmoothings = [
|
|
515
|
-
["antialiased", {
|
|
516
|
-
"-webkit-font-smoothing": "antialiased",
|
|
517
|
-
"-moz-osx-font-smoothing": "grayscale",
|
|
518
|
-
"font-smoothing": "grayscale"
|
|
519
|
-
}],
|
|
520
|
-
["subpixel-antialiased", {
|
|
521
|
-
"-webkit-font-smoothing": "auto",
|
|
522
|
-
"-moz-osx-font-smoothing": "auto",
|
|
523
|
-
"font-smoothing": "auto"
|
|
524
|
-
}]
|
|
525
|
-
];
|
|
526
|
-
|
|
527
|
-
const shadowBase = {
|
|
528
|
-
[CONTROL_SHORTCUT_NO_MERGE]: "",
|
|
529
|
-
"--un-ring-offset-shadow": "0 0 #0000",
|
|
530
|
-
"--un-ring-shadow": "0 0 #0000",
|
|
531
|
-
"--un-shadow-inset": varEmpty,
|
|
532
|
-
"--un-shadow": "0 0 #0000",
|
|
533
|
-
"--un-shadow-colored": "0 0 #0000"
|
|
534
|
-
};
|
|
535
|
-
const boxShadows = [
|
|
536
|
-
[/^shadow(?:-(.+))?$/, ([, d], { theme }) => {
|
|
537
|
-
const v = theme.boxShadow?.[d || "DEFAULT"];
|
|
538
|
-
if (v) {
|
|
539
|
-
const shadow = toArray(v);
|
|
540
|
-
const colored = shadow.map((s) => s.replace(/\s\S+$/, " var(--un-shadow-color)"));
|
|
541
|
-
return [
|
|
542
|
-
shadowBase,
|
|
543
|
-
{
|
|
544
|
-
"--un-shadow": shadow.join(","),
|
|
545
|
-
"--un-shadow-colored": colored.join(","),
|
|
546
|
-
"box-shadow": "var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow)"
|
|
547
|
-
}
|
|
548
|
-
];
|
|
549
|
-
}
|
|
550
|
-
}],
|
|
551
|
-
[/^shadow-(.+)$/, (m, ctx) => {
|
|
552
|
-
const color = colorResolver("--un-shadow-color", "shadow")(m, ctx);
|
|
553
|
-
if (color) {
|
|
554
|
-
return {
|
|
555
|
-
...color,
|
|
556
|
-
"--un-shadow": "var(--un-shadow-colored)"
|
|
557
|
-
};
|
|
558
|
-
}
|
|
559
|
-
}],
|
|
560
|
-
[/^shadow-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-shadow-opacity": handler.bracket.percent.cssvar(opacity) })],
|
|
561
|
-
["shadow-inset", { "--un-shadow-inset": "inset" }]
|
|
562
|
-
];
|
|
563
|
-
|
|
564
553
|
const ringBase = {
|
|
565
554
|
"--un-ring-inset": varEmpty,
|
|
566
555
|
"--un-ring-offset-width": "0px",
|
|
@@ -928,4 +917,4 @@ const rules = [
|
|
|
928
917
|
questionMark
|
|
929
918
|
].flat(1);
|
|
930
919
|
|
|
931
|
-
export {
|
|
920
|
+
export { textShadows as $, colorableShadows as A, boxShadows as B, sizes as C, aspectRatio as D, paddings as E, margins as F, varEmpty as G, displays as H, appearances as I, cursors as J, pointerEvents as K, resizes as L, userSelects as M, whitespaces as N, contents as O, breaks as P, textOverflows as Q, textTransforms as R, fontStyles as S, fontSmoothings as T, svgUtilities as U, transforms as V, transitions as W, fonts as X, tabSizes as Y, textIndents as Z, textStrokes as _, appearance as a, cssVariables as a0, cssProperty as a1, textDecorations as a2, borders as b, opacity as c, textColors as d, bgColors as e, flex as f, gaps as g, grids as h, overflows as i, justifies as j, orders as k, alignments as l, placements as m, insets as n, outline as o, positions as p, floats as q, rules as r, boxSizing as s, textAligns as t, questionMark as u, verticalAligns as v, willChange as w, rings as x, shadowBase as y, zIndexes as z };
|
package/dist/rules.cjs
CHANGED
|
@@ -17,6 +17,7 @@ exports.borders = _default.borders;
|
|
|
17
17
|
exports.boxShadows = _default.boxShadows;
|
|
18
18
|
exports.boxSizing = _default.boxSizing;
|
|
19
19
|
exports.breaks = _default.breaks;
|
|
20
|
+
exports.colorableShadows = _default.colorableShadows;
|
|
20
21
|
exports.contents = _default.contents;
|
|
21
22
|
exports.cssProperty = _default.cssProperty;
|
|
22
23
|
exports.cssVariables = _default.cssVariables;
|
package/dist/rules.d.ts
CHANGED
|
@@ -55,8 +55,8 @@ declare const shadowBase: {
|
|
|
55
55
|
'--un-ring-shadow': string;
|
|
56
56
|
'--un-shadow-inset': string;
|
|
57
57
|
'--un-shadow': string;
|
|
58
|
-
'--un-shadow-colored': string;
|
|
59
58
|
};
|
|
59
|
+
declare const colorableShadows: (shadows: string | string[], colorVar: string) => string[];
|
|
60
60
|
declare const boxShadows: Rule<Theme>[];
|
|
61
61
|
|
|
62
62
|
declare const sizes: Rule<Theme>[];
|
|
@@ -97,4 +97,4 @@ declare const cssProperty: Rule[];
|
|
|
97
97
|
|
|
98
98
|
declare const textDecorations: Rule[];
|
|
99
99
|
|
|
100
|
-
export { alignments, appearance, appearances, aspectRatio, bgColors, borders, boxShadows, boxSizing, breaks, contents, cssProperty, cssVariables, cursors, displays, flex, floats, fontSmoothings, fontStyles, fonts, gaps, grids, insets, justifies, margins, opacity, orders, outline, overflows, paddings, placements, pointerEvents, positions, questionMark, resizes, rings, rules, shadowBase, sizes, svgUtilities, tabSizes, textAligns, textColors, textDecorations, textIndents, textOverflows, textShadows, textStrokes, textTransforms, transforms, transitions, userSelects, varEmpty, verticalAligns, whitespaces, willChange, zIndexes };
|
|
100
|
+
export { alignments, appearance, appearances, aspectRatio, bgColors, borders, boxShadows, boxSizing, breaks, colorableShadows, contents, cssProperty, cssVariables, cursors, displays, flex, floats, fontSmoothings, fontStyles, fonts, gaps, grids, insets, justifies, margins, opacity, orders, outline, overflows, paddings, placements, pointerEvents, positions, questionMark, resizes, rings, rules, shadowBase, sizes, svgUtilities, tabSizes, textAligns, textColors, textDecorations, textIndents, textOverflows, textShadows, textStrokes, textTransforms, transforms, transitions, userSelects, varEmpty, verticalAligns, whitespaces, willChange, zIndexes };
|
package/dist/rules.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { l as alignments, a as appearance,
|
|
1
|
+
export { l as alignments, a as appearance, I as appearances, D as aspectRatio, e as bgColors, b as borders, B as boxShadows, s as boxSizing, P as breaks, A as colorableShadows, O as contents, a1 as cssProperty, a0 as cssVariables, J as cursors, H as displays, f as flex, q as floats, T as fontSmoothings, S as fontStyles, X as fonts, g as gaps, h as grids, n as insets, j as justifies, F as margins, c as opacity, k as orders, o as outline, i as overflows, E as paddings, m as placements, K as pointerEvents, p as positions, u as questionMark, L as resizes, x as rings, r as rules, y as shadowBase, C as sizes, U as svgUtilities, Y as tabSizes, t as textAligns, d as textColors, a2 as textDecorations, Z as textIndents, Q as textOverflows, $ as textShadows, _ as textStrokes, R as textTransforms, V as transforms, W as transitions, M as userSelects, G as varEmpty, v as verticalAligns, N as whitespaces, w as willChange, z as zIndexes } from './chunks/default2.mjs';
|
|
2
2
|
import './chunks/utilities.mjs';
|
|
3
3
|
import '@unocss/core';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-mini",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.2",
|
|
4
4
|
"description": "The minimal preset for UnoCSS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"unocss",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"*.css"
|
|
62
62
|
],
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@unocss/core": "0.22.
|
|
64
|
+
"@unocss/core": "0.22.2"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
67
|
"build": "unbuild",
|