@unocss/preset-wind 0.35.3 → 0.37.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/dist/index.cjs +70 -102
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +71 -103
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
const presetMini = require('@unocss/preset-mini');
|
|
5
6
|
const core = require('@unocss/core');
|
|
6
7
|
const utils = require('@unocss/preset-mini/utils');
|
|
7
|
-
const theme$1 = require('@unocss/preset-mini/theme');
|
|
8
|
-
const presetMini = require('@unocss/preset-mini');
|
|
9
8
|
const rules$1 = require('@unocss/preset-mini/rules');
|
|
9
|
+
const theme$1 = require('@unocss/preset-mini/theme');
|
|
10
10
|
const variants$1 = require('@unocss/preset-mini/variants');
|
|
11
11
|
|
|
12
12
|
const animations = [
|
|
@@ -297,8 +297,7 @@ const filterBase = {
|
|
|
297
297
|
"--un-invert": rules$1.varEmpty,
|
|
298
298
|
"--un-saturate": rules$1.varEmpty,
|
|
299
299
|
"--un-sepia": rules$1.varEmpty,
|
|
300
|
-
"--un-filter": "var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia)"
|
|
301
|
-
[core.CONTROL_SHORTCUT_NO_MERGE]: ""
|
|
300
|
+
"--un-filter": "var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia)"
|
|
302
301
|
};
|
|
303
302
|
const backdropFilterBase = {
|
|
304
303
|
"--un-backdrop-blur": rules$1.varEmpty,
|
|
@@ -310,8 +309,7 @@ const backdropFilterBase = {
|
|
|
310
309
|
"--un-backdrop-opacity": rules$1.varEmpty,
|
|
311
310
|
"--un-backdrop-saturate": rules$1.varEmpty,
|
|
312
311
|
"--un-backdrop-sepia": rules$1.varEmpty,
|
|
313
|
-
"--un-backdrop-filter": "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-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia)"
|
|
314
|
-
[core.CONTROL_SHORTCUT_NO_MERGE]: ""
|
|
312
|
+
"--un-backdrop-filter": "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-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia)"
|
|
315
313
|
};
|
|
316
314
|
const percentWithDefault = (str) => {
|
|
317
315
|
let v = utils.handler.bracket.cssvar(str || "");
|
|
@@ -325,22 +323,16 @@ const toFilter = (varName, resolver) => ([, b, s], { theme }) => {
|
|
|
325
323
|
const value = resolver(s, theme) ?? (s === "none" ? "0" : "");
|
|
326
324
|
if (value !== "") {
|
|
327
325
|
if (b) {
|
|
328
|
-
return
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
"backdrop-filter": "var(--un-backdrop-filter)"
|
|
334
|
-
}
|
|
335
|
-
];
|
|
326
|
+
return {
|
|
327
|
+
[`--un-${b}${varName}`]: `${varName}(${value})`,
|
|
328
|
+
"-webkit-backdrop-filter": "var(--un-backdrop-filter)",
|
|
329
|
+
"backdrop-filter": "var(--un-backdrop-filter)"
|
|
330
|
+
};
|
|
336
331
|
} else {
|
|
337
|
-
return
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
filter: "var(--un-filter)"
|
|
342
|
-
}
|
|
343
|
-
];
|
|
332
|
+
return {
|
|
333
|
+
[`--un-${varName}`]: `${varName}(${value})`,
|
|
334
|
+
filter: "var(--un-filter)"
|
|
335
|
+
};
|
|
344
336
|
}
|
|
345
337
|
}
|
|
346
338
|
};
|
|
@@ -348,23 +340,17 @@ const dropShadowResolver = ([, s], { theme }) => {
|
|
|
348
340
|
let v = theme.dropShadow?.[s || "DEFAULT"];
|
|
349
341
|
if (v != null) {
|
|
350
342
|
const shadows = utils.colorableShadows(v, "--un-drop-shadow-color");
|
|
351
|
-
return
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
"filter": "var(--un-filter)"
|
|
356
|
-
}
|
|
357
|
-
];
|
|
343
|
+
return {
|
|
344
|
+
"--un-drop-shadow": `drop-shadow(${shadows.join(") drop-shadow(")})`,
|
|
345
|
+
"filter": "var(--un-filter)"
|
|
346
|
+
};
|
|
358
347
|
}
|
|
359
348
|
v = utils.handler.bracket.cssvar(s);
|
|
360
349
|
if (v != null) {
|
|
361
|
-
return
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
"filter": "var(--un-filter)"
|
|
366
|
-
}
|
|
367
|
-
];
|
|
350
|
+
return {
|
|
351
|
+
"--un-drop-shadow": `drop-shadow(${v})`,
|
|
352
|
+
"filter": "var(--un-filter)"
|
|
353
|
+
};
|
|
368
354
|
}
|
|
369
355
|
};
|
|
370
356
|
const filters = [
|
|
@@ -390,33 +376,17 @@ const filters = [
|
|
|
390
376
|
}],
|
|
391
377
|
[/^(?:filter-)?drop-shadow-color-(.+)$/, utils.colorResolver("--un-drop-shadow-color", "drop-shadow")],
|
|
392
378
|
[/^(?:filter-)?drop-shadow-color-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-drop-shadow-opacity": utils.handler.bracket.percent(opacity) })],
|
|
393
|
-
[/^(?:(backdrop-)|filter-)?grayscale(?:-(.+))?$/, toFilter("grayscale", percentWithDefault), {
|
|
394
|
-
autocomplete: ["(backdrop|filter)-grayscale", "(backdrop|filter)-grayscale-<percent>", "grayscale-<percent>"]
|
|
395
|
-
}],
|
|
379
|
+
[/^(?:(backdrop-)|filter-)?grayscale(?:-(.+))?$/, toFilter("grayscale", percentWithDefault), { autocomplete: ["(backdrop|filter)-grayscale", "(backdrop|filter)-grayscale-<percent>", "grayscale-<percent>"] }],
|
|
396
380
|
[/^(?:(backdrop-)|filter-)?hue-rotate-(.+)$/, toFilter("hue-rotate", (s) => utils.handler.bracket.cssvar.degree(s))],
|
|
397
|
-
[/^(?:(backdrop-)|filter-)?invert(?:-(.+))?$/, toFilter("invert", percentWithDefault), {
|
|
398
|
-
|
|
381
|
+
[/^(?:(backdrop-)|filter-)?invert(?:-(.+))?$/, toFilter("invert", percentWithDefault), { autocomplete: ["(backdrop|filter)-invert", "(backdrop|filter)-invert-<percent>", "invert-<percent>"] }],
|
|
382
|
+
[/^(backdrop-)op(?:acity)-(.+)$/, toFilter("opacity", (s) => utils.handler.bracket.cssvar.percent(s)), { autocomplete: ["backdrop-(op|opacity)", "backdrop-(op|opacity)-<percent>"] }],
|
|
383
|
+
[/^(?:(backdrop-)|filter-)?saturate-(.+)$/, toFilter("saturate", (s) => utils.handler.bracket.cssvar.percent(s)), { autocomplete: ["(backdrop|filter)-saturate", "(backdrop|filter)-saturate-<percent>", "saturate-<percent>"] }],
|
|
384
|
+
[/^(?:(backdrop-)|filter-)?sepia(?:-(.+))?$/, toFilter("sepia", percentWithDefault), { autocomplete: ["(backdrop|filter)-sepia", "(backdrop|filter)-sepia-<percent>", "sepia-<percent>"] }],
|
|
385
|
+
["filter", { filter: "var(--un-filter)" }],
|
|
386
|
+
["backdrop-filter", {
|
|
387
|
+
"-webkit-backdrop-filter": "var(--un-backdrop-filter)",
|
|
388
|
+
"backdrop-filter": "var(--un-backdrop-filter)"
|
|
399
389
|
}],
|
|
400
|
-
[/^(backdrop-)op(?:acity)-(.+)$/, toFilter("opacity", (s) => utils.handler.bracket.cssvar.percent(s)), {
|
|
401
|
-
autocomplete: ["backdrop-(op|opacity)", "backdrop-(op|opacity)-<percent>"]
|
|
402
|
-
}],
|
|
403
|
-
[/^(?:(backdrop-)|filter-)?saturate-(.+)$/, toFilter("saturate", (s) => utils.handler.bracket.cssvar.percent(s)), {
|
|
404
|
-
autocomplete: ["(backdrop|filter)-saturate", "(backdrop|filter)-saturate-<percent>", "saturate-<percent>"]
|
|
405
|
-
}],
|
|
406
|
-
[/^(?:(backdrop-)|filter-)?sepia(?:-(.+))?$/, toFilter("sepia", percentWithDefault), {
|
|
407
|
-
autocomplete: ["(backdrop|filter)-sepia", "(backdrop|filter)-sepia-<percent>", "sepia-<percent>"]
|
|
408
|
-
}],
|
|
409
|
-
[/^filter$/, () => [
|
|
410
|
-
filterBase,
|
|
411
|
-
{ filter: "var(--un-filter)" }
|
|
412
|
-
]],
|
|
413
|
-
[/^backdrop-filter$/, () => [
|
|
414
|
-
backdropFilterBase,
|
|
415
|
-
{
|
|
416
|
-
"-webkit-backdrop-filter": "var(--un-backdrop-filter)",
|
|
417
|
-
"backdrop-filter": "var(--un-backdrop-filter)"
|
|
418
|
-
}
|
|
419
|
-
], { autocomplete: "backdrop-filter" }],
|
|
420
390
|
["filter-none", { filter: "none" }],
|
|
421
391
|
["backdrop-filter-none", {
|
|
422
392
|
"-webkit-backdrop-filter": "none",
|
|
@@ -657,16 +627,12 @@ const fontVariantNumericBase = {
|
|
|
657
627
|
"--un-numeric-figure": rules$1.varEmpty,
|
|
658
628
|
"--un-numeric-spacing": rules$1.varEmpty,
|
|
659
629
|
"--un-numeric-fraction": rules$1.varEmpty,
|
|
660
|
-
"--un-font-variant-numeric": "var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)"
|
|
661
|
-
[core.CONTROL_SHORTCUT_NO_MERGE]: ""
|
|
630
|
+
"--un-font-variant-numeric": "var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)"
|
|
662
631
|
};
|
|
663
|
-
const toEntries = (entry) =>
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
"font-variant-numeric": "var(--un-font-variant-numeric)"
|
|
668
|
-
}
|
|
669
|
-
];
|
|
632
|
+
const toEntries = (entry) => ({
|
|
633
|
+
...entry,
|
|
634
|
+
"font-variant-numeric": "var(--un-font-variant-numeric)"
|
|
635
|
+
});
|
|
670
636
|
const fontVariantNumeric = [
|
|
671
637
|
[/^ordinal$/, () => toEntries({ "--un-ordinal": "ordinal" }), { autocomplete: "ordinal" }],
|
|
672
638
|
[/^slashed-zero$/, () => toEntries({ "--un-slashed-zero": "slashed-zero" }), { autocomplete: "slashed-zero" }],
|
|
@@ -683,46 +649,36 @@ const touchActionBase = {
|
|
|
683
649
|
"--un-pan-x": rules$1.varEmpty,
|
|
684
650
|
"--un-pan-y": rules$1.varEmpty,
|
|
685
651
|
"--un-pinch-zoom": rules$1.varEmpty,
|
|
686
|
-
"--un-touch-action": "var(--un-pan-x) var(--un-pan-y) var(--un-pinch-zoom)"
|
|
687
|
-
[core.CONTROL_SHORTCUT_NO_MERGE]: ""
|
|
652
|
+
"--un-touch-action": "var(--un-pan-x) var(--un-pan-y) var(--un-pinch-zoom)"
|
|
688
653
|
};
|
|
689
654
|
const touchActions = [
|
|
690
|
-
[/^touch-pan-(x|left|right)$/, ([, d]) =>
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
}
|
|
703
|
-
]],
|
|
704
|
-
[/^touch-pinch-zoom$/, () => [
|
|
705
|
-
touchActionBase,
|
|
706
|
-
{
|
|
707
|
-
"--un-pinch-zoom": "pinch-zoom",
|
|
708
|
-
"touch-action": "var(--un-touch-action)"
|
|
709
|
-
}
|
|
710
|
-
], { autocomplete: ["touch-pinch", "touch-pinch-zoom"] }],
|
|
655
|
+
[/^touch-pan-(x|left|right)$/, ([, d]) => ({
|
|
656
|
+
"--un-pan-x": `pan-${d}`,
|
|
657
|
+
"touch-action": "var(--un-touch-action)"
|
|
658
|
+
}), { autocomplete: ["touch-pan", "touch-pan-(x|left|right|y|up|down)"] }],
|
|
659
|
+
[/^touch-pan-(y|up|down)$/, ([, d]) => ({
|
|
660
|
+
"--un-pan-y": `pan-${d}`,
|
|
661
|
+
"touch-action": "var(--un-touch-action)"
|
|
662
|
+
})],
|
|
663
|
+
["touch-pinch-zoom", {
|
|
664
|
+
"--un-pinch-zoom": "pinch-zoom",
|
|
665
|
+
"touch-action": "var(--un-touch-action)"
|
|
666
|
+
}],
|
|
711
667
|
["touch-auto", { "touch-action": "auto" }],
|
|
712
668
|
["touch-manipulation", { "touch-action": "manipulation" }],
|
|
713
669
|
["touch-none", { "touch-action": "none" }]
|
|
714
670
|
];
|
|
715
671
|
|
|
672
|
+
const scrollSnapTypeBase = {
|
|
673
|
+
"--un-scroll-snap-strictness": "proximity"
|
|
674
|
+
};
|
|
716
675
|
const scrolls = [
|
|
717
|
-
[/^snap-(x|y
|
|
718
|
-
{
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
"scroll-snap-type": `${d} var(--un-scroll-snap-strictness)`
|
|
724
|
-
}
|
|
725
|
-
], { autocomplete: "snap-(x|y|both)" }],
|
|
676
|
+
[/^snap-(x|y)$/, ([, d]) => ({
|
|
677
|
+
"scroll-snap-type": `${d} var(--un-scroll-snap-strictness)`
|
|
678
|
+
}), { autocomplete: "snap-(x|y|both)" }],
|
|
679
|
+
[/^snap-both$/, () => ({
|
|
680
|
+
"scroll-snap-type": "both var(--un-scroll-snap-strictness)"
|
|
681
|
+
})],
|
|
726
682
|
["snap-mandatory", { "--un-scroll-snap-strictness": "mandatory" }],
|
|
727
683
|
["snap-proximity", { "--un-scroll-snap-strictness": "proximity" }],
|
|
728
684
|
["snap-none", { "scroll-snap-type": "none" }],
|
|
@@ -1015,6 +971,16 @@ const theme = {
|
|
|
1015
971
|
pointer: "(hover) and (pointer: coarse)",
|
|
1016
972
|
mouse: "(hover) and (pointer: fine)",
|
|
1017
973
|
hd_color: "(dynamic-range: high)"
|
|
974
|
+
},
|
|
975
|
+
preflightBase: {
|
|
976
|
+
...rules$1.transformBase,
|
|
977
|
+
...touchActionBase,
|
|
978
|
+
...scrollSnapTypeBase,
|
|
979
|
+
...fontVariantNumericBase,
|
|
980
|
+
...rules$1.boxShadowsBase,
|
|
981
|
+
...rules$1.ringBase,
|
|
982
|
+
...filterBase,
|
|
983
|
+
...backdropFilterBase
|
|
1018
984
|
}
|
|
1019
985
|
};
|
|
1020
986
|
|
|
@@ -1091,11 +1057,13 @@ const presetWind = (options = {}) => {
|
|
|
1091
1057
|
rules,
|
|
1092
1058
|
shortcuts,
|
|
1093
1059
|
variants: variants(options),
|
|
1094
|
-
options
|
|
1060
|
+
options,
|
|
1061
|
+
preflights: presetMini.preflights
|
|
1095
1062
|
};
|
|
1096
1063
|
};
|
|
1097
1064
|
|
|
1098
1065
|
exports.colors = presetMini.colors;
|
|
1066
|
+
exports.preflights = presetMini.preflights;
|
|
1099
1067
|
exports["default"] = presetWind;
|
|
1100
1068
|
exports.presetWind = presetWind;
|
|
1101
1069
|
exports.rules = rules;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as _unocss_core from '@unocss/core';
|
|
|
2
2
|
import { Rule, Variant, Preset } from '@unocss/core';
|
|
3
3
|
import * as _unocss_preset_mini from '@unocss/preset-mini';
|
|
4
4
|
import { Theme, PresetMiniOptions } from '@unocss/preset-mini';
|
|
5
|
-
export { Theme, colors } from '@unocss/preset-mini';
|
|
5
|
+
export { Theme, colors, preflights } from '@unocss/preset-mini';
|
|
6
6
|
|
|
7
7
|
declare const rules: Rule[];
|
|
8
8
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { preflights } from '@unocss/preset-mini';
|
|
2
|
+
export { colors, preflights } from '@unocss/preset-mini';
|
|
3
|
+
import { toArray } from '@unocss/core';
|
|
2
4
|
import { handler, positionMap, parseColor, colorToString, colorResolver, resolveBreakpoints, colorableShadows, directionMap, directionSize, variantMatcher, variantParentMatcher, hasParseableColor } from '@unocss/preset-mini/utils';
|
|
5
|
+
import { varEmpty, cssVariables as cssVariables$1, cssProperty, 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, textTransforms as textTransforms$1, fontStyles, textColors, textDecorations, fontSmoothings, tabSizes, textStrokes, textShadows, opacity, boxShadows, outline, rings, transitions, willChange, contents, questionMark, transformBase, boxShadowsBase, ringBase } from '@unocss/preset-mini/rules';
|
|
3
6
|
import { theme as theme$1 } from '@unocss/preset-mini/theme';
|
|
4
|
-
export { colors } from '@unocss/preset-mini';
|
|
5
|
-
import { varEmpty, cssVariables as cssVariables$1, cssProperty, 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, textTransforms as textTransforms$1, fontStyles, textColors, textDecorations, fontSmoothings, tabSizes, textStrokes, textShadows, opacity, boxShadows, outline, rings, transitions, willChange, contents, questionMark } from '@unocss/preset-mini/rules';
|
|
6
7
|
import { variants as variants$1 } from '@unocss/preset-mini/variants';
|
|
7
8
|
|
|
8
9
|
const animations = [
|
|
@@ -293,8 +294,7 @@ const filterBase = {
|
|
|
293
294
|
"--un-invert": varEmpty,
|
|
294
295
|
"--un-saturate": varEmpty,
|
|
295
296
|
"--un-sepia": varEmpty,
|
|
296
|
-
"--un-filter": "var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia)"
|
|
297
|
-
[CONTROL_SHORTCUT_NO_MERGE]: ""
|
|
297
|
+
"--un-filter": "var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia)"
|
|
298
298
|
};
|
|
299
299
|
const backdropFilterBase = {
|
|
300
300
|
"--un-backdrop-blur": varEmpty,
|
|
@@ -306,8 +306,7 @@ const backdropFilterBase = {
|
|
|
306
306
|
"--un-backdrop-opacity": varEmpty,
|
|
307
307
|
"--un-backdrop-saturate": varEmpty,
|
|
308
308
|
"--un-backdrop-sepia": varEmpty,
|
|
309
|
-
"--un-backdrop-filter": "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-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia)"
|
|
310
|
-
[CONTROL_SHORTCUT_NO_MERGE]: ""
|
|
309
|
+
"--un-backdrop-filter": "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-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia)"
|
|
311
310
|
};
|
|
312
311
|
const percentWithDefault = (str) => {
|
|
313
312
|
let v = handler.bracket.cssvar(str || "");
|
|
@@ -321,22 +320,16 @@ const toFilter = (varName, resolver) => ([, b, s], { theme }) => {
|
|
|
321
320
|
const value = resolver(s, theme) ?? (s === "none" ? "0" : "");
|
|
322
321
|
if (value !== "") {
|
|
323
322
|
if (b) {
|
|
324
|
-
return
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
"backdrop-filter": "var(--un-backdrop-filter)"
|
|
330
|
-
}
|
|
331
|
-
];
|
|
323
|
+
return {
|
|
324
|
+
[`--un-${b}${varName}`]: `${varName}(${value})`,
|
|
325
|
+
"-webkit-backdrop-filter": "var(--un-backdrop-filter)",
|
|
326
|
+
"backdrop-filter": "var(--un-backdrop-filter)"
|
|
327
|
+
};
|
|
332
328
|
} else {
|
|
333
|
-
return
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
filter: "var(--un-filter)"
|
|
338
|
-
}
|
|
339
|
-
];
|
|
329
|
+
return {
|
|
330
|
+
[`--un-${varName}`]: `${varName}(${value})`,
|
|
331
|
+
filter: "var(--un-filter)"
|
|
332
|
+
};
|
|
340
333
|
}
|
|
341
334
|
}
|
|
342
335
|
};
|
|
@@ -344,23 +337,17 @@ const dropShadowResolver = ([, s], { theme }) => {
|
|
|
344
337
|
let v = theme.dropShadow?.[s || "DEFAULT"];
|
|
345
338
|
if (v != null) {
|
|
346
339
|
const shadows = colorableShadows(v, "--un-drop-shadow-color");
|
|
347
|
-
return
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
"filter": "var(--un-filter)"
|
|
352
|
-
}
|
|
353
|
-
];
|
|
340
|
+
return {
|
|
341
|
+
"--un-drop-shadow": `drop-shadow(${shadows.join(") drop-shadow(")})`,
|
|
342
|
+
"filter": "var(--un-filter)"
|
|
343
|
+
};
|
|
354
344
|
}
|
|
355
345
|
v = handler.bracket.cssvar(s);
|
|
356
346
|
if (v != null) {
|
|
357
|
-
return
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
"filter": "var(--un-filter)"
|
|
362
|
-
}
|
|
363
|
-
];
|
|
347
|
+
return {
|
|
348
|
+
"--un-drop-shadow": `drop-shadow(${v})`,
|
|
349
|
+
"filter": "var(--un-filter)"
|
|
350
|
+
};
|
|
364
351
|
}
|
|
365
352
|
};
|
|
366
353
|
const filters = [
|
|
@@ -386,33 +373,17 @@ const filters = [
|
|
|
386
373
|
}],
|
|
387
374
|
[/^(?:filter-)?drop-shadow-color-(.+)$/, colorResolver("--un-drop-shadow-color", "drop-shadow")],
|
|
388
375
|
[/^(?:filter-)?drop-shadow-color-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-drop-shadow-opacity": handler.bracket.percent(opacity) })],
|
|
389
|
-
[/^(?:(backdrop-)|filter-)?grayscale(?:-(.+))?$/, toFilter("grayscale", percentWithDefault), {
|
|
390
|
-
autocomplete: ["(backdrop|filter)-grayscale", "(backdrop|filter)-grayscale-<percent>", "grayscale-<percent>"]
|
|
391
|
-
}],
|
|
376
|
+
[/^(?:(backdrop-)|filter-)?grayscale(?:-(.+))?$/, toFilter("grayscale", percentWithDefault), { autocomplete: ["(backdrop|filter)-grayscale", "(backdrop|filter)-grayscale-<percent>", "grayscale-<percent>"] }],
|
|
392
377
|
[/^(?:(backdrop-)|filter-)?hue-rotate-(.+)$/, toFilter("hue-rotate", (s) => handler.bracket.cssvar.degree(s))],
|
|
393
|
-
[/^(?:(backdrop-)|filter-)?invert(?:-(.+))?$/, toFilter("invert", percentWithDefault), {
|
|
394
|
-
|
|
395
|
-
}],
|
|
396
|
-
[/^(backdrop-)
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
378
|
+
[/^(?:(backdrop-)|filter-)?invert(?:-(.+))?$/, toFilter("invert", percentWithDefault), { autocomplete: ["(backdrop|filter)-invert", "(backdrop|filter)-invert-<percent>", "invert-<percent>"] }],
|
|
379
|
+
[/^(backdrop-)op(?:acity)-(.+)$/, toFilter("opacity", (s) => handler.bracket.cssvar.percent(s)), { autocomplete: ["backdrop-(op|opacity)", "backdrop-(op|opacity)-<percent>"] }],
|
|
380
|
+
[/^(?:(backdrop-)|filter-)?saturate-(.+)$/, toFilter("saturate", (s) => handler.bracket.cssvar.percent(s)), { autocomplete: ["(backdrop|filter)-saturate", "(backdrop|filter)-saturate-<percent>", "saturate-<percent>"] }],
|
|
381
|
+
[/^(?:(backdrop-)|filter-)?sepia(?:-(.+))?$/, toFilter("sepia", percentWithDefault), { autocomplete: ["(backdrop|filter)-sepia", "(backdrop|filter)-sepia-<percent>", "sepia-<percent>"] }],
|
|
382
|
+
["filter", { filter: "var(--un-filter)" }],
|
|
383
|
+
["backdrop-filter", {
|
|
384
|
+
"-webkit-backdrop-filter": "var(--un-backdrop-filter)",
|
|
385
|
+
"backdrop-filter": "var(--un-backdrop-filter)"
|
|
401
386
|
}],
|
|
402
|
-
[/^(?:(backdrop-)|filter-)?sepia(?:-(.+))?$/, toFilter("sepia", percentWithDefault), {
|
|
403
|
-
autocomplete: ["(backdrop|filter)-sepia", "(backdrop|filter)-sepia-<percent>", "sepia-<percent>"]
|
|
404
|
-
}],
|
|
405
|
-
[/^filter$/, () => [
|
|
406
|
-
filterBase,
|
|
407
|
-
{ filter: "var(--un-filter)" }
|
|
408
|
-
]],
|
|
409
|
-
[/^backdrop-filter$/, () => [
|
|
410
|
-
backdropFilterBase,
|
|
411
|
-
{
|
|
412
|
-
"-webkit-backdrop-filter": "var(--un-backdrop-filter)",
|
|
413
|
-
"backdrop-filter": "var(--un-backdrop-filter)"
|
|
414
|
-
}
|
|
415
|
-
], { autocomplete: "backdrop-filter" }],
|
|
416
387
|
["filter-none", { filter: "none" }],
|
|
417
388
|
["backdrop-filter-none", {
|
|
418
389
|
"-webkit-backdrop-filter": "none",
|
|
@@ -653,16 +624,12 @@ const fontVariantNumericBase = {
|
|
|
653
624
|
"--un-numeric-figure": varEmpty,
|
|
654
625
|
"--un-numeric-spacing": varEmpty,
|
|
655
626
|
"--un-numeric-fraction": varEmpty,
|
|
656
|
-
"--un-font-variant-numeric": "var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)"
|
|
657
|
-
[CONTROL_SHORTCUT_NO_MERGE]: ""
|
|
627
|
+
"--un-font-variant-numeric": "var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)"
|
|
658
628
|
};
|
|
659
|
-
const toEntries = (entry) =>
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
"font-variant-numeric": "var(--un-font-variant-numeric)"
|
|
664
|
-
}
|
|
665
|
-
];
|
|
629
|
+
const toEntries = (entry) => ({
|
|
630
|
+
...entry,
|
|
631
|
+
"font-variant-numeric": "var(--un-font-variant-numeric)"
|
|
632
|
+
});
|
|
666
633
|
const fontVariantNumeric = [
|
|
667
634
|
[/^ordinal$/, () => toEntries({ "--un-ordinal": "ordinal" }), { autocomplete: "ordinal" }],
|
|
668
635
|
[/^slashed-zero$/, () => toEntries({ "--un-slashed-zero": "slashed-zero" }), { autocomplete: "slashed-zero" }],
|
|
@@ -679,46 +646,36 @@ const touchActionBase = {
|
|
|
679
646
|
"--un-pan-x": varEmpty,
|
|
680
647
|
"--un-pan-y": varEmpty,
|
|
681
648
|
"--un-pinch-zoom": varEmpty,
|
|
682
|
-
"--un-touch-action": "var(--un-pan-x) var(--un-pan-y) var(--un-pinch-zoom)"
|
|
683
|
-
[CONTROL_SHORTCUT_NO_MERGE]: ""
|
|
649
|
+
"--un-touch-action": "var(--un-pan-x) var(--un-pan-y) var(--un-pinch-zoom)"
|
|
684
650
|
};
|
|
685
651
|
const touchActions = [
|
|
686
|
-
[/^touch-pan-(x|left|right)$/, ([, d]) =>
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
}
|
|
699
|
-
]],
|
|
700
|
-
[/^touch-pinch-zoom$/, () => [
|
|
701
|
-
touchActionBase,
|
|
702
|
-
{
|
|
703
|
-
"--un-pinch-zoom": "pinch-zoom",
|
|
704
|
-
"touch-action": "var(--un-touch-action)"
|
|
705
|
-
}
|
|
706
|
-
], { autocomplete: ["touch-pinch", "touch-pinch-zoom"] }],
|
|
652
|
+
[/^touch-pan-(x|left|right)$/, ([, d]) => ({
|
|
653
|
+
"--un-pan-x": `pan-${d}`,
|
|
654
|
+
"touch-action": "var(--un-touch-action)"
|
|
655
|
+
}), { autocomplete: ["touch-pan", "touch-pan-(x|left|right|y|up|down)"] }],
|
|
656
|
+
[/^touch-pan-(y|up|down)$/, ([, d]) => ({
|
|
657
|
+
"--un-pan-y": `pan-${d}`,
|
|
658
|
+
"touch-action": "var(--un-touch-action)"
|
|
659
|
+
})],
|
|
660
|
+
["touch-pinch-zoom", {
|
|
661
|
+
"--un-pinch-zoom": "pinch-zoom",
|
|
662
|
+
"touch-action": "var(--un-touch-action)"
|
|
663
|
+
}],
|
|
707
664
|
["touch-auto", { "touch-action": "auto" }],
|
|
708
665
|
["touch-manipulation", { "touch-action": "manipulation" }],
|
|
709
666
|
["touch-none", { "touch-action": "none" }]
|
|
710
667
|
];
|
|
711
668
|
|
|
669
|
+
const scrollSnapTypeBase = {
|
|
670
|
+
"--un-scroll-snap-strictness": "proximity"
|
|
671
|
+
};
|
|
712
672
|
const scrolls = [
|
|
713
|
-
[/^snap-(x|y
|
|
714
|
-
{
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
"scroll-snap-type": `${d} var(--un-scroll-snap-strictness)`
|
|
720
|
-
}
|
|
721
|
-
], { autocomplete: "snap-(x|y|both)" }],
|
|
673
|
+
[/^snap-(x|y)$/, ([, d]) => ({
|
|
674
|
+
"scroll-snap-type": `${d} var(--un-scroll-snap-strictness)`
|
|
675
|
+
}), { autocomplete: "snap-(x|y|both)" }],
|
|
676
|
+
[/^snap-both$/, () => ({
|
|
677
|
+
"scroll-snap-type": "both var(--un-scroll-snap-strictness)"
|
|
678
|
+
})],
|
|
722
679
|
["snap-mandatory", { "--un-scroll-snap-strictness": "mandatory" }],
|
|
723
680
|
["snap-proximity", { "--un-scroll-snap-strictness": "proximity" }],
|
|
724
681
|
["snap-none", { "scroll-snap-type": "none" }],
|
|
@@ -1011,6 +968,16 @@ const theme = {
|
|
|
1011
968
|
pointer: "(hover) and (pointer: coarse)",
|
|
1012
969
|
mouse: "(hover) and (pointer: fine)",
|
|
1013
970
|
hd_color: "(dynamic-range: high)"
|
|
971
|
+
},
|
|
972
|
+
preflightBase: {
|
|
973
|
+
...transformBase,
|
|
974
|
+
...touchActionBase,
|
|
975
|
+
...scrollSnapTypeBase,
|
|
976
|
+
...fontVariantNumericBase,
|
|
977
|
+
...boxShadowsBase,
|
|
978
|
+
...ringBase,
|
|
979
|
+
...filterBase,
|
|
980
|
+
...backdropFilterBase
|
|
1014
981
|
}
|
|
1015
982
|
};
|
|
1016
983
|
|
|
@@ -1087,7 +1054,8 @@ const presetWind = (options = {}) => {
|
|
|
1087
1054
|
rules,
|
|
1088
1055
|
shortcuts,
|
|
1089
1056
|
variants: variants(options),
|
|
1090
|
-
options
|
|
1057
|
+
options,
|
|
1058
|
+
preflights
|
|
1091
1059
|
};
|
|
1092
1060
|
};
|
|
1093
1061
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-wind",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.0",
|
|
4
4
|
"description": "Tailwind / Windi CSS compact preset for UnoCSS",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -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.37.0",
|
|
39
|
+
"@unocss/preset-mini": "0.37.0"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "unbuild",
|