@unocss/preset-wind 0.16.0 → 0.16.4
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 +188 -60
- package/dist/index.mjs +191 -63
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -311,6 +311,12 @@ const boxDecorationBreaks = [
|
|
|
311
311
|
["decoration-slice", { "box-decoration-break": "slice" }],
|
|
312
312
|
["decoration-clone", { "box-decoration-break": "clone" }]
|
|
313
313
|
];
|
|
314
|
+
const accentOpacity = [
|
|
315
|
+
[/^accent-op(?:acity)?-?(.+)$/, ([, d]) => ({ "--un-accent-opacity": utils.handler.bracket.percent(d) })]
|
|
316
|
+
];
|
|
317
|
+
const accentColors = [
|
|
318
|
+
[/^accent-(.+)$/, rules$1.colorResolver("accent-color", "accent")]
|
|
319
|
+
];
|
|
314
320
|
const caretOpacity = [
|
|
315
321
|
[/^caret-op(?:acity)?-?(.+)$/, ([, d]) => ({ "--un-caret-opacity": utils.handler.bracket.percent(d) })]
|
|
316
322
|
];
|
|
@@ -340,6 +346,38 @@ const overscrolls = [
|
|
|
340
346
|
[/^overscroll-(.+)$/, ([, v]) => overflowValues.includes(v) ? { "overscroll-behavior": v } : void 0],
|
|
341
347
|
[/^overscroll-([xy])-(.+)$/, ([, d, v]) => overflowValues.includes(v) ? { [`overscroll-behavior-${d}`]: v } : void 0]
|
|
342
348
|
];
|
|
349
|
+
const scrollBehaviors = [
|
|
350
|
+
["scroll-auto", { "scroll-behavior": "auto" }],
|
|
351
|
+
["scroll-smooth", { "scroll-behavior": "smooth" }]
|
|
352
|
+
];
|
|
353
|
+
|
|
354
|
+
const columns = [
|
|
355
|
+
[/^columns-(.+)$/, ([, v]) => {
|
|
356
|
+
const column = utils.handler.bracket.global.number.numberWithUnit(v);
|
|
357
|
+
if (column)
|
|
358
|
+
return { column };
|
|
359
|
+
}],
|
|
360
|
+
["break-before-auto", { "break-before": "auto" }],
|
|
361
|
+
["break-before-avoid", { "break-before": "avoid" }],
|
|
362
|
+
["break-before-all", { "break-before": "all" }],
|
|
363
|
+
["break-before-avoid-page", { "break-before": "avoid-page" }],
|
|
364
|
+
["break-before-page", { "break-before": "page" }],
|
|
365
|
+
["break-before-left", { "break-before": "left" }],
|
|
366
|
+
["break-before-right", { "break-before": "right" }],
|
|
367
|
+
["break-before-column", { "break-before": "column" }],
|
|
368
|
+
["break-inside-auto", { "break-inside": "auto" }],
|
|
369
|
+
["break-inside-avoid", { "break-inside": "avoid" }],
|
|
370
|
+
["break-inside-avoid-page", { "break-inside": "avoid-page" }],
|
|
371
|
+
["break-inside-avoid-column", { "break-inside": "avoid-column" }],
|
|
372
|
+
["break-after-auto", { "break-after": "auto" }],
|
|
373
|
+
["break-after-avoid", { "break-after": "avoid" }],
|
|
374
|
+
["break-after-all", { "break-after": "all" }],
|
|
375
|
+
["break-after-avoid-page", { "break-after": "avoid-page" }],
|
|
376
|
+
["break-after-page", { "break-after": "page" }],
|
|
377
|
+
["break-after-left", { "break-after": "left" }],
|
|
378
|
+
["break-after-right", { "break-after": "right" }],
|
|
379
|
+
["break-after-column", { "break-after": "column" }]
|
|
380
|
+
];
|
|
343
381
|
|
|
344
382
|
const queryMatcher = /@media \(min-width: (.+)\)/;
|
|
345
383
|
const container = [
|
|
@@ -388,7 +426,7 @@ const filterBase = {
|
|
|
388
426
|
"--un-sepia": varEmpty,
|
|
389
427
|
"--un-drop-shadow": varEmpty,
|
|
390
428
|
"filter": filterContnet,
|
|
391
|
-
[variants.
|
|
429
|
+
[variants.CONTROL_BYPASS_PSEUDO_CLASS]: ""
|
|
392
430
|
};
|
|
393
431
|
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
432
|
const backdropFilterBase = {
|
|
@@ -402,7 +440,7 @@ const backdropFilterBase = {
|
|
|
402
440
|
"--un-backdrop-sepia": varEmpty,
|
|
403
441
|
"-webkit-backdrop-filter": backdropFilterContent,
|
|
404
442
|
"backdrop-filter": backdropFilterContent,
|
|
405
|
-
[variants.
|
|
443
|
+
[variants.CONTROL_BYPASS_PSEUDO_CLASS]: ""
|
|
406
444
|
};
|
|
407
445
|
const percentWithDefault = (defaultValue = "1") => (str) => {
|
|
408
446
|
const v = str ? utils.handler.bracket.percent(str) : defaultValue;
|
|
@@ -665,7 +703,7 @@ const fontVariantNumericBase = {
|
|
|
665
703
|
"--un-numeric-spacing": rules$1.varEmpty,
|
|
666
704
|
"--un-numeric-fraction": rules$1.varEmpty,
|
|
667
705
|
"font-variant-numeric": "var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)",
|
|
668
|
-
[variants.
|
|
706
|
+
[variants.CONTROL_BYPASS_PSEUDO_CLASS]: ""
|
|
669
707
|
};
|
|
670
708
|
const fontVariantNumeric = [
|
|
671
709
|
[/^ordinal$/, () => [fontVariantNumericBase, { "--un-ordinal": "ordinal" }]],
|
|
@@ -679,84 +717,173 @@ const fontVariantNumeric = [
|
|
|
679
717
|
["normal-nums", { "font-variant-numeric": "normal" }]
|
|
680
718
|
];
|
|
681
719
|
|
|
720
|
+
const touchActionBase = {
|
|
721
|
+
"--un-pan-x": rules$1.varEmpty,
|
|
722
|
+
"--un-pan-y": rules$1.varEmpty,
|
|
723
|
+
"--un-pinch-zoom": rules$1.varEmpty,
|
|
724
|
+
"--un-touch-action": "var(--un-pan-x) var(--un-pan-y) var(--un-pinch-zoom)",
|
|
725
|
+
[variants.CONTROL_BYPASS_PSEUDO_CLASS]: ""
|
|
726
|
+
};
|
|
727
|
+
const touchActions = [
|
|
728
|
+
[/^touch-pan-(x|left|right)$/, ([, d]) => [
|
|
729
|
+
touchActionBase,
|
|
730
|
+
{
|
|
731
|
+
"--un-pan-x": `pan-${d}`,
|
|
732
|
+
"touch-action": "var(--un-touch-action)"
|
|
733
|
+
}
|
|
734
|
+
]],
|
|
735
|
+
[/^touch-pan-(y|up|down)$/, ([, d]) => [
|
|
736
|
+
touchActionBase,
|
|
737
|
+
{
|
|
738
|
+
"--un-pan-y": `pan-${d}`,
|
|
739
|
+
"touch-action": "var(--un-touch-action)"
|
|
740
|
+
}
|
|
741
|
+
]],
|
|
742
|
+
[/^touch-pinch-zoom$/, () => [
|
|
743
|
+
touchActionBase,
|
|
744
|
+
{
|
|
745
|
+
"--un-pinch-zoom": "pinch-zoom",
|
|
746
|
+
"touch-action": "var(--un-touch-action)"
|
|
747
|
+
}
|
|
748
|
+
]],
|
|
749
|
+
["touch-auto", { "touch-action": "auto" }],
|
|
750
|
+
["touch-manipulation", { "touch-action": "manipulation" }],
|
|
751
|
+
["touch-none", { "touch-action": "none" }]
|
|
752
|
+
];
|
|
753
|
+
|
|
754
|
+
const scrolls = [
|
|
755
|
+
[/^snap-(x|y|base)$/, ([, d]) => [
|
|
756
|
+
{
|
|
757
|
+
"--un-scroll-snap-strictness": "proximity",
|
|
758
|
+
[variants.CONTROL_BYPASS_PSEUDO_CLASS]: ""
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
"scroll-snap-type": `${d} var(--un-scroll-snap-strictness)`
|
|
762
|
+
}
|
|
763
|
+
]],
|
|
764
|
+
["snap-mandatory", { "--un-scroll-snap-strictness": "mandatory" }],
|
|
765
|
+
["snap-proximity", { "--un-scroll-snap-strictness": "proximity" }],
|
|
766
|
+
["snap-none", { "scroll-snap-type": "none" }],
|
|
767
|
+
["snap-start", { "scroll-snap-align": "start" }],
|
|
768
|
+
["snap-end", { "scroll-snap-align": "end" }],
|
|
769
|
+
["snap-center", { "scroll-snap-align": "center" }],
|
|
770
|
+
["snap-align-none", { "scroll-snap-align": "none" }],
|
|
771
|
+
["snap-normal", { "scroll-snap-stop": "normal" }],
|
|
772
|
+
["snap-always", { "scroll-snap-stop": "always" }],
|
|
773
|
+
[/^scroll-ma?()-?(-?.+)$/, utils.directionSize("scroll-margin")],
|
|
774
|
+
[/^scroll-m-?([xy])-?(-?.+)$/, utils.directionSize("scroll-margin")],
|
|
775
|
+
[/^scroll-m-?([rltb])-?(-?.+)$/, utils.directionSize("scroll-margin")],
|
|
776
|
+
[/^scroll-pa?()-?(-?.+)$/, utils.directionSize("scroll-padding")],
|
|
777
|
+
[/^scroll-p-?([xy])-?(-?.+)$/, utils.directionSize("scroll-padding")],
|
|
778
|
+
[/^scroll-p-?([rltb])-?(-?.+)$/, utils.directionSize("scroll-padding")]
|
|
779
|
+
];
|
|
780
|
+
|
|
682
781
|
const rules = [
|
|
683
|
-
screenReadersAccess,
|
|
684
|
-
cssVariables,
|
|
685
782
|
rules$1.cssVariables,
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
783
|
+
cssVariables,
|
|
784
|
+
container,
|
|
785
|
+
screenReadersAccess,
|
|
786
|
+
rules$1.pointerEvents,
|
|
787
|
+
rules$1.appearances,
|
|
788
|
+
rules$1.positions,
|
|
789
|
+
rules$1.insets,
|
|
689
790
|
lineClamps,
|
|
690
791
|
isolations,
|
|
691
|
-
|
|
792
|
+
rules$1.zIndexes,
|
|
793
|
+
rules$1.orders,
|
|
794
|
+
rules$1.grids,
|
|
795
|
+
rules$1.floats,
|
|
796
|
+
rules$1.margins,
|
|
797
|
+
rules$1.boxSizing,
|
|
692
798
|
rules$1.displays,
|
|
693
|
-
rules$1.
|
|
694
|
-
|
|
695
|
-
rules$1.
|
|
696
|
-
|
|
697
|
-
rules$1.
|
|
799
|
+
rules$1.aspectRatio,
|
|
800
|
+
rules$1.sizes,
|
|
801
|
+
rules$1.flex,
|
|
802
|
+
tables,
|
|
803
|
+
rules$1.transforms,
|
|
804
|
+
animations,
|
|
805
|
+
rules$1.cursors,
|
|
806
|
+
touchActions,
|
|
807
|
+
rules$1.userSelects,
|
|
808
|
+
rules$1.resizes,
|
|
809
|
+
scrolls,
|
|
810
|
+
listStyle,
|
|
811
|
+
rules$1.appearance,
|
|
812
|
+
columns,
|
|
813
|
+
rules$1.placements,
|
|
814
|
+
rules$1.alignments,
|
|
815
|
+
rules$1.justifies,
|
|
816
|
+
rules$1.gaps,
|
|
817
|
+
spaces,
|
|
698
818
|
divides,
|
|
699
|
-
rules$1.
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
rules$1.textIndents,
|
|
819
|
+
rules$1.overflows,
|
|
820
|
+
overscrolls,
|
|
821
|
+
scrollBehaviors,
|
|
703
822
|
rules$1.textOverflows,
|
|
704
|
-
rules$1.
|
|
705
|
-
rules$1.
|
|
706
|
-
rules$1.
|
|
707
|
-
|
|
823
|
+
rules$1.whitespaces,
|
|
824
|
+
rules$1.breaks,
|
|
825
|
+
rules$1.borders,
|
|
826
|
+
rules$1.bgColors,
|
|
827
|
+
boxDecorationBreaks,
|
|
828
|
+
backgroundStyles,
|
|
829
|
+
rules$1.svgUtilities,
|
|
830
|
+
objectPositions,
|
|
831
|
+
rules$1.paddings,
|
|
708
832
|
rules$1.textAligns,
|
|
709
|
-
rules$1.
|
|
710
|
-
|
|
833
|
+
rules$1.textIndents,
|
|
834
|
+
rules$1.verticalAligns,
|
|
835
|
+
rules$1.fonts,
|
|
836
|
+
textTransforms,
|
|
711
837
|
rules$1.fontStyles,
|
|
838
|
+
fontVariantNumeric,
|
|
839
|
+
rules$1.textColors,
|
|
840
|
+
rules$1.textDecorations,
|
|
712
841
|
rules$1.fontSmoothings,
|
|
842
|
+
rules$1.tabSizes,
|
|
843
|
+
rules$1.textStrokes,
|
|
844
|
+
rules$1.textShadows,
|
|
713
845
|
hyphens,
|
|
714
846
|
writingModes,
|
|
715
847
|
writingOrientations,
|
|
848
|
+
rules$1.placeholder,
|
|
849
|
+
caretColors,
|
|
850
|
+
caretOpacity,
|
|
851
|
+
accentColors,
|
|
852
|
+
accentOpacity,
|
|
853
|
+
rules$1.opacity,
|
|
716
854
|
mixBlendModes,
|
|
717
855
|
rules$1.boxShadows,
|
|
856
|
+
rules$1.outline,
|
|
718
857
|
rules$1.rings,
|
|
719
|
-
rules$1.flex,
|
|
720
|
-
rules$1.grids,
|
|
721
|
-
rules$1.gaps,
|
|
722
|
-
rules$1.sizes,
|
|
723
|
-
rules$1.aspectRatio,
|
|
724
|
-
rules$1.cursors,
|
|
725
|
-
rules$1.appearances,
|
|
726
|
-
rules$1.pointerEvents,
|
|
727
|
-
rules$1.resizes,
|
|
728
|
-
rules$1.verticalAligns,
|
|
729
|
-
rules$1.userSelects,
|
|
730
|
-
rules$1.whitespaces,
|
|
731
|
-
listStyle,
|
|
732
|
-
caretColors,
|
|
733
|
-
boxDecorationBreaks,
|
|
734
|
-
caretOpacity,
|
|
735
858
|
imageRenderings,
|
|
736
|
-
rules$1.breaks,
|
|
737
|
-
rules$1.overflows,
|
|
738
|
-
rules$1.outline,
|
|
739
|
-
rules$1.appearance,
|
|
740
|
-
rules$1.placeholder,
|
|
741
|
-
overscrolls,
|
|
742
|
-
rules$1.positions,
|
|
743
|
-
rules$1.orders,
|
|
744
|
-
rules$1.justifies,
|
|
745
|
-
rules$1.placements,
|
|
746
|
-
rules$1.alignments,
|
|
747
|
-
animations,
|
|
748
|
-
rules$1.insets,
|
|
749
|
-
rules$1.floats,
|
|
750
|
-
rules$1.zIndexes,
|
|
751
|
-
objectPositions,
|
|
752
|
-
rules$1.boxSizing,
|
|
753
|
-
rules$1.transitions,
|
|
754
859
|
filters,
|
|
755
|
-
|
|
756
|
-
rules$1.
|
|
860
|
+
rules$1.transitions,
|
|
861
|
+
rules$1.willChange,
|
|
862
|
+
rules$1.contents,
|
|
757
863
|
rules$1.questionMark
|
|
758
864
|
].flat(1);
|
|
759
865
|
|
|
866
|
+
const variantColorsScheme = [
|
|
867
|
+
utils.variantMatcher("\\.dark", (input) => `.dark $$ ${input}`),
|
|
868
|
+
utils.variantMatcher("\\.light", (input) => `.light $$ ${input}`),
|
|
869
|
+
(v) => {
|
|
870
|
+
const dark = utils.variantMatcher("@dark")(v);
|
|
871
|
+
if (dark) {
|
|
872
|
+
return {
|
|
873
|
+
...dark,
|
|
874
|
+
parent: "@media (prefers-color-scheme: dark)"
|
|
875
|
+
};
|
|
876
|
+
}
|
|
877
|
+
const light = utils.variantMatcher("@light")(v);
|
|
878
|
+
if (light) {
|
|
879
|
+
return {
|
|
880
|
+
...light,
|
|
881
|
+
parent: "@media (prefers-color-scheme: light)"
|
|
882
|
+
};
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
];
|
|
886
|
+
|
|
760
887
|
const presetWind = (options = {}) => ({
|
|
761
888
|
name: "@unocss/preset-wind",
|
|
762
889
|
theme: theme.theme,
|
|
@@ -766,6 +893,7 @@ const presetWind = (options = {}) => ({
|
|
|
766
893
|
],
|
|
767
894
|
variants: [
|
|
768
895
|
...variants.variants,
|
|
896
|
+
...variantColorsScheme,
|
|
769
897
|
...options.dark === "media" ? variants.variantColorsMedia : variants.variantColorsClass
|
|
770
898
|
],
|
|
771
899
|
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 { parseColorUtil, colorResolver as colorResolver$1, varEmpty as varEmpty$1, cssVariables as cssVariables$1,
|
|
6
|
-
import { handler, directionMap } from '@unocss/preset-mini/utils';
|
|
5
|
+
import { parseColorUtil, colorResolver as colorResolver$1, varEmpty as varEmpty$1, 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, directionMap, directionSize as directionSize$1, variantMatcher } from '@unocss/preset-mini/utils';
|
|
7
7
|
|
|
8
8
|
const keyframes = {
|
|
9
9
|
"pulse": "{0%, 100% {opacity:1} 50% {opacity:.5}}",
|
|
@@ -307,6 +307,12 @@ const boxDecorationBreaks = [
|
|
|
307
307
|
["decoration-slice", { "box-decoration-break": "slice" }],
|
|
308
308
|
["decoration-clone", { "box-decoration-break": "clone" }]
|
|
309
309
|
];
|
|
310
|
+
const accentOpacity = [
|
|
311
|
+
[/^accent-op(?:acity)?-?(.+)$/, ([, d]) => ({ "--un-accent-opacity": handler.bracket.percent(d) })]
|
|
312
|
+
];
|
|
313
|
+
const accentColors = [
|
|
314
|
+
[/^accent-(.+)$/, colorResolver$1("accent-color", "accent")]
|
|
315
|
+
];
|
|
310
316
|
const caretOpacity = [
|
|
311
317
|
[/^caret-op(?:acity)?-?(.+)$/, ([, d]) => ({ "--un-caret-opacity": handler.bracket.percent(d) })]
|
|
312
318
|
];
|
|
@@ -336,6 +342,38 @@ const overscrolls = [
|
|
|
336
342
|
[/^overscroll-(.+)$/, ([, v]) => overflowValues.includes(v) ? { "overscroll-behavior": v } : void 0],
|
|
337
343
|
[/^overscroll-([xy])-(.+)$/, ([, d, v]) => overflowValues.includes(v) ? { [`overscroll-behavior-${d}`]: v } : void 0]
|
|
338
344
|
];
|
|
345
|
+
const scrollBehaviors = [
|
|
346
|
+
["scroll-auto", { "scroll-behavior": "auto" }],
|
|
347
|
+
["scroll-smooth", { "scroll-behavior": "smooth" }]
|
|
348
|
+
];
|
|
349
|
+
|
|
350
|
+
const columns = [
|
|
351
|
+
[/^columns-(.+)$/, ([, v]) => {
|
|
352
|
+
const column = handler.bracket.global.number.numberWithUnit(v);
|
|
353
|
+
if (column)
|
|
354
|
+
return { column };
|
|
355
|
+
}],
|
|
356
|
+
["break-before-auto", { "break-before": "auto" }],
|
|
357
|
+
["break-before-avoid", { "break-before": "avoid" }],
|
|
358
|
+
["break-before-all", { "break-before": "all" }],
|
|
359
|
+
["break-before-avoid-page", { "break-before": "avoid-page" }],
|
|
360
|
+
["break-before-page", { "break-before": "page" }],
|
|
361
|
+
["break-before-left", { "break-before": "left" }],
|
|
362
|
+
["break-before-right", { "break-before": "right" }],
|
|
363
|
+
["break-before-column", { "break-before": "column" }],
|
|
364
|
+
["break-inside-auto", { "break-inside": "auto" }],
|
|
365
|
+
["break-inside-avoid", { "break-inside": "avoid" }],
|
|
366
|
+
["break-inside-avoid-page", { "break-inside": "avoid-page" }],
|
|
367
|
+
["break-inside-avoid-column", { "break-inside": "avoid-column" }],
|
|
368
|
+
["break-after-auto", { "break-after": "auto" }],
|
|
369
|
+
["break-after-avoid", { "break-after": "avoid" }],
|
|
370
|
+
["break-after-all", { "break-after": "all" }],
|
|
371
|
+
["break-after-avoid-page", { "break-after": "avoid-page" }],
|
|
372
|
+
["break-after-page", { "break-after": "page" }],
|
|
373
|
+
["break-after-left", { "break-after": "left" }],
|
|
374
|
+
["break-after-right", { "break-after": "right" }],
|
|
375
|
+
["break-after-column", { "break-after": "column" }]
|
|
376
|
+
];
|
|
339
377
|
|
|
340
378
|
const queryMatcher = /@media \(min-width: (.+)\)/;
|
|
341
379
|
const container = [
|
|
@@ -384,7 +422,7 @@ const filterBase = {
|
|
|
384
422
|
"--un-sepia": varEmpty,
|
|
385
423
|
"--un-drop-shadow": varEmpty,
|
|
386
424
|
"filter": filterContnet,
|
|
387
|
-
[
|
|
425
|
+
[CONTROL_BYPASS_PSEUDO_CLASS]: ""
|
|
388
426
|
};
|
|
389
427
|
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
428
|
const backdropFilterBase = {
|
|
@@ -398,7 +436,7 @@ const backdropFilterBase = {
|
|
|
398
436
|
"--un-backdrop-sepia": varEmpty,
|
|
399
437
|
"-webkit-backdrop-filter": backdropFilterContent,
|
|
400
438
|
"backdrop-filter": backdropFilterContent,
|
|
401
|
-
[
|
|
439
|
+
[CONTROL_BYPASS_PSEUDO_CLASS]: ""
|
|
402
440
|
};
|
|
403
441
|
const percentWithDefault = (defaultValue = "1") => (str) => {
|
|
404
442
|
const v = str ? handler.bracket.percent(str) : defaultValue;
|
|
@@ -661,7 +699,7 @@ const fontVariantNumericBase = {
|
|
|
661
699
|
"--un-numeric-spacing": varEmpty$1,
|
|
662
700
|
"--un-numeric-fraction": varEmpty$1,
|
|
663
701
|
"font-variant-numeric": "var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)",
|
|
664
|
-
[
|
|
702
|
+
[CONTROL_BYPASS_PSEUDO_CLASS]: ""
|
|
665
703
|
};
|
|
666
704
|
const fontVariantNumeric = [
|
|
667
705
|
[/^ordinal$/, () => [fontVariantNumericBase, { "--un-ordinal": "ordinal" }]],
|
|
@@ -675,84 +713,173 @@ const fontVariantNumeric = [
|
|
|
675
713
|
["normal-nums", { "font-variant-numeric": "normal" }]
|
|
676
714
|
];
|
|
677
715
|
|
|
716
|
+
const touchActionBase = {
|
|
717
|
+
"--un-pan-x": varEmpty$1,
|
|
718
|
+
"--un-pan-y": varEmpty$1,
|
|
719
|
+
"--un-pinch-zoom": varEmpty$1,
|
|
720
|
+
"--un-touch-action": "var(--un-pan-x) var(--un-pan-y) var(--un-pinch-zoom)",
|
|
721
|
+
[CONTROL_BYPASS_PSEUDO_CLASS]: ""
|
|
722
|
+
};
|
|
723
|
+
const touchActions = [
|
|
724
|
+
[/^touch-pan-(x|left|right)$/, ([, d]) => [
|
|
725
|
+
touchActionBase,
|
|
726
|
+
{
|
|
727
|
+
"--un-pan-x": `pan-${d}`,
|
|
728
|
+
"touch-action": "var(--un-touch-action)"
|
|
729
|
+
}
|
|
730
|
+
]],
|
|
731
|
+
[/^touch-pan-(y|up|down)$/, ([, d]) => [
|
|
732
|
+
touchActionBase,
|
|
733
|
+
{
|
|
734
|
+
"--un-pan-y": `pan-${d}`,
|
|
735
|
+
"touch-action": "var(--un-touch-action)"
|
|
736
|
+
}
|
|
737
|
+
]],
|
|
738
|
+
[/^touch-pinch-zoom$/, () => [
|
|
739
|
+
touchActionBase,
|
|
740
|
+
{
|
|
741
|
+
"--un-pinch-zoom": "pinch-zoom",
|
|
742
|
+
"touch-action": "var(--un-touch-action)"
|
|
743
|
+
}
|
|
744
|
+
]],
|
|
745
|
+
["touch-auto", { "touch-action": "auto" }],
|
|
746
|
+
["touch-manipulation", { "touch-action": "manipulation" }],
|
|
747
|
+
["touch-none", { "touch-action": "none" }]
|
|
748
|
+
];
|
|
749
|
+
|
|
750
|
+
const scrolls = [
|
|
751
|
+
[/^snap-(x|y|base)$/, ([, d]) => [
|
|
752
|
+
{
|
|
753
|
+
"--un-scroll-snap-strictness": "proximity",
|
|
754
|
+
[CONTROL_BYPASS_PSEUDO_CLASS]: ""
|
|
755
|
+
},
|
|
756
|
+
{
|
|
757
|
+
"scroll-snap-type": `${d} var(--un-scroll-snap-strictness)`
|
|
758
|
+
}
|
|
759
|
+
]],
|
|
760
|
+
["snap-mandatory", { "--un-scroll-snap-strictness": "mandatory" }],
|
|
761
|
+
["snap-proximity", { "--un-scroll-snap-strictness": "proximity" }],
|
|
762
|
+
["snap-none", { "scroll-snap-type": "none" }],
|
|
763
|
+
["snap-start", { "scroll-snap-align": "start" }],
|
|
764
|
+
["snap-end", { "scroll-snap-align": "end" }],
|
|
765
|
+
["snap-center", { "scroll-snap-align": "center" }],
|
|
766
|
+
["snap-align-none", { "scroll-snap-align": "none" }],
|
|
767
|
+
["snap-normal", { "scroll-snap-stop": "normal" }],
|
|
768
|
+
["snap-always", { "scroll-snap-stop": "always" }],
|
|
769
|
+
[/^scroll-ma?()-?(-?.+)$/, directionSize$1("scroll-margin")],
|
|
770
|
+
[/^scroll-m-?([xy])-?(-?.+)$/, directionSize$1("scroll-margin")],
|
|
771
|
+
[/^scroll-m-?([rltb])-?(-?.+)$/, directionSize$1("scroll-margin")],
|
|
772
|
+
[/^scroll-pa?()-?(-?.+)$/, directionSize$1("scroll-padding")],
|
|
773
|
+
[/^scroll-p-?([xy])-?(-?.+)$/, directionSize$1("scroll-padding")],
|
|
774
|
+
[/^scroll-p-?([rltb])-?(-?.+)$/, directionSize$1("scroll-padding")]
|
|
775
|
+
];
|
|
776
|
+
|
|
678
777
|
const rules = [
|
|
679
|
-
screenReadersAccess,
|
|
680
|
-
cssVariables,
|
|
681
778
|
cssVariables$1,
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
779
|
+
cssVariables,
|
|
780
|
+
container,
|
|
781
|
+
screenReadersAccess,
|
|
782
|
+
pointerEvents,
|
|
783
|
+
appearances,
|
|
784
|
+
positions,
|
|
785
|
+
insets,
|
|
685
786
|
lineClamps,
|
|
686
787
|
isolations,
|
|
687
|
-
|
|
788
|
+
zIndexes,
|
|
789
|
+
orders,
|
|
790
|
+
grids,
|
|
791
|
+
floats,
|
|
792
|
+
margins,
|
|
793
|
+
boxSizing,
|
|
688
794
|
displays,
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
795
|
+
aspectRatio,
|
|
796
|
+
sizes,
|
|
797
|
+
flex,
|
|
798
|
+
tables,
|
|
799
|
+
transforms,
|
|
800
|
+
animations,
|
|
801
|
+
cursors,
|
|
802
|
+
touchActions,
|
|
803
|
+
userSelects,
|
|
804
|
+
resizes,
|
|
805
|
+
scrolls,
|
|
806
|
+
listStyle,
|
|
807
|
+
appearance,
|
|
808
|
+
columns,
|
|
809
|
+
placements,
|
|
810
|
+
alignments,
|
|
811
|
+
justifies,
|
|
812
|
+
gaps,
|
|
813
|
+
spaces,
|
|
694
814
|
divides,
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
textIndents,
|
|
815
|
+
overflows,
|
|
816
|
+
overscrolls,
|
|
817
|
+
scrollBehaviors,
|
|
699
818
|
textOverflows,
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
819
|
+
whitespaces,
|
|
820
|
+
breaks,
|
|
821
|
+
borders,
|
|
822
|
+
bgColors,
|
|
823
|
+
boxDecorationBreaks,
|
|
824
|
+
backgroundStyles,
|
|
825
|
+
svgUtilities,
|
|
826
|
+
objectPositions,
|
|
827
|
+
paddings,
|
|
704
828
|
textAligns,
|
|
705
|
-
|
|
706
|
-
|
|
829
|
+
textIndents,
|
|
830
|
+
verticalAligns,
|
|
831
|
+
fonts,
|
|
832
|
+
textTransforms,
|
|
707
833
|
fontStyles,
|
|
834
|
+
fontVariantNumeric,
|
|
835
|
+
textColors,
|
|
836
|
+
textDecorations,
|
|
708
837
|
fontSmoothings,
|
|
838
|
+
tabSizes,
|
|
839
|
+
textStrokes,
|
|
840
|
+
textShadows,
|
|
709
841
|
hyphens,
|
|
710
842
|
writingModes,
|
|
711
843
|
writingOrientations,
|
|
844
|
+
placeholder,
|
|
845
|
+
caretColors,
|
|
846
|
+
caretOpacity,
|
|
847
|
+
accentColors,
|
|
848
|
+
accentOpacity,
|
|
849
|
+
opacity,
|
|
712
850
|
mixBlendModes,
|
|
713
851
|
boxShadows,
|
|
852
|
+
outline,
|
|
714
853
|
rings,
|
|
715
|
-
flex,
|
|
716
|
-
grids,
|
|
717
|
-
gaps,
|
|
718
|
-
sizes,
|
|
719
|
-
aspectRatio,
|
|
720
|
-
cursors,
|
|
721
|
-
appearances,
|
|
722
|
-
pointerEvents,
|
|
723
|
-
resizes,
|
|
724
|
-
verticalAligns,
|
|
725
|
-
userSelects,
|
|
726
|
-
whitespaces,
|
|
727
|
-
listStyle,
|
|
728
|
-
caretColors,
|
|
729
|
-
boxDecorationBreaks,
|
|
730
|
-
caretOpacity,
|
|
731
854
|
imageRenderings,
|
|
732
|
-
breaks,
|
|
733
|
-
overflows,
|
|
734
|
-
outline,
|
|
735
|
-
appearance,
|
|
736
|
-
placeholder,
|
|
737
|
-
overscrolls,
|
|
738
|
-
positions,
|
|
739
|
-
orders,
|
|
740
|
-
justifies,
|
|
741
|
-
placements,
|
|
742
|
-
alignments,
|
|
743
|
-
animations,
|
|
744
|
-
insets,
|
|
745
|
-
floats,
|
|
746
|
-
zIndexes,
|
|
747
|
-
objectPositions,
|
|
748
|
-
boxSizing,
|
|
749
|
-
transitions,
|
|
750
855
|
filters,
|
|
751
|
-
|
|
752
|
-
|
|
856
|
+
transitions,
|
|
857
|
+
willChange,
|
|
858
|
+
contents,
|
|
753
859
|
questionMark
|
|
754
860
|
].flat(1);
|
|
755
861
|
|
|
862
|
+
const variantColorsScheme = [
|
|
863
|
+
variantMatcher("\\.dark", (input) => `.dark $$ ${input}`),
|
|
864
|
+
variantMatcher("\\.light", (input) => `.light $$ ${input}`),
|
|
865
|
+
(v) => {
|
|
866
|
+
const dark = variantMatcher("@dark")(v);
|
|
867
|
+
if (dark) {
|
|
868
|
+
return {
|
|
869
|
+
...dark,
|
|
870
|
+
parent: "@media (prefers-color-scheme: dark)"
|
|
871
|
+
};
|
|
872
|
+
}
|
|
873
|
+
const light = variantMatcher("@light")(v);
|
|
874
|
+
if (light) {
|
|
875
|
+
return {
|
|
876
|
+
...light,
|
|
877
|
+
parent: "@media (prefers-color-scheme: light)"
|
|
878
|
+
};
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
];
|
|
882
|
+
|
|
756
883
|
const presetWind = (options = {}) => ({
|
|
757
884
|
name: "@unocss/preset-wind",
|
|
758
885
|
theme,
|
|
@@ -762,6 +889,7 @@ const presetWind = (options = {}) => ({
|
|
|
762
889
|
],
|
|
763
890
|
variants: [
|
|
764
891
|
...variants,
|
|
892
|
+
...variantColorsScheme,
|
|
765
893
|
...options.dark === "media" ? variantColorsMedia : variantColorsClass
|
|
766
894
|
],
|
|
767
895
|
options
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-wind",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.4",
|
|
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.16.
|
|
39
|
-
"@unocss/preset-mini": "0.16.
|
|
38
|
+
"@unocss/core": "0.16.4",
|
|
39
|
+
"@unocss/preset-mini": "0.16.4"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "unbuild",
|