@unocss/preset-wind 0.36.0 → 0.37.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 CHANGED
@@ -150,10 +150,10 @@ const backgroundStyles = [
150
150
  ["bg-fixed", { "background-attachment": "fixed" }],
151
151
  ["bg-local", { "background-attachment": "local" }],
152
152
  ["bg-scroll", { "background-attachment": "scroll" }],
153
- ["bg-clip-border", { "-webkit-background-clip": "border-box", "background-attachment": "border-box" }],
154
- ["bg-clip-content", { "-webkit-background-clip": "content-box", "background-attachment": "content-box" }],
155
- ["bg-clip-padding", { "-webkit-background-clip": "padding-box", "background-attachment": "padding-box" }],
156
- ["bg-clip-text", { "-webkit-background-clip": "text", "background-attachment": "text" }],
153
+ ["bg-clip-border", { "-webkit-background-clip": "border-box", "background-clip": "border-box" }],
154
+ ["bg-clip-content", { "-webkit-background-clip": "content-box", "background-clip": "content-box" }],
155
+ ["bg-clip-padding", { "-webkit-background-clip": "padding-box", "background-clip": "padding-box" }],
156
+ ["bg-clip-text", { "-webkit-background-clip": "text", "background-clip": "text" }],
157
157
  [/^bg-([-\w]{3,})$/, ([, s]) => ({ "background-position": utils.positionMap[s] })],
158
158
  ["bg-repeat", { "background-repeat": "repeat" }],
159
159
  ["bg-no-repeat", { "background-repeat": "no-repeat" }],
@@ -530,6 +530,10 @@ const mixBlendModes = [
530
530
  ["mix-blend-normal", { "mix-blend-mode": "normal" }]
531
531
  ];
532
532
 
533
+ const borderSpacingBase = {
534
+ "--un-border-spacing-x": 0,
535
+ "--un-border-spacing-y": 0
536
+ };
533
537
  const tables = [
534
538
  ["inline-table", { display: "inline-table" }],
535
539
  ["table", { display: "table" }],
@@ -543,7 +547,25 @@ const tables = [
543
547
  ["table-row-group", { display: "table-row-group" }],
544
548
  ["border-collapse", { "border-collapse": "collapse" }],
545
549
  ["border-separate", { "border-collapse": "separate" }],
546
- [/^border-spacing-(.+)$/, ([, d], { theme }) => ({ "border-spacing": theme.spacing?.[d] ?? utils.handler.bracket.cssvar.auto.fraction.rem(d) }), { autocomplete: ["border-spacing", "border-spacing-$spacing"] }],
550
+ [/^border-spacing-(.+)$/, ([, s], { theme }) => {
551
+ const v = theme.spacing?.[s] ?? utils.handler.bracket.cssvar.global.auto.fraction.rem(s);
552
+ if (v != null) {
553
+ return {
554
+ "--un-border-spacing-x": v,
555
+ "--un-border-spacing-y": v,
556
+ "border-spacing": "var(--un-border-spacing-x) var(--un-border-spacing-y)"
557
+ };
558
+ }
559
+ }, { autocomplete: ["border-spacing", "border-spacing-$spacing"] }],
560
+ [/^border-spacing-([xy])-(.+)$/, ([, d, s], { theme }) => {
561
+ const v = theme.spacing?.[s] ?? utils.handler.bracket.cssvar.global.auto.fraction.rem(s);
562
+ if (v != null) {
563
+ return {
564
+ [`--un-border-spacing-${d}`]: v,
565
+ "border-spacing": "var(--un-border-spacing-x) var(--un-border-spacing-y)"
566
+ };
567
+ }
568
+ }, { autocomplete: ["border-spacing-(x|y)", "border-spacing-(x|y)-$spacing"] }],
547
569
  ["caption-top", { "caption-side": "top" }],
548
570
  ["caption-bottom", { "caption-side": "bottom" }],
549
571
  ["table-auto", { "table-layout": "auto" }],
@@ -627,16 +649,12 @@ const fontVariantNumericBase = {
627
649
  "--un-numeric-figure": rules$1.varEmpty,
628
650
  "--un-numeric-spacing": rules$1.varEmpty,
629
651
  "--un-numeric-fraction": rules$1.varEmpty,
630
- "--un-font-variant-numeric": "var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)",
631
- [core.CONTROL_SHORTCUT_NO_MERGE]: ""
652
+ "--un-font-variant-numeric": "var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)"
632
653
  };
633
- const toEntries = (entry) => [
634
- fontVariantNumericBase,
635
- {
636
- ...entry,
637
- "font-variant-numeric": "var(--un-font-variant-numeric)"
638
- }
639
- ];
654
+ const toEntries = (entry) => ({
655
+ ...entry,
656
+ "font-variant-numeric": "var(--un-font-variant-numeric)"
657
+ });
640
658
  const fontVariantNumeric = [
641
659
  [/^ordinal$/, () => toEntries({ "--un-ordinal": "ordinal" }), { autocomplete: "ordinal" }],
642
660
  [/^slashed-zero$/, () => toEntries({ "--un-slashed-zero": "slashed-zero" }), { autocomplete: "slashed-zero" }],
@@ -653,46 +671,36 @@ const touchActionBase = {
653
671
  "--un-pan-x": rules$1.varEmpty,
654
672
  "--un-pan-y": rules$1.varEmpty,
655
673
  "--un-pinch-zoom": rules$1.varEmpty,
656
- "--un-touch-action": "var(--un-pan-x) var(--un-pan-y) var(--un-pinch-zoom)",
657
- [core.CONTROL_SHORTCUT_NO_MERGE]: ""
674
+ "--un-touch-action": "var(--un-pan-x) var(--un-pan-y) var(--un-pinch-zoom)"
658
675
  };
659
676
  const touchActions = [
660
- [/^touch-pan-(x|left|right)$/, ([, d]) => [
661
- touchActionBase,
662
- {
663
- "--un-pan-x": `pan-${d}`,
664
- "touch-action": "var(--un-touch-action)"
665
- }
666
- ], { autocomplete: ["touch-pan", "touch-pan-(x|left|right|y|up|down)"] }],
667
- [/^touch-pan-(y|up|down)$/, ([, d]) => [
668
- touchActionBase,
669
- {
670
- "--un-pan-y": `pan-${d}`,
671
- "touch-action": "var(--un-touch-action)"
672
- }
673
- ]],
674
- [/^touch-pinch-zoom$/, () => [
675
- touchActionBase,
676
- {
677
- "--un-pinch-zoom": "pinch-zoom",
678
- "touch-action": "var(--un-touch-action)"
679
- }
680
- ], { autocomplete: ["touch-pinch", "touch-pinch-zoom"] }],
677
+ [/^touch-pan-(x|left|right)$/, ([, d]) => ({
678
+ "--un-pan-x": `pan-${d}`,
679
+ "touch-action": "var(--un-touch-action)"
680
+ }), { autocomplete: ["touch-pan", "touch-pan-(x|left|right|y|up|down)"] }],
681
+ [/^touch-pan-(y|up|down)$/, ([, d]) => ({
682
+ "--un-pan-y": `pan-${d}`,
683
+ "touch-action": "var(--un-touch-action)"
684
+ })],
685
+ ["touch-pinch-zoom", {
686
+ "--un-pinch-zoom": "pinch-zoom",
687
+ "touch-action": "var(--un-touch-action)"
688
+ }],
681
689
  ["touch-auto", { "touch-action": "auto" }],
682
690
  ["touch-manipulation", { "touch-action": "manipulation" }],
683
691
  ["touch-none", { "touch-action": "none" }]
684
692
  ];
685
693
 
694
+ const scrollSnapTypeBase = {
695
+ "--un-scroll-snap-strictness": "proximity"
696
+ };
686
697
  const scrolls = [
687
- [/^snap-(x|y|both)$/, ([, d]) => [
688
- {
689
- "--un-scroll-snap-strictness": "proximity",
690
- [core.CONTROL_SHORTCUT_NO_MERGE]: ""
691
- },
692
- {
693
- "scroll-snap-type": `${d} var(--un-scroll-snap-strictness)`
694
- }
695
- ], { autocomplete: "snap-(x|y|both)" }],
698
+ [/^snap-(x|y)$/, ([, d]) => ({
699
+ "scroll-snap-type": `${d} var(--un-scroll-snap-strictness)`
700
+ }), { autocomplete: "snap-(x|y|both)" }],
701
+ [/^snap-both$/, () => ({
702
+ "scroll-snap-type": "both var(--un-scroll-snap-strictness)"
703
+ })],
696
704
  ["snap-mandatory", { "--un-scroll-snap-strictness": "mandatory" }],
697
705
  ["snap-proximity", { "--un-scroll-snap-strictness": "proximity" }],
698
706
  ["snap-none", { "scroll-snap-type": "none" }],
@@ -988,6 +996,12 @@ const theme = {
988
996
  },
989
997
  preflightBase: {
990
998
  ...rules$1.transformBase,
999
+ ...touchActionBase,
1000
+ ...scrollSnapTypeBase,
1001
+ ...fontVariantNumericBase,
1002
+ ...borderSpacingBase,
1003
+ ...rules$1.boxShadowsBase,
1004
+ ...rules$1.ringBase,
991
1005
  ...filterBase,
992
1006
  ...backdropFilterBase
993
1007
  }
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import { preflights } from '@unocss/preset-mini';
2
2
  export { colors, preflights } from '@unocss/preset-mini';
3
- import { toArray, CONTROL_SHORTCUT_NO_MERGE } from '@unocss/core';
3
+ import { toArray } from '@unocss/core';
4
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 } from '@unocss/preset-mini/rules';
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';
6
6
  import { theme as theme$1 } from '@unocss/preset-mini/theme';
7
7
  import { variants as variants$1 } from '@unocss/preset-mini/variants';
8
8
 
@@ -147,10 +147,10 @@ const backgroundStyles = [
147
147
  ["bg-fixed", { "background-attachment": "fixed" }],
148
148
  ["bg-local", { "background-attachment": "local" }],
149
149
  ["bg-scroll", { "background-attachment": "scroll" }],
150
- ["bg-clip-border", { "-webkit-background-clip": "border-box", "background-attachment": "border-box" }],
151
- ["bg-clip-content", { "-webkit-background-clip": "content-box", "background-attachment": "content-box" }],
152
- ["bg-clip-padding", { "-webkit-background-clip": "padding-box", "background-attachment": "padding-box" }],
153
- ["bg-clip-text", { "-webkit-background-clip": "text", "background-attachment": "text" }],
150
+ ["bg-clip-border", { "-webkit-background-clip": "border-box", "background-clip": "border-box" }],
151
+ ["bg-clip-content", { "-webkit-background-clip": "content-box", "background-clip": "content-box" }],
152
+ ["bg-clip-padding", { "-webkit-background-clip": "padding-box", "background-clip": "padding-box" }],
153
+ ["bg-clip-text", { "-webkit-background-clip": "text", "background-clip": "text" }],
154
154
  [/^bg-([-\w]{3,})$/, ([, s]) => ({ "background-position": positionMap[s] })],
155
155
  ["bg-repeat", { "background-repeat": "repeat" }],
156
156
  ["bg-no-repeat", { "background-repeat": "no-repeat" }],
@@ -527,6 +527,10 @@ const mixBlendModes = [
527
527
  ["mix-blend-normal", { "mix-blend-mode": "normal" }]
528
528
  ];
529
529
 
530
+ const borderSpacingBase = {
531
+ "--un-border-spacing-x": 0,
532
+ "--un-border-spacing-y": 0
533
+ };
530
534
  const tables = [
531
535
  ["inline-table", { display: "inline-table" }],
532
536
  ["table", { display: "table" }],
@@ -540,7 +544,25 @@ const tables = [
540
544
  ["table-row-group", { display: "table-row-group" }],
541
545
  ["border-collapse", { "border-collapse": "collapse" }],
542
546
  ["border-separate", { "border-collapse": "separate" }],
543
- [/^border-spacing-(.+)$/, ([, d], { theme }) => ({ "border-spacing": theme.spacing?.[d] ?? handler.bracket.cssvar.auto.fraction.rem(d) }), { autocomplete: ["border-spacing", "border-spacing-$spacing"] }],
547
+ [/^border-spacing-(.+)$/, ([, s], { theme }) => {
548
+ const v = theme.spacing?.[s] ?? handler.bracket.cssvar.global.auto.fraction.rem(s);
549
+ if (v != null) {
550
+ return {
551
+ "--un-border-spacing-x": v,
552
+ "--un-border-spacing-y": v,
553
+ "border-spacing": "var(--un-border-spacing-x) var(--un-border-spacing-y)"
554
+ };
555
+ }
556
+ }, { autocomplete: ["border-spacing", "border-spacing-$spacing"] }],
557
+ [/^border-spacing-([xy])-(.+)$/, ([, d, s], { theme }) => {
558
+ const v = theme.spacing?.[s] ?? handler.bracket.cssvar.global.auto.fraction.rem(s);
559
+ if (v != null) {
560
+ return {
561
+ [`--un-border-spacing-${d}`]: v,
562
+ "border-spacing": "var(--un-border-spacing-x) var(--un-border-spacing-y)"
563
+ };
564
+ }
565
+ }, { autocomplete: ["border-spacing-(x|y)", "border-spacing-(x|y)-$spacing"] }],
544
566
  ["caption-top", { "caption-side": "top" }],
545
567
  ["caption-bottom", { "caption-side": "bottom" }],
546
568
  ["table-auto", { "table-layout": "auto" }],
@@ -624,16 +646,12 @@ const fontVariantNumericBase = {
624
646
  "--un-numeric-figure": varEmpty,
625
647
  "--un-numeric-spacing": varEmpty,
626
648
  "--un-numeric-fraction": varEmpty,
627
- "--un-font-variant-numeric": "var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)",
628
- [CONTROL_SHORTCUT_NO_MERGE]: ""
649
+ "--un-font-variant-numeric": "var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)"
629
650
  };
630
- const toEntries = (entry) => [
631
- fontVariantNumericBase,
632
- {
633
- ...entry,
634
- "font-variant-numeric": "var(--un-font-variant-numeric)"
635
- }
636
- ];
651
+ const toEntries = (entry) => ({
652
+ ...entry,
653
+ "font-variant-numeric": "var(--un-font-variant-numeric)"
654
+ });
637
655
  const fontVariantNumeric = [
638
656
  [/^ordinal$/, () => toEntries({ "--un-ordinal": "ordinal" }), { autocomplete: "ordinal" }],
639
657
  [/^slashed-zero$/, () => toEntries({ "--un-slashed-zero": "slashed-zero" }), { autocomplete: "slashed-zero" }],
@@ -650,46 +668,36 @@ const touchActionBase = {
650
668
  "--un-pan-x": varEmpty,
651
669
  "--un-pan-y": varEmpty,
652
670
  "--un-pinch-zoom": varEmpty,
653
- "--un-touch-action": "var(--un-pan-x) var(--un-pan-y) var(--un-pinch-zoom)",
654
- [CONTROL_SHORTCUT_NO_MERGE]: ""
671
+ "--un-touch-action": "var(--un-pan-x) var(--un-pan-y) var(--un-pinch-zoom)"
655
672
  };
656
673
  const touchActions = [
657
- [/^touch-pan-(x|left|right)$/, ([, d]) => [
658
- touchActionBase,
659
- {
660
- "--un-pan-x": `pan-${d}`,
661
- "touch-action": "var(--un-touch-action)"
662
- }
663
- ], { autocomplete: ["touch-pan", "touch-pan-(x|left|right|y|up|down)"] }],
664
- [/^touch-pan-(y|up|down)$/, ([, d]) => [
665
- touchActionBase,
666
- {
667
- "--un-pan-y": `pan-${d}`,
668
- "touch-action": "var(--un-touch-action)"
669
- }
670
- ]],
671
- [/^touch-pinch-zoom$/, () => [
672
- touchActionBase,
673
- {
674
- "--un-pinch-zoom": "pinch-zoom",
675
- "touch-action": "var(--un-touch-action)"
676
- }
677
- ], { autocomplete: ["touch-pinch", "touch-pinch-zoom"] }],
674
+ [/^touch-pan-(x|left|right)$/, ([, d]) => ({
675
+ "--un-pan-x": `pan-${d}`,
676
+ "touch-action": "var(--un-touch-action)"
677
+ }), { autocomplete: ["touch-pan", "touch-pan-(x|left|right|y|up|down)"] }],
678
+ [/^touch-pan-(y|up|down)$/, ([, d]) => ({
679
+ "--un-pan-y": `pan-${d}`,
680
+ "touch-action": "var(--un-touch-action)"
681
+ })],
682
+ ["touch-pinch-zoom", {
683
+ "--un-pinch-zoom": "pinch-zoom",
684
+ "touch-action": "var(--un-touch-action)"
685
+ }],
678
686
  ["touch-auto", { "touch-action": "auto" }],
679
687
  ["touch-manipulation", { "touch-action": "manipulation" }],
680
688
  ["touch-none", { "touch-action": "none" }]
681
689
  ];
682
690
 
691
+ const scrollSnapTypeBase = {
692
+ "--un-scroll-snap-strictness": "proximity"
693
+ };
683
694
  const scrolls = [
684
- [/^snap-(x|y|both)$/, ([, d]) => [
685
- {
686
- "--un-scroll-snap-strictness": "proximity",
687
- [CONTROL_SHORTCUT_NO_MERGE]: ""
688
- },
689
- {
690
- "scroll-snap-type": `${d} var(--un-scroll-snap-strictness)`
691
- }
692
- ], { autocomplete: "snap-(x|y|both)" }],
695
+ [/^snap-(x|y)$/, ([, d]) => ({
696
+ "scroll-snap-type": `${d} var(--un-scroll-snap-strictness)`
697
+ }), { autocomplete: "snap-(x|y|both)" }],
698
+ [/^snap-both$/, () => ({
699
+ "scroll-snap-type": "both var(--un-scroll-snap-strictness)"
700
+ })],
693
701
  ["snap-mandatory", { "--un-scroll-snap-strictness": "mandatory" }],
694
702
  ["snap-proximity", { "--un-scroll-snap-strictness": "proximity" }],
695
703
  ["snap-none", { "scroll-snap-type": "none" }],
@@ -985,6 +993,12 @@ const theme = {
985
993
  },
986
994
  preflightBase: {
987
995
  ...transformBase,
996
+ ...touchActionBase,
997
+ ...scrollSnapTypeBase,
998
+ ...fontVariantNumericBase,
999
+ ...borderSpacingBase,
1000
+ ...boxShadowsBase,
1001
+ ...ringBase,
988
1002
  ...filterBase,
989
1003
  ...backdropFilterBase
990
1004
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/preset-wind",
3
- "version": "0.36.0",
3
+ "version": "0.37.2",
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.36.0",
39
- "@unocss/preset-mini": "0.36.0"
38
+ "@unocss/core": "0.37.2",
39
+ "@unocss/preset-mini": "0.37.2"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "unbuild",