@unocss/preset-wind 0.16.1 → 0.17.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 +195 -81
- package/dist/index.mjs +183 -69
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -158,25 +158,29 @@ const properties = {
|
|
|
158
158
|
"zoom-out-up": { "transform-origin": "center bottom" }
|
|
159
159
|
};
|
|
160
160
|
const animations = [
|
|
161
|
-
[/^animate-(
|
|
161
|
+
[/^animate-(.+)$/, ([, name], { constructCSS }) => {
|
|
162
162
|
const kf = keyframes[name];
|
|
163
163
|
if (kf) {
|
|
164
164
|
return `@keyframes ${name}${kf}
|
|
165
165
|
${constructCSS(Object.assign({ animation: `${name} ${durations[name] || "1s"} ${timingFns[name] || "linear"} infinite` }, properties[name]))}`;
|
|
166
166
|
}
|
|
167
167
|
}],
|
|
168
|
-
["animate-none", { animation: "none" }],
|
|
169
168
|
[/^animate(?:-duration)?-((.+)(?:(s|ms)?))$/, ([, d]) => ({ "animation-duration": utils.handler.bracket.time(d.replace(/-duration/, "")) })],
|
|
170
169
|
[/^animate-delay-((.+)(?:(s|ms)?))$/, ([, d]) => ({ "animation-delay": utils.handler.bracket.time(d) })],
|
|
171
|
-
[/^animate-(?:fill-)?mode-(
|
|
172
|
-
[
|
|
170
|
+
[/^animate-(?:fill-)?mode-(forwards|backwards|both|inherit|initial|revert|unset)$/, ([, d]) => ({ "animation-fill-mode": d })],
|
|
171
|
+
["animate-mode-none", { "animation-fill-mode": "none" }],
|
|
172
|
+
["animate-fill-mode-none", { "animation-fill-mode": "none" }],
|
|
173
|
+
[/^animate-(?:direction-)?(reverse|alternate|alternate-reverse|inherit|initial|revert|unset)$/, ([, d]) => ({ "animation-direction": d })],
|
|
174
|
+
["animate-normal", { "animation-direction": "normal" }],
|
|
175
|
+
["animate-direction-normal", { "animation-direction": "normal" }],
|
|
173
176
|
[/^animate-(?:iteration-)?count-(.+)$/, ([, d]) => ({ "animation-iteration-count": d.replace(/\-/g, ", ") })],
|
|
174
177
|
[/^animate-name-(.+)/, ([, d]) => ({ "animation-name": d })],
|
|
175
|
-
[/^animate-play(?:-state)?-(paused|running|inherit|initial|revert|unset)$/, ([, d]) => ({ "animation-play-state": d })]
|
|
178
|
+
[/^animate-play(?:-state)?-(paused|running|inherit|initial|revert|unset)$/, ([, d]) => ({ "animation-play-state": d })],
|
|
179
|
+
["animate-none", { animation: "none" }]
|
|
176
180
|
];
|
|
177
181
|
|
|
178
182
|
const colorResolver = (mode) => ([, body], { theme }) => {
|
|
179
|
-
const data =
|
|
183
|
+
const data = utils.parseColor(body, theme);
|
|
180
184
|
if (!data)
|
|
181
185
|
return;
|
|
182
186
|
const { opacity, color, rgba } = data;
|
|
@@ -208,11 +212,20 @@ const colorResolver = (mode) => ([, body], { theme }) => {
|
|
|
208
212
|
};
|
|
209
213
|
}
|
|
210
214
|
};
|
|
215
|
+
const bgGradientDirections = {
|
|
216
|
+
t: "top",
|
|
217
|
+
tr: "top right",
|
|
218
|
+
r: "right",
|
|
219
|
+
br: "bottom right",
|
|
220
|
+
b: "bottom",
|
|
221
|
+
bl: "bottom left",
|
|
222
|
+
l: "left",
|
|
223
|
+
tl: "top left"
|
|
224
|
+
};
|
|
211
225
|
const backgroundStyles = [
|
|
212
226
|
["bg-fixed", { "background-attachment": "fixed" }],
|
|
213
227
|
["bg-local", { "background-attachment": "local" }],
|
|
214
228
|
["bg-scroll", { "background-attachment": "scroll" }],
|
|
215
|
-
["bg-blend-normal", { "background-blend-mode": "normal" }],
|
|
216
229
|
["bg-blend-multiply", { "background-blend-mode": "multiply" }],
|
|
217
230
|
["bg-blend-screen", { "background-blend-mode": "screen" }],
|
|
218
231
|
["bg-blend-overlay", { "background-blend-mode": "overlay" }],
|
|
@@ -228,6 +241,7 @@ const backgroundStyles = [
|
|
|
228
241
|
["bg-blend-saturation", { "background-blend-mode": "saturation" }],
|
|
229
242
|
["bg-blend-color", { "background-blend-mode": "color" }],
|
|
230
243
|
["bg-blend-luminosity", { "background-blend-mode": "luminosity" }],
|
|
244
|
+
["bg-blend-normal", { "background-blend-mode": "normal" }],
|
|
231
245
|
["bg-clip-border", { "-webkit-background-clip": "border-box", "background-attachment": "border-box" }],
|
|
232
246
|
["bg-clip-content", { "-webkit-background-clip": "content-box", "background-attachment": "content-box" }],
|
|
233
247
|
["bg-clip-padding", { "-webkit-background-clip": "padding-box", "background-attachment": "padding-box" }],
|
|
@@ -235,34 +249,15 @@ const backgroundStyles = [
|
|
|
235
249
|
[/^from-(.+)$/, colorResolver("from")],
|
|
236
250
|
[/^to-(.+)$/, colorResolver("to")],
|
|
237
251
|
[/^via-(.+)$/, colorResolver("via")],
|
|
238
|
-
[/^from-op(?:acity)?-?(.+)
|
|
239
|
-
[/^to-op(?:acity)?-?(.+)
|
|
240
|
-
[/^via-op(?:acity)?-?(.+)
|
|
241
|
-
[
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
["bg-gradient-to-tr", {
|
|
246
|
-
"background-image": "linear-gradient(to top right, var(--un-gradient-stops))"
|
|
247
|
-
}],
|
|
248
|
-
["bg-gradient-to-r", {
|
|
249
|
-
"background-image": "linear-gradient(to right, var(--un-gradient-stops))"
|
|
250
|
-
}],
|
|
251
|
-
["bg-gradient-to-br", {
|
|
252
|
-
"background-image": "linear-gradient(to bottom right, var(--un-gradient-stops))"
|
|
253
|
-
}],
|
|
254
|
-
["bg-gradient-to-b", {
|
|
255
|
-
"background-image": "linear-gradient(to bottom, var(--un-gradient-stops))"
|
|
256
|
-
}],
|
|
257
|
-
["bg-gradient-to-bl", {
|
|
258
|
-
"background-image": "linear-gradient(to bottom left, var(--un-gradient-stops))"
|
|
259
|
-
}],
|
|
260
|
-
["bg-gradient-to-l", {
|
|
261
|
-
"background-image": "linear-gradient(to left, var(--un-gradient-stops))"
|
|
262
|
-
}],
|
|
263
|
-
["bg-gradient-to-tl", {
|
|
264
|
-
"background-image": "linear-gradient(to top left, var(--un-gradient-stops))"
|
|
252
|
+
[/^from-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-from-opacity": utils.handler.bracket.percent(opacity) })],
|
|
253
|
+
[/^to-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-to-opacity": utils.handler.bracket.percent(opacity) })],
|
|
254
|
+
[/^via-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-via-opacity": utils.handler.bracket.percent(opacity) })],
|
|
255
|
+
[/^bg-gradient-to-([trbl]{1,2})$/, ([, d]) => {
|
|
256
|
+
const v = bgGradientDirections[d];
|
|
257
|
+
if (v)
|
|
258
|
+
return { "background-image": `linear-gradient(to ${v}, var(--un-gradient-stops))` };
|
|
265
259
|
}],
|
|
260
|
+
["bg-none", { "background-image": "none" }],
|
|
266
261
|
["bg-origin-border", { "background-origin": "border-box" }],
|
|
267
262
|
["bg-origin-padding", { "background-origin": "padding-box" }],
|
|
268
263
|
["bg-origin-content", { "background-origin": "content-box" }],
|
|
@@ -286,36 +281,37 @@ const backgroundStyles = [
|
|
|
286
281
|
["bg-contain", { "background-size": "contain" }]
|
|
287
282
|
];
|
|
288
283
|
|
|
289
|
-
const listStyleProps = ["
|
|
284
|
+
const listStyleProps = ["disc", "circle", "square", "decimal", "zero-decimal", "greek", "roman", "upper-roman", "alpha", "upper-alpha"];
|
|
290
285
|
const listStyle = [
|
|
291
|
-
[new RegExp(`^list-((
|
|
286
|
+
[new RegExp(`^list-((?:${listStyleProps.join("|")})(?:-outside|-inside)?)$`), ([, value]) => {
|
|
292
287
|
const style = value.split(/-outside|-inside/)[0];
|
|
293
|
-
const position = /inside
|
|
288
|
+
const position = /outside|inside/.exec(value) ?? [];
|
|
294
289
|
if (position.length) {
|
|
295
290
|
return {
|
|
296
291
|
"list-style-position": `${position[0]}`,
|
|
297
|
-
"list-style-type":
|
|
292
|
+
"list-style-type": style
|
|
298
293
|
};
|
|
299
294
|
}
|
|
300
|
-
return {
|
|
301
|
-
"list-style-type": `${style}`
|
|
302
|
-
};
|
|
295
|
+
return { "list-style-type": style };
|
|
303
296
|
}],
|
|
304
|
-
[/^list-(inside
|
|
305
|
-
|
|
306
|
-
"list-style-position": value
|
|
307
|
-
};
|
|
308
|
-
}]
|
|
297
|
+
[/^list-(outside|inside)$/, ([, value]) => ({ "list-style-position": value })],
|
|
298
|
+
["list-none", { "list-style-type": "none" }]
|
|
309
299
|
];
|
|
310
300
|
const boxDecorationBreaks = [
|
|
311
301
|
["decoration-slice", { "box-decoration-break": "slice" }],
|
|
312
302
|
["decoration-clone", { "box-decoration-break": "clone" }]
|
|
313
303
|
];
|
|
304
|
+
const accentOpacity = [
|
|
305
|
+
[/^accent-op(?:acity)?-?(.+)$/, ([, d]) => ({ "--un-accent-opacity": utils.handler.bracket.percent(d) })]
|
|
306
|
+
];
|
|
307
|
+
const accentColors = [
|
|
308
|
+
[/^accent-(.+)$/, utils.colorResolver("accent-color", "accent")]
|
|
309
|
+
];
|
|
314
310
|
const caretOpacity = [
|
|
315
311
|
[/^caret-op(?:acity)?-?(.+)$/, ([, d]) => ({ "--un-caret-opacity": utils.handler.bracket.percent(d) })]
|
|
316
312
|
];
|
|
317
313
|
const caretColors = [
|
|
318
|
-
[/^caret-(.+)$/,
|
|
314
|
+
[/^caret-(.+)$/, utils.colorResolver("caret-color", "caret")]
|
|
319
315
|
];
|
|
320
316
|
const imageRenderings = [
|
|
321
317
|
["image-render-auto", { "image-rendering": "auto" }],
|
|
@@ -329,7 +325,6 @@ const imageRenderings = [
|
|
|
329
325
|
]]
|
|
330
326
|
];
|
|
331
327
|
const overflowValues = [
|
|
332
|
-
"none",
|
|
333
328
|
"auto",
|
|
334
329
|
"hidden",
|
|
335
330
|
"visible",
|
|
@@ -338,7 +333,42 @@ const overflowValues = [
|
|
|
338
333
|
];
|
|
339
334
|
const overscrolls = [
|
|
340
335
|
[/^overscroll-(.+)$/, ([, v]) => overflowValues.includes(v) ? { "overscroll-behavior": v } : void 0],
|
|
341
|
-
[
|
|
336
|
+
["overscroll-none", { "overscroll-behavior": "none" }],
|
|
337
|
+
[/^overscroll-([xy])-(.+)$/, ([, d, v]) => overflowValues.includes(v) ? { [`overscroll-behavior-${d}`]: v } : void 0],
|
|
338
|
+
["overscroll-x-none", { "overscroll-behavior-x": "none" }],
|
|
339
|
+
["overscroll-y-none", { "overscroll-behavior-y": "none" }]
|
|
340
|
+
];
|
|
341
|
+
const scrollBehaviors = [
|
|
342
|
+
["scroll-auto", { "scroll-behavior": "auto" }],
|
|
343
|
+
["scroll-smooth", { "scroll-behavior": "smooth" }]
|
|
344
|
+
];
|
|
345
|
+
|
|
346
|
+
const columns = [
|
|
347
|
+
[/^columns-(.+)$/, ([, v]) => {
|
|
348
|
+
const column = utils.handler.bracket.global.number.auto.numberWithUnit(v);
|
|
349
|
+
if (column)
|
|
350
|
+
return { column };
|
|
351
|
+
}],
|
|
352
|
+
["break-before-auto", { "break-before": "auto" }],
|
|
353
|
+
["break-before-avoid", { "break-before": "avoid" }],
|
|
354
|
+
["break-before-all", { "break-before": "all" }],
|
|
355
|
+
["break-before-avoid-page", { "break-before": "avoid-page" }],
|
|
356
|
+
["break-before-page", { "break-before": "page" }],
|
|
357
|
+
["break-before-left", { "break-before": "left" }],
|
|
358
|
+
["break-before-right", { "break-before": "right" }],
|
|
359
|
+
["break-before-column", { "break-before": "column" }],
|
|
360
|
+
["break-inside-auto", { "break-inside": "auto" }],
|
|
361
|
+
["break-inside-avoid", { "break-inside": "avoid" }],
|
|
362
|
+
["break-inside-avoid-page", { "break-inside": "avoid-page" }],
|
|
363
|
+
["break-inside-avoid-column", { "break-inside": "avoid-column" }],
|
|
364
|
+
["break-after-auto", { "break-after": "auto" }],
|
|
365
|
+
["break-after-avoid", { "break-after": "avoid" }],
|
|
366
|
+
["break-after-all", { "break-after": "all" }],
|
|
367
|
+
["break-after-avoid-page", { "break-after": "avoid-page" }],
|
|
368
|
+
["break-after-page", { "break-after": "page" }],
|
|
369
|
+
["break-after-left", { "break-after": "left" }],
|
|
370
|
+
["break-after-right", { "break-after": "right" }],
|
|
371
|
+
["break-after-column", { "break-after": "column" }]
|
|
342
372
|
];
|
|
343
373
|
|
|
344
374
|
const queryMatcher = /@media \(min-width: (.+)\)/;
|
|
@@ -375,34 +405,33 @@ const containerShortcuts = [
|
|
|
375
405
|
}]
|
|
376
406
|
];
|
|
377
407
|
|
|
378
|
-
const varEmpty = "var(--un-empty,/*!*/ /*!*/)";
|
|
379
408
|
const filterContnet = "var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia) var(--un-drop-shadow)";
|
|
380
409
|
const filterBase = {
|
|
381
|
-
"--un-blur": varEmpty,
|
|
382
|
-
"--un-brightness": varEmpty,
|
|
383
|
-
"--un-contrast": varEmpty,
|
|
384
|
-
"--un-grayscale": varEmpty,
|
|
385
|
-
"--un-hue-rotate": varEmpty,
|
|
386
|
-
"--un-invert": varEmpty,
|
|
387
|
-
"--un-saturate": varEmpty,
|
|
388
|
-
"--un-sepia": varEmpty,
|
|
389
|
-
"--un-drop-shadow": varEmpty,
|
|
410
|
+
"--un-blur": rules$1.varEmpty,
|
|
411
|
+
"--un-brightness": rules$1.varEmpty,
|
|
412
|
+
"--un-contrast": rules$1.varEmpty,
|
|
413
|
+
"--un-grayscale": rules$1.varEmpty,
|
|
414
|
+
"--un-hue-rotate": rules$1.varEmpty,
|
|
415
|
+
"--un-invert": rules$1.varEmpty,
|
|
416
|
+
"--un-saturate": rules$1.varEmpty,
|
|
417
|
+
"--un-sepia": rules$1.varEmpty,
|
|
418
|
+
"--un-drop-shadow": rules$1.varEmpty,
|
|
390
419
|
"filter": filterContnet,
|
|
391
|
-
[variants.
|
|
420
|
+
[variants.CONTROL_BYPASS_PSEUDO_CLASS]: ""
|
|
392
421
|
};
|
|
393
422
|
const backdropFilterContent = "var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-saturate) var(--un-backdrop-sepia)";
|
|
394
423
|
const backdropFilterBase = {
|
|
395
|
-
"--un-backdrop-blur": varEmpty,
|
|
396
|
-
"--un-backdrop-brightness": varEmpty,
|
|
397
|
-
"--un-backdrop-contrast": varEmpty,
|
|
398
|
-
"--un-backdrop-grayscale": varEmpty,
|
|
399
|
-
"--un-backdrop-hue-rotate": varEmpty,
|
|
400
|
-
"--un-backdrop-invert": varEmpty,
|
|
401
|
-
"--un-backdrop-saturate": varEmpty,
|
|
402
|
-
"--un-backdrop-sepia": varEmpty,
|
|
424
|
+
"--un-backdrop-blur": rules$1.varEmpty,
|
|
425
|
+
"--un-backdrop-brightness": rules$1.varEmpty,
|
|
426
|
+
"--un-backdrop-contrast": rules$1.varEmpty,
|
|
427
|
+
"--un-backdrop-grayscale": rules$1.varEmpty,
|
|
428
|
+
"--un-backdrop-hue-rotate": rules$1.varEmpty,
|
|
429
|
+
"--un-backdrop-invert": rules$1.varEmpty,
|
|
430
|
+
"--un-backdrop-saturate": rules$1.varEmpty,
|
|
431
|
+
"--un-backdrop-sepia": rules$1.varEmpty,
|
|
403
432
|
"-webkit-backdrop-filter": backdropFilterContent,
|
|
404
433
|
"backdrop-filter": backdropFilterContent,
|
|
405
|
-
[variants.
|
|
434
|
+
[variants.CONTROL_BYPASS_PSEUDO_CLASS]: ""
|
|
406
435
|
};
|
|
407
436
|
const percentWithDefault = (defaultValue = "1") => (str) => {
|
|
408
437
|
const v = str ? utils.handler.bracket.percent(str) : defaultValue;
|
|
@@ -441,7 +470,6 @@ const filters = [
|
|
|
441
470
|
];
|
|
442
471
|
|
|
443
472
|
const mixBlendModes = [
|
|
444
|
-
["mix-blend-normal", { "mix-blend-mode": "normal" }],
|
|
445
473
|
["mix-blend-multiply", { "mix-blend-mode": "multiply" }],
|
|
446
474
|
["mix-blend-screen", { "mix-blend-mode": "screen" }],
|
|
447
475
|
["mix-blend-overlay", { "mix-blend-mode": "overlay" }],
|
|
@@ -456,20 +484,16 @@ const mixBlendModes = [
|
|
|
456
484
|
["mix-blend-hue", { "mix-blend-mode": "hue" }],
|
|
457
485
|
["mix-blend-saturation", { "mix-blend-mode": "saturation" }],
|
|
458
486
|
["mix-blend-color", { "mix-blend-mode": "color" }],
|
|
459
|
-
["mix-blend-luminosity", { "mix-blend-mode": "luminosity" }]
|
|
487
|
+
["mix-blend-luminosity", { "mix-blend-mode": "luminosity" }],
|
|
488
|
+
["mix-blend-normal", { "mix-blend-mode": "normal" }]
|
|
460
489
|
];
|
|
461
490
|
|
|
462
|
-
const directionSize = (prefix) => ([_, direction, size]) => {
|
|
463
|
-
const v = utils.handler.bracket.rem.fraction.cssvar(size);
|
|
464
|
-
if (v)
|
|
465
|
-
return utils.directionMap[direction].map((i) => [prefix + i, v]);
|
|
466
|
-
};
|
|
467
491
|
const spaces = [
|
|
468
492
|
[/^space-?([xy])-?(-?.+)$/, (match) => {
|
|
469
493
|
const [, direction, size] = match;
|
|
470
494
|
if (size === "reverse")
|
|
471
495
|
return { [`--un-space-${direction}-reverse`]: 1 };
|
|
472
|
-
const results = directionSize("margin")(match)?.map((item) => {
|
|
496
|
+
const results = utils.directionSize("margin")(match)?.map((item) => {
|
|
473
497
|
const value = item[0].endsWith("right") || item[0].endsWith("bottom") ? `calc(${item[1]} * var(--un-space-${direction}-reverse))` : `calc(${item[1]} * calc(1 - var(--un-space-${direction}-reverse)))`;
|
|
474
498
|
return [item[0], value];
|
|
475
499
|
});
|
|
@@ -614,8 +638,8 @@ const cssVariables = [[
|
|
|
614
638
|
]];
|
|
615
639
|
|
|
616
640
|
const divideColors = [
|
|
617
|
-
[/^divide-(.+)$/,
|
|
618
|
-
[/^divide-op(?:acity)?-?(.+)
|
|
641
|
+
[/^divide-(.+)$/, utils.colorResolver("border-color", "divide")],
|
|
642
|
+
[/^divide-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-divide-opacity": utils.handler.bracket.percent(opacity) })]
|
|
619
643
|
];
|
|
620
644
|
const divideSizes = [
|
|
621
645
|
[/^divide-?([xy])$/, handlerDivide],
|
|
@@ -665,7 +689,7 @@ const fontVariantNumericBase = {
|
|
|
665
689
|
"--un-numeric-spacing": rules$1.varEmpty,
|
|
666
690
|
"--un-numeric-fraction": rules$1.varEmpty,
|
|
667
691
|
"font-variant-numeric": "var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)",
|
|
668
|
-
[variants.
|
|
692
|
+
[variants.CONTROL_BYPASS_PSEUDO_CLASS]: ""
|
|
669
693
|
};
|
|
670
694
|
const fontVariantNumeric = [
|
|
671
695
|
[/^ordinal$/, () => [fontVariantNumericBase, { "--un-ordinal": "ordinal" }]],
|
|
@@ -679,6 +703,67 @@ const fontVariantNumeric = [
|
|
|
679
703
|
["normal-nums", { "font-variant-numeric": "normal" }]
|
|
680
704
|
];
|
|
681
705
|
|
|
706
|
+
const touchActionBase = {
|
|
707
|
+
"--un-pan-x": rules$1.varEmpty,
|
|
708
|
+
"--un-pan-y": rules$1.varEmpty,
|
|
709
|
+
"--un-pinch-zoom": rules$1.varEmpty,
|
|
710
|
+
"--un-touch-action": "var(--un-pan-x) var(--un-pan-y) var(--un-pinch-zoom)",
|
|
711
|
+
[variants.CONTROL_BYPASS_PSEUDO_CLASS]: ""
|
|
712
|
+
};
|
|
713
|
+
const touchActions = [
|
|
714
|
+
[/^touch-pan-(x|left|right)$/, ([, d]) => [
|
|
715
|
+
touchActionBase,
|
|
716
|
+
{
|
|
717
|
+
"--un-pan-x": `pan-${d}`,
|
|
718
|
+
"touch-action": "var(--un-touch-action)"
|
|
719
|
+
}
|
|
720
|
+
]],
|
|
721
|
+
[/^touch-pan-(y|up|down)$/, ([, d]) => [
|
|
722
|
+
touchActionBase,
|
|
723
|
+
{
|
|
724
|
+
"--un-pan-y": `pan-${d}`,
|
|
725
|
+
"touch-action": "var(--un-touch-action)"
|
|
726
|
+
}
|
|
727
|
+
]],
|
|
728
|
+
[/^touch-pinch-zoom$/, () => [
|
|
729
|
+
touchActionBase,
|
|
730
|
+
{
|
|
731
|
+
"--un-pinch-zoom": "pinch-zoom",
|
|
732
|
+
"touch-action": "var(--un-touch-action)"
|
|
733
|
+
}
|
|
734
|
+
]],
|
|
735
|
+
["touch-auto", { "touch-action": "auto" }],
|
|
736
|
+
["touch-manipulation", { "touch-action": "manipulation" }],
|
|
737
|
+
["touch-none", { "touch-action": "none" }]
|
|
738
|
+
];
|
|
739
|
+
|
|
740
|
+
const scrolls = [
|
|
741
|
+
[/^snap-(x|y|base)$/, ([, d]) => [
|
|
742
|
+
{
|
|
743
|
+
"--un-scroll-snap-strictness": "proximity",
|
|
744
|
+
[variants.CONTROL_BYPASS_PSEUDO_CLASS]: ""
|
|
745
|
+
},
|
|
746
|
+
{
|
|
747
|
+
"scroll-snap-type": `${d} var(--un-scroll-snap-strictness)`
|
|
748
|
+
}
|
|
749
|
+
]],
|
|
750
|
+
["snap-mandatory", { "--un-scroll-snap-strictness": "mandatory" }],
|
|
751
|
+
["snap-proximity", { "--un-scroll-snap-strictness": "proximity" }],
|
|
752
|
+
["snap-none", { "scroll-snap-type": "none" }],
|
|
753
|
+
["snap-start", { "scroll-snap-align": "start" }],
|
|
754
|
+
["snap-end", { "scroll-snap-align": "end" }],
|
|
755
|
+
["snap-center", { "scroll-snap-align": "center" }],
|
|
756
|
+
["snap-align-none", { "scroll-snap-align": "none" }],
|
|
757
|
+
["snap-normal", { "scroll-snap-stop": "normal" }],
|
|
758
|
+
["snap-always", { "scroll-snap-stop": "always" }],
|
|
759
|
+
[/^scroll-ma?()-?(-?.+)$/, utils.directionSize("scroll-margin")],
|
|
760
|
+
[/^scroll-m-?([xy])-?(-?.+)$/, utils.directionSize("scroll-margin")],
|
|
761
|
+
[/^scroll-m-?([rltb])-?(-?.+)$/, utils.directionSize("scroll-margin")],
|
|
762
|
+
[/^scroll-pa?()-?(-?.+)$/, utils.directionSize("scroll-padding")],
|
|
763
|
+
[/^scroll-p-?([xy])-?(-?.+)$/, utils.directionSize("scroll-padding")],
|
|
764
|
+
[/^scroll-p-?([rltb])-?(-?.+)$/, utils.directionSize("scroll-padding")]
|
|
765
|
+
];
|
|
766
|
+
|
|
682
767
|
const rules = [
|
|
683
768
|
rules$1.cssVariables,
|
|
684
769
|
cssVariables,
|
|
@@ -704,10 +789,13 @@ const rules = [
|
|
|
704
789
|
rules$1.transforms,
|
|
705
790
|
animations,
|
|
706
791
|
rules$1.cursors,
|
|
792
|
+
touchActions,
|
|
707
793
|
rules$1.userSelects,
|
|
708
794
|
rules$1.resizes,
|
|
795
|
+
scrolls,
|
|
709
796
|
listStyle,
|
|
710
797
|
rules$1.appearance,
|
|
798
|
+
columns,
|
|
711
799
|
rules$1.placements,
|
|
712
800
|
rules$1.alignments,
|
|
713
801
|
rules$1.justifies,
|
|
@@ -716,6 +804,7 @@ const rules = [
|
|
|
716
804
|
divides,
|
|
717
805
|
rules$1.overflows,
|
|
718
806
|
overscrolls,
|
|
807
|
+
scrollBehaviors,
|
|
719
808
|
rules$1.textOverflows,
|
|
720
809
|
rules$1.whitespaces,
|
|
721
810
|
rules$1.breaks,
|
|
@@ -723,7 +812,7 @@ const rules = [
|
|
|
723
812
|
rules$1.bgColors,
|
|
724
813
|
boxDecorationBreaks,
|
|
725
814
|
backgroundStyles,
|
|
726
|
-
rules$1.
|
|
815
|
+
rules$1.svgUtilities,
|
|
727
816
|
objectPositions,
|
|
728
817
|
rules$1.paddings,
|
|
729
818
|
rules$1.textAligns,
|
|
@@ -745,6 +834,8 @@ const rules = [
|
|
|
745
834
|
rules$1.placeholder,
|
|
746
835
|
caretColors,
|
|
747
836
|
caretOpacity,
|
|
837
|
+
accentColors,
|
|
838
|
+
accentOpacity,
|
|
748
839
|
rules$1.opacity,
|
|
749
840
|
mixBlendModes,
|
|
750
841
|
rules$1.boxShadows,
|
|
@@ -753,10 +844,32 @@ const rules = [
|
|
|
753
844
|
imageRenderings,
|
|
754
845
|
filters,
|
|
755
846
|
rules$1.transitions,
|
|
847
|
+
rules$1.willChange,
|
|
756
848
|
rules$1.contents,
|
|
757
849
|
rules$1.questionMark
|
|
758
850
|
].flat(1);
|
|
759
851
|
|
|
852
|
+
const variantColorsScheme = [
|
|
853
|
+
utils.variantMatcher("\\.dark", (input) => `.dark $$ ${input}`),
|
|
854
|
+
utils.variantMatcher("\\.light", (input) => `.light $$ ${input}`),
|
|
855
|
+
(v) => {
|
|
856
|
+
const dark = utils.variantMatcher("@dark")(v);
|
|
857
|
+
if (dark) {
|
|
858
|
+
return {
|
|
859
|
+
...dark,
|
|
860
|
+
parent: "@media (prefers-color-scheme: dark)"
|
|
861
|
+
};
|
|
862
|
+
}
|
|
863
|
+
const light = utils.variantMatcher("@light")(v);
|
|
864
|
+
if (light) {
|
|
865
|
+
return {
|
|
866
|
+
...light,
|
|
867
|
+
parent: "@media (prefers-color-scheme: light)"
|
|
868
|
+
};
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
];
|
|
872
|
+
|
|
760
873
|
const presetWind = (options = {}) => ({
|
|
761
874
|
name: "@unocss/preset-wind",
|
|
762
875
|
theme: theme.theme,
|
|
@@ -766,6 +879,7 @@ const presetWind = (options = {}) => ({
|
|
|
766
879
|
],
|
|
767
880
|
variants: [
|
|
768
881
|
...variants.variants,
|
|
882
|
+
...variantColorsScheme,
|
|
769
883
|
...options.dark === "media" ? variants.variantColorsMedia : variants.variantColorsClass
|
|
770
884
|
],
|
|
771
885
|
options
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { theme } from '@unocss/preset-mini/theme';
|
|
2
|
-
import {
|
|
2
|
+
import { CONTROL_BYPASS_PSEUDO_CLASS, variants, variantColorsMedia, variantColorsClass } from '@unocss/preset-mini/variants';
|
|
3
3
|
import { toArray } from '@unocss/core';
|
|
4
4
|
export { colors, theme } from '@unocss/preset-mini';
|
|
5
|
-
import {
|
|
6
|
-
import { handler, directionMap } from '@unocss/preset-mini/utils';
|
|
5
|
+
import { varEmpty, cssVariables as cssVariables$1, pointerEvents, appearances, positions, insets, zIndexes, orders, grids, floats, margins, boxSizing, displays, aspectRatio, sizes, flex, transforms, cursors, userSelects, resizes, appearance, placements, alignments, justifies, gaps, overflows, textOverflows, whitespaces, breaks, borders, bgColors, svgUtilities, paddings, textAligns, textIndents, verticalAligns, fonts, fontStyles, textColors, textDecorations, fontSmoothings, tabSizes, textStrokes, textShadows, placeholder, opacity, boxShadows, outline, rings, transitions, willChange, contents, questionMark } from '@unocss/preset-mini/rules';
|
|
6
|
+
import { handler, parseColor, colorResolver as colorResolver$1, directionSize, directionMap, variantMatcher } from '@unocss/preset-mini/utils';
|
|
7
7
|
|
|
8
8
|
const keyframes = {
|
|
9
9
|
"pulse": "{0%, 100% {opacity:1} 50% {opacity:.5}}",
|
|
@@ -154,25 +154,29 @@ const properties = {
|
|
|
154
154
|
"zoom-out-up": { "transform-origin": "center bottom" }
|
|
155
155
|
};
|
|
156
156
|
const animations = [
|
|
157
|
-
[/^animate-(
|
|
157
|
+
[/^animate-(.+)$/, ([, name], { constructCSS }) => {
|
|
158
158
|
const kf = keyframes[name];
|
|
159
159
|
if (kf) {
|
|
160
160
|
return `@keyframes ${name}${kf}
|
|
161
161
|
${constructCSS(Object.assign({ animation: `${name} ${durations[name] || "1s"} ${timingFns[name] || "linear"} infinite` }, properties[name]))}`;
|
|
162
162
|
}
|
|
163
163
|
}],
|
|
164
|
-
["animate-none", { animation: "none" }],
|
|
165
164
|
[/^animate(?:-duration)?-((.+)(?:(s|ms)?))$/, ([, d]) => ({ "animation-duration": handler.bracket.time(d.replace(/-duration/, "")) })],
|
|
166
165
|
[/^animate-delay-((.+)(?:(s|ms)?))$/, ([, d]) => ({ "animation-delay": handler.bracket.time(d) })],
|
|
167
|
-
[/^animate-(?:fill-)?mode-(
|
|
168
|
-
[
|
|
166
|
+
[/^animate-(?:fill-)?mode-(forwards|backwards|both|inherit|initial|revert|unset)$/, ([, d]) => ({ "animation-fill-mode": d })],
|
|
167
|
+
["animate-mode-none", { "animation-fill-mode": "none" }],
|
|
168
|
+
["animate-fill-mode-none", { "animation-fill-mode": "none" }],
|
|
169
|
+
[/^animate-(?:direction-)?(reverse|alternate|alternate-reverse|inherit|initial|revert|unset)$/, ([, d]) => ({ "animation-direction": d })],
|
|
170
|
+
["animate-normal", { "animation-direction": "normal" }],
|
|
171
|
+
["animate-direction-normal", { "animation-direction": "normal" }],
|
|
169
172
|
[/^animate-(?:iteration-)?count-(.+)$/, ([, d]) => ({ "animation-iteration-count": d.replace(/\-/g, ", ") })],
|
|
170
173
|
[/^animate-name-(.+)/, ([, d]) => ({ "animation-name": d })],
|
|
171
|
-
[/^animate-play(?:-state)?-(paused|running|inherit|initial|revert|unset)$/, ([, d]) => ({ "animation-play-state": d })]
|
|
174
|
+
[/^animate-play(?:-state)?-(paused|running|inherit|initial|revert|unset)$/, ([, d]) => ({ "animation-play-state": d })],
|
|
175
|
+
["animate-none", { animation: "none" }]
|
|
172
176
|
];
|
|
173
177
|
|
|
174
178
|
const colorResolver = (mode) => ([, body], { theme }) => {
|
|
175
|
-
const data =
|
|
179
|
+
const data = parseColor(body, theme);
|
|
176
180
|
if (!data)
|
|
177
181
|
return;
|
|
178
182
|
const { opacity, color, rgba } = data;
|
|
@@ -204,11 +208,20 @@ const colorResolver = (mode) => ([, body], { theme }) => {
|
|
|
204
208
|
};
|
|
205
209
|
}
|
|
206
210
|
};
|
|
211
|
+
const bgGradientDirections = {
|
|
212
|
+
t: "top",
|
|
213
|
+
tr: "top right",
|
|
214
|
+
r: "right",
|
|
215
|
+
br: "bottom right",
|
|
216
|
+
b: "bottom",
|
|
217
|
+
bl: "bottom left",
|
|
218
|
+
l: "left",
|
|
219
|
+
tl: "top left"
|
|
220
|
+
};
|
|
207
221
|
const backgroundStyles = [
|
|
208
222
|
["bg-fixed", { "background-attachment": "fixed" }],
|
|
209
223
|
["bg-local", { "background-attachment": "local" }],
|
|
210
224
|
["bg-scroll", { "background-attachment": "scroll" }],
|
|
211
|
-
["bg-blend-normal", { "background-blend-mode": "normal" }],
|
|
212
225
|
["bg-blend-multiply", { "background-blend-mode": "multiply" }],
|
|
213
226
|
["bg-blend-screen", { "background-blend-mode": "screen" }],
|
|
214
227
|
["bg-blend-overlay", { "background-blend-mode": "overlay" }],
|
|
@@ -224,6 +237,7 @@ const backgroundStyles = [
|
|
|
224
237
|
["bg-blend-saturation", { "background-blend-mode": "saturation" }],
|
|
225
238
|
["bg-blend-color", { "background-blend-mode": "color" }],
|
|
226
239
|
["bg-blend-luminosity", { "background-blend-mode": "luminosity" }],
|
|
240
|
+
["bg-blend-normal", { "background-blend-mode": "normal" }],
|
|
227
241
|
["bg-clip-border", { "-webkit-background-clip": "border-box", "background-attachment": "border-box" }],
|
|
228
242
|
["bg-clip-content", { "-webkit-background-clip": "content-box", "background-attachment": "content-box" }],
|
|
229
243
|
["bg-clip-padding", { "-webkit-background-clip": "padding-box", "background-attachment": "padding-box" }],
|
|
@@ -231,34 +245,15 @@ const backgroundStyles = [
|
|
|
231
245
|
[/^from-(.+)$/, colorResolver("from")],
|
|
232
246
|
[/^to-(.+)$/, colorResolver("to")],
|
|
233
247
|
[/^via-(.+)$/, colorResolver("via")],
|
|
234
|
-
[/^from-op(?:acity)?-?(.+)
|
|
235
|
-
[/^to-op(?:acity)?-?(.+)
|
|
236
|
-
[/^via-op(?:acity)?-?(.+)
|
|
237
|
-
[
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
["bg-gradient-to-tr", {
|
|
242
|
-
"background-image": "linear-gradient(to top right, var(--un-gradient-stops))"
|
|
243
|
-
}],
|
|
244
|
-
["bg-gradient-to-r", {
|
|
245
|
-
"background-image": "linear-gradient(to right, var(--un-gradient-stops))"
|
|
246
|
-
}],
|
|
247
|
-
["bg-gradient-to-br", {
|
|
248
|
-
"background-image": "linear-gradient(to bottom right, var(--un-gradient-stops))"
|
|
249
|
-
}],
|
|
250
|
-
["bg-gradient-to-b", {
|
|
251
|
-
"background-image": "linear-gradient(to bottom, var(--un-gradient-stops))"
|
|
252
|
-
}],
|
|
253
|
-
["bg-gradient-to-bl", {
|
|
254
|
-
"background-image": "linear-gradient(to bottom left, var(--un-gradient-stops))"
|
|
255
|
-
}],
|
|
256
|
-
["bg-gradient-to-l", {
|
|
257
|
-
"background-image": "linear-gradient(to left, var(--un-gradient-stops))"
|
|
258
|
-
}],
|
|
259
|
-
["bg-gradient-to-tl", {
|
|
260
|
-
"background-image": "linear-gradient(to top left, var(--un-gradient-stops))"
|
|
248
|
+
[/^from-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-from-opacity": handler.bracket.percent(opacity) })],
|
|
249
|
+
[/^to-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-to-opacity": handler.bracket.percent(opacity) })],
|
|
250
|
+
[/^via-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-via-opacity": handler.bracket.percent(opacity) })],
|
|
251
|
+
[/^bg-gradient-to-([trbl]{1,2})$/, ([, d]) => {
|
|
252
|
+
const v = bgGradientDirections[d];
|
|
253
|
+
if (v)
|
|
254
|
+
return { "background-image": `linear-gradient(to ${v}, var(--un-gradient-stops))` };
|
|
261
255
|
}],
|
|
256
|
+
["bg-none", { "background-image": "none" }],
|
|
262
257
|
["bg-origin-border", { "background-origin": "border-box" }],
|
|
263
258
|
["bg-origin-padding", { "background-origin": "padding-box" }],
|
|
264
259
|
["bg-origin-content", { "background-origin": "content-box" }],
|
|
@@ -282,31 +277,32 @@ const backgroundStyles = [
|
|
|
282
277
|
["bg-contain", { "background-size": "contain" }]
|
|
283
278
|
];
|
|
284
279
|
|
|
285
|
-
const listStyleProps = ["
|
|
280
|
+
const listStyleProps = ["disc", "circle", "square", "decimal", "zero-decimal", "greek", "roman", "upper-roman", "alpha", "upper-alpha"];
|
|
286
281
|
const listStyle = [
|
|
287
|
-
[new RegExp(`^list-((
|
|
282
|
+
[new RegExp(`^list-((?:${listStyleProps.join("|")})(?:-outside|-inside)?)$`), ([, value]) => {
|
|
288
283
|
const style = value.split(/-outside|-inside/)[0];
|
|
289
|
-
const position = /inside
|
|
284
|
+
const position = /outside|inside/.exec(value) ?? [];
|
|
290
285
|
if (position.length) {
|
|
291
286
|
return {
|
|
292
287
|
"list-style-position": `${position[0]}`,
|
|
293
|
-
"list-style-type":
|
|
288
|
+
"list-style-type": style
|
|
294
289
|
};
|
|
295
290
|
}
|
|
296
|
-
return {
|
|
297
|
-
"list-style-type": `${style}`
|
|
298
|
-
};
|
|
291
|
+
return { "list-style-type": style };
|
|
299
292
|
}],
|
|
300
|
-
[/^list-(inside
|
|
301
|
-
|
|
302
|
-
"list-style-position": value
|
|
303
|
-
};
|
|
304
|
-
}]
|
|
293
|
+
[/^list-(outside|inside)$/, ([, value]) => ({ "list-style-position": value })],
|
|
294
|
+
["list-none", { "list-style-type": "none" }]
|
|
305
295
|
];
|
|
306
296
|
const boxDecorationBreaks = [
|
|
307
297
|
["decoration-slice", { "box-decoration-break": "slice" }],
|
|
308
298
|
["decoration-clone", { "box-decoration-break": "clone" }]
|
|
309
299
|
];
|
|
300
|
+
const accentOpacity = [
|
|
301
|
+
[/^accent-op(?:acity)?-?(.+)$/, ([, d]) => ({ "--un-accent-opacity": handler.bracket.percent(d) })]
|
|
302
|
+
];
|
|
303
|
+
const accentColors = [
|
|
304
|
+
[/^accent-(.+)$/, colorResolver$1("accent-color", "accent")]
|
|
305
|
+
];
|
|
310
306
|
const caretOpacity = [
|
|
311
307
|
[/^caret-op(?:acity)?-?(.+)$/, ([, d]) => ({ "--un-caret-opacity": handler.bracket.percent(d) })]
|
|
312
308
|
];
|
|
@@ -325,7 +321,6 @@ const imageRenderings = [
|
|
|
325
321
|
]]
|
|
326
322
|
];
|
|
327
323
|
const overflowValues = [
|
|
328
|
-
"none",
|
|
329
324
|
"auto",
|
|
330
325
|
"hidden",
|
|
331
326
|
"visible",
|
|
@@ -334,7 +329,42 @@ const overflowValues = [
|
|
|
334
329
|
];
|
|
335
330
|
const overscrolls = [
|
|
336
331
|
[/^overscroll-(.+)$/, ([, v]) => overflowValues.includes(v) ? { "overscroll-behavior": v } : void 0],
|
|
337
|
-
[
|
|
332
|
+
["overscroll-none", { "overscroll-behavior": "none" }],
|
|
333
|
+
[/^overscroll-([xy])-(.+)$/, ([, d, v]) => overflowValues.includes(v) ? { [`overscroll-behavior-${d}`]: v } : void 0],
|
|
334
|
+
["overscroll-x-none", { "overscroll-behavior-x": "none" }],
|
|
335
|
+
["overscroll-y-none", { "overscroll-behavior-y": "none" }]
|
|
336
|
+
];
|
|
337
|
+
const scrollBehaviors = [
|
|
338
|
+
["scroll-auto", { "scroll-behavior": "auto" }],
|
|
339
|
+
["scroll-smooth", { "scroll-behavior": "smooth" }]
|
|
340
|
+
];
|
|
341
|
+
|
|
342
|
+
const columns = [
|
|
343
|
+
[/^columns-(.+)$/, ([, v]) => {
|
|
344
|
+
const column = handler.bracket.global.number.auto.numberWithUnit(v);
|
|
345
|
+
if (column)
|
|
346
|
+
return { column };
|
|
347
|
+
}],
|
|
348
|
+
["break-before-auto", { "break-before": "auto" }],
|
|
349
|
+
["break-before-avoid", { "break-before": "avoid" }],
|
|
350
|
+
["break-before-all", { "break-before": "all" }],
|
|
351
|
+
["break-before-avoid-page", { "break-before": "avoid-page" }],
|
|
352
|
+
["break-before-page", { "break-before": "page" }],
|
|
353
|
+
["break-before-left", { "break-before": "left" }],
|
|
354
|
+
["break-before-right", { "break-before": "right" }],
|
|
355
|
+
["break-before-column", { "break-before": "column" }],
|
|
356
|
+
["break-inside-auto", { "break-inside": "auto" }],
|
|
357
|
+
["break-inside-avoid", { "break-inside": "avoid" }],
|
|
358
|
+
["break-inside-avoid-page", { "break-inside": "avoid-page" }],
|
|
359
|
+
["break-inside-avoid-column", { "break-inside": "avoid-column" }],
|
|
360
|
+
["break-after-auto", { "break-after": "auto" }],
|
|
361
|
+
["break-after-avoid", { "break-after": "avoid" }],
|
|
362
|
+
["break-after-all", { "break-after": "all" }],
|
|
363
|
+
["break-after-avoid-page", { "break-after": "avoid-page" }],
|
|
364
|
+
["break-after-page", { "break-after": "page" }],
|
|
365
|
+
["break-after-left", { "break-after": "left" }],
|
|
366
|
+
["break-after-right", { "break-after": "right" }],
|
|
367
|
+
["break-after-column", { "break-after": "column" }]
|
|
338
368
|
];
|
|
339
369
|
|
|
340
370
|
const queryMatcher = /@media \(min-width: (.+)\)/;
|
|
@@ -371,7 +401,6 @@ const containerShortcuts = [
|
|
|
371
401
|
}]
|
|
372
402
|
];
|
|
373
403
|
|
|
374
|
-
const varEmpty = "var(--un-empty,/*!*/ /*!*/)";
|
|
375
404
|
const filterContnet = "var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia) var(--un-drop-shadow)";
|
|
376
405
|
const filterBase = {
|
|
377
406
|
"--un-blur": varEmpty,
|
|
@@ -384,7 +413,7 @@ const filterBase = {
|
|
|
384
413
|
"--un-sepia": varEmpty,
|
|
385
414
|
"--un-drop-shadow": varEmpty,
|
|
386
415
|
"filter": filterContnet,
|
|
387
|
-
[
|
|
416
|
+
[CONTROL_BYPASS_PSEUDO_CLASS]: ""
|
|
388
417
|
};
|
|
389
418
|
const backdropFilterContent = "var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-saturate) var(--un-backdrop-sepia)";
|
|
390
419
|
const backdropFilterBase = {
|
|
@@ -398,7 +427,7 @@ const backdropFilterBase = {
|
|
|
398
427
|
"--un-backdrop-sepia": varEmpty,
|
|
399
428
|
"-webkit-backdrop-filter": backdropFilterContent,
|
|
400
429
|
"backdrop-filter": backdropFilterContent,
|
|
401
|
-
[
|
|
430
|
+
[CONTROL_BYPASS_PSEUDO_CLASS]: ""
|
|
402
431
|
};
|
|
403
432
|
const percentWithDefault = (defaultValue = "1") => (str) => {
|
|
404
433
|
const v = str ? handler.bracket.percent(str) : defaultValue;
|
|
@@ -437,7 +466,6 @@ const filters = [
|
|
|
437
466
|
];
|
|
438
467
|
|
|
439
468
|
const mixBlendModes = [
|
|
440
|
-
["mix-blend-normal", { "mix-blend-mode": "normal" }],
|
|
441
469
|
["mix-blend-multiply", { "mix-blend-mode": "multiply" }],
|
|
442
470
|
["mix-blend-screen", { "mix-blend-mode": "screen" }],
|
|
443
471
|
["mix-blend-overlay", { "mix-blend-mode": "overlay" }],
|
|
@@ -452,14 +480,10 @@ const mixBlendModes = [
|
|
|
452
480
|
["mix-blend-hue", { "mix-blend-mode": "hue" }],
|
|
453
481
|
["mix-blend-saturation", { "mix-blend-mode": "saturation" }],
|
|
454
482
|
["mix-blend-color", { "mix-blend-mode": "color" }],
|
|
455
|
-
["mix-blend-luminosity", { "mix-blend-mode": "luminosity" }]
|
|
483
|
+
["mix-blend-luminosity", { "mix-blend-mode": "luminosity" }],
|
|
484
|
+
["mix-blend-normal", { "mix-blend-mode": "normal" }]
|
|
456
485
|
];
|
|
457
486
|
|
|
458
|
-
const directionSize = (prefix) => ([_, direction, size]) => {
|
|
459
|
-
const v = handler.bracket.rem.fraction.cssvar(size);
|
|
460
|
-
if (v)
|
|
461
|
-
return directionMap[direction].map((i) => [prefix + i, v]);
|
|
462
|
-
};
|
|
463
487
|
const spaces = [
|
|
464
488
|
[/^space-?([xy])-?(-?.+)$/, (match) => {
|
|
465
489
|
const [, direction, size] = match;
|
|
@@ -611,7 +635,7 @@ const cssVariables = [[
|
|
|
611
635
|
|
|
612
636
|
const divideColors = [
|
|
613
637
|
[/^divide-(.+)$/, colorResolver$1("border-color", "divide")],
|
|
614
|
-
[/^divide-op(?:acity)?-?(.+)
|
|
638
|
+
[/^divide-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-divide-opacity": handler.bracket.percent(opacity) })]
|
|
615
639
|
];
|
|
616
640
|
const divideSizes = [
|
|
617
641
|
[/^divide-?([xy])$/, handlerDivide],
|
|
@@ -655,13 +679,13 @@ const lineClamps = [
|
|
|
655
679
|
];
|
|
656
680
|
|
|
657
681
|
const fontVariantNumericBase = {
|
|
658
|
-
"--un-ordinal": varEmpty
|
|
659
|
-
"--un-slashed-zero": varEmpty
|
|
660
|
-
"--un-numeric-figure": varEmpty
|
|
661
|
-
"--un-numeric-spacing": varEmpty
|
|
662
|
-
"--un-numeric-fraction": varEmpty
|
|
682
|
+
"--un-ordinal": varEmpty,
|
|
683
|
+
"--un-slashed-zero": varEmpty,
|
|
684
|
+
"--un-numeric-figure": varEmpty,
|
|
685
|
+
"--un-numeric-spacing": varEmpty,
|
|
686
|
+
"--un-numeric-fraction": varEmpty,
|
|
663
687
|
"font-variant-numeric": "var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)",
|
|
664
|
-
[
|
|
688
|
+
[CONTROL_BYPASS_PSEUDO_CLASS]: ""
|
|
665
689
|
};
|
|
666
690
|
const fontVariantNumeric = [
|
|
667
691
|
[/^ordinal$/, () => [fontVariantNumericBase, { "--un-ordinal": "ordinal" }]],
|
|
@@ -675,6 +699,67 @@ const fontVariantNumeric = [
|
|
|
675
699
|
["normal-nums", { "font-variant-numeric": "normal" }]
|
|
676
700
|
];
|
|
677
701
|
|
|
702
|
+
const touchActionBase = {
|
|
703
|
+
"--un-pan-x": varEmpty,
|
|
704
|
+
"--un-pan-y": varEmpty,
|
|
705
|
+
"--un-pinch-zoom": varEmpty,
|
|
706
|
+
"--un-touch-action": "var(--un-pan-x) var(--un-pan-y) var(--un-pinch-zoom)",
|
|
707
|
+
[CONTROL_BYPASS_PSEUDO_CLASS]: ""
|
|
708
|
+
};
|
|
709
|
+
const touchActions = [
|
|
710
|
+
[/^touch-pan-(x|left|right)$/, ([, d]) => [
|
|
711
|
+
touchActionBase,
|
|
712
|
+
{
|
|
713
|
+
"--un-pan-x": `pan-${d}`,
|
|
714
|
+
"touch-action": "var(--un-touch-action)"
|
|
715
|
+
}
|
|
716
|
+
]],
|
|
717
|
+
[/^touch-pan-(y|up|down)$/, ([, d]) => [
|
|
718
|
+
touchActionBase,
|
|
719
|
+
{
|
|
720
|
+
"--un-pan-y": `pan-${d}`,
|
|
721
|
+
"touch-action": "var(--un-touch-action)"
|
|
722
|
+
}
|
|
723
|
+
]],
|
|
724
|
+
[/^touch-pinch-zoom$/, () => [
|
|
725
|
+
touchActionBase,
|
|
726
|
+
{
|
|
727
|
+
"--un-pinch-zoom": "pinch-zoom",
|
|
728
|
+
"touch-action": "var(--un-touch-action)"
|
|
729
|
+
}
|
|
730
|
+
]],
|
|
731
|
+
["touch-auto", { "touch-action": "auto" }],
|
|
732
|
+
["touch-manipulation", { "touch-action": "manipulation" }],
|
|
733
|
+
["touch-none", { "touch-action": "none" }]
|
|
734
|
+
];
|
|
735
|
+
|
|
736
|
+
const scrolls = [
|
|
737
|
+
[/^snap-(x|y|base)$/, ([, d]) => [
|
|
738
|
+
{
|
|
739
|
+
"--un-scroll-snap-strictness": "proximity",
|
|
740
|
+
[CONTROL_BYPASS_PSEUDO_CLASS]: ""
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
"scroll-snap-type": `${d} var(--un-scroll-snap-strictness)`
|
|
744
|
+
}
|
|
745
|
+
]],
|
|
746
|
+
["snap-mandatory", { "--un-scroll-snap-strictness": "mandatory" }],
|
|
747
|
+
["snap-proximity", { "--un-scroll-snap-strictness": "proximity" }],
|
|
748
|
+
["snap-none", { "scroll-snap-type": "none" }],
|
|
749
|
+
["snap-start", { "scroll-snap-align": "start" }],
|
|
750
|
+
["snap-end", { "scroll-snap-align": "end" }],
|
|
751
|
+
["snap-center", { "scroll-snap-align": "center" }],
|
|
752
|
+
["snap-align-none", { "scroll-snap-align": "none" }],
|
|
753
|
+
["snap-normal", { "scroll-snap-stop": "normal" }],
|
|
754
|
+
["snap-always", { "scroll-snap-stop": "always" }],
|
|
755
|
+
[/^scroll-ma?()-?(-?.+)$/, directionSize("scroll-margin")],
|
|
756
|
+
[/^scroll-m-?([xy])-?(-?.+)$/, directionSize("scroll-margin")],
|
|
757
|
+
[/^scroll-m-?([rltb])-?(-?.+)$/, directionSize("scroll-margin")],
|
|
758
|
+
[/^scroll-pa?()-?(-?.+)$/, directionSize("scroll-padding")],
|
|
759
|
+
[/^scroll-p-?([xy])-?(-?.+)$/, directionSize("scroll-padding")],
|
|
760
|
+
[/^scroll-p-?([rltb])-?(-?.+)$/, directionSize("scroll-padding")]
|
|
761
|
+
];
|
|
762
|
+
|
|
678
763
|
const rules = [
|
|
679
764
|
cssVariables$1,
|
|
680
765
|
cssVariables,
|
|
@@ -700,10 +785,13 @@ const rules = [
|
|
|
700
785
|
transforms,
|
|
701
786
|
animations,
|
|
702
787
|
cursors,
|
|
788
|
+
touchActions,
|
|
703
789
|
userSelects,
|
|
704
790
|
resizes,
|
|
791
|
+
scrolls,
|
|
705
792
|
listStyle,
|
|
706
793
|
appearance,
|
|
794
|
+
columns,
|
|
707
795
|
placements,
|
|
708
796
|
alignments,
|
|
709
797
|
justifies,
|
|
@@ -712,6 +800,7 @@ const rules = [
|
|
|
712
800
|
divides,
|
|
713
801
|
overflows,
|
|
714
802
|
overscrolls,
|
|
803
|
+
scrollBehaviors,
|
|
715
804
|
textOverflows,
|
|
716
805
|
whitespaces,
|
|
717
806
|
breaks,
|
|
@@ -719,7 +808,7 @@ const rules = [
|
|
|
719
808
|
bgColors,
|
|
720
809
|
boxDecorationBreaks,
|
|
721
810
|
backgroundStyles,
|
|
722
|
-
|
|
811
|
+
svgUtilities,
|
|
723
812
|
objectPositions,
|
|
724
813
|
paddings,
|
|
725
814
|
textAligns,
|
|
@@ -741,6 +830,8 @@ const rules = [
|
|
|
741
830
|
placeholder,
|
|
742
831
|
caretColors,
|
|
743
832
|
caretOpacity,
|
|
833
|
+
accentColors,
|
|
834
|
+
accentOpacity,
|
|
744
835
|
opacity,
|
|
745
836
|
mixBlendModes,
|
|
746
837
|
boxShadows,
|
|
@@ -749,10 +840,32 @@ const rules = [
|
|
|
749
840
|
imageRenderings,
|
|
750
841
|
filters,
|
|
751
842
|
transitions,
|
|
843
|
+
willChange,
|
|
752
844
|
contents,
|
|
753
845
|
questionMark
|
|
754
846
|
].flat(1);
|
|
755
847
|
|
|
848
|
+
const variantColorsScheme = [
|
|
849
|
+
variantMatcher("\\.dark", (input) => `.dark $$ ${input}`),
|
|
850
|
+
variantMatcher("\\.light", (input) => `.light $$ ${input}`),
|
|
851
|
+
(v) => {
|
|
852
|
+
const dark = variantMatcher("@dark")(v);
|
|
853
|
+
if (dark) {
|
|
854
|
+
return {
|
|
855
|
+
...dark,
|
|
856
|
+
parent: "@media (prefers-color-scheme: dark)"
|
|
857
|
+
};
|
|
858
|
+
}
|
|
859
|
+
const light = variantMatcher("@light")(v);
|
|
860
|
+
if (light) {
|
|
861
|
+
return {
|
|
862
|
+
...light,
|
|
863
|
+
parent: "@media (prefers-color-scheme: light)"
|
|
864
|
+
};
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
];
|
|
868
|
+
|
|
756
869
|
const presetWind = (options = {}) => ({
|
|
757
870
|
name: "@unocss/preset-wind",
|
|
758
871
|
theme,
|
|
@@ -762,6 +875,7 @@ const presetWind = (options = {}) => ({
|
|
|
762
875
|
],
|
|
763
876
|
variants: [
|
|
764
877
|
...variants,
|
|
878
|
+
...variantColorsScheme,
|
|
765
879
|
...options.dark === "media" ? variantColorsMedia : variantColorsClass
|
|
766
880
|
],
|
|
767
881
|
options
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-wind",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.2",
|
|
4
4
|
"description": "Tailwind / Windi CSS compact preset for UnoCSS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"unocss",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"*.css"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@unocss/core": "0.
|
|
39
|
-
"@unocss/preset-mini": "0.
|
|
38
|
+
"@unocss/core": "0.17.2",
|
|
39
|
+
"@unocss/preset-mini": "0.17.2"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "unbuild",
|