@unocss/preset-wind 0.41.2 → 0.43.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 CHANGED
@@ -40,8 +40,8 @@ const animations = [
40
40
  [/^animate-delay-(.+)$/, ([, d], { theme }) => ({ "animation-delay": theme.duration?.[d || "DEFAULT"] ?? utils.handler.bracket.cssvar.time(d) }), { autocomplete: ["animate-delay", "animate-delay-$duration"] }],
41
41
  [/^animate-ease(?:-(.+))?$/, ([, d], { theme }) => ({ "animation-timing-function": theme.easing?.[d || "DEFAULT"] ?? utils.handler.bracket.cssvar(d) }), { autocomplete: "animate-delay-$easing" }],
42
42
  [
43
- /^animate-(?:fill-|mode-|fill-mode-)?(none|forwards|backwards|both|inherit|initial|revert|revert-layer|unset)$/,
44
- ([, d]) => ({ "animation-fill-mode": d }),
43
+ /^animate-(fill-mode-|fill-|mode-)?(.+)$/,
44
+ ([, t, d]) => ["none", "forwards", "backwards", "both", ...[t ? utils.globalKeywords : []]].includes(d) ? { "animation-fill-mode": d } : void 0,
45
45
  {
46
46
  autocomplete: [
47
47
  "animate-(fill|mode|fill-mode)",
@@ -51,8 +51,8 @@ const animations = [
51
51
  }
52
52
  ],
53
53
  [
54
- /^animate-(?:direction-)?(normal|reverse|alternate|alternate-reverse|inherit|initial|revert|revert-layer|unset)$/,
55
- ([, d]) => ({ "animation-direction": d }),
54
+ /^animate-(direction-)?(.+)$/,
55
+ ([, t, d]) => ["normal", "reverse", "alternate", "alternate-reverse", ...[t ? utils.globalKeywords : []]].includes(d) ? { "animation-direction": d } : void 0,
56
56
  {
57
57
  autocomplete: [
58
58
  "animate-direction",
@@ -63,8 +63,8 @@ const animations = [
63
63
  ],
64
64
  [/^animate-(?:iteration-|count-|iteration-count-)(.+)$/, ([, d]) => ({ "animation-iteration-count": utils.handler.bracket.cssvar(d) ?? d.replace(/\-/g, ",") }), { autocomplete: ["animate-(iteration|count|iteration-count)", "animate-(iteration|count|iteration-count)-<num>"] }],
65
65
  [
66
- /^animate-(?:play-|state-|play-state-)?(paused|running|inherit|initial|revert|revert-layer|unset)$/,
67
- ([, d]) => ({ "animation-play-state": d }),
66
+ /^animate-(play-state-|play-|state-)?(.+)$/,
67
+ ([, t, d]) => ["paused", "running", ...[t ? utils.globalKeywords : []]].includes(d) ? { "animation-play-state": d } : void 0,
68
68
  {
69
69
  autocomplete: [
70
70
  "animate-(play|state|play-state)",
@@ -73,7 +73,8 @@ const animations = [
73
73
  ]
74
74
  }
75
75
  ],
76
- ["animate-none", { animation: "none" }]
76
+ ["animate-none", { animation: "none" }],
77
+ ...utils.makeGlobalStaticRules("animate", "animation")
77
78
  ];
78
79
 
79
80
  const bgGradientToValue = (cssColor) => {
@@ -206,19 +207,22 @@ const listStyles = {
206
207
  "upper-latin": "upper-latin"
207
208
  };
208
209
  const listStyle = [
209
- [/^list-(.+)(?:-(outside|inside))?$/, ([, style, position]) => {
210
- if (position != null) {
211
- return {
212
- "list-style-position": position,
213
- "list-style-type": listStyles[style]
214
- };
210
+ [/^list-(.+?)(?:-(outside|inside))?$/, ([, alias, position]) => {
211
+ const style = listStyles[alias];
212
+ if (style) {
213
+ if (position) {
214
+ return {
215
+ "list-style-position": position,
216
+ "list-style-type": style
217
+ };
218
+ }
219
+ return { "list-style-type": style };
215
220
  }
216
- return { "list-style-type": listStyles[style] };
217
221
  }, { autocomplete: [`list-(${Object.keys(listStyles).join("|")})`, `list-(${Object.keys(listStyles).join("|")})-(outside|inside)`] }],
218
222
  ["list-outside", { "list-style-position": "outside" }],
219
223
  ["list-inside", { "list-style-position": "inside" }],
220
224
  ["list-none", { "list-style-type": "none" }],
221
- ...utils.makeGlobalStaticRules("list", "list-style")
225
+ ...utils.makeGlobalStaticRules("list", "list-style-type")
222
226
  ];
223
227
  const accents = [
224
228
  [/^accent-(.+)$/, utils.colorResolver("accent-color", "accent"), { autocomplete: "accent-$colors" }],
@@ -651,11 +655,7 @@ const divides = [
651
655
  [/^divide-(block|inline)-reverse$/, ([, d]) => ({ [`--un-divide-${d}-reverse`]: 1 })],
652
656
  [/^divide-(.+)$/, utils.colorResolver("border-color", "divide"), { autocomplete: "divide-$colors" }],
653
657
  [/^divide-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-divide-opacity": utils.handler.bracket.percent(opacity) }), { autocomplete: ["divide-(op|opacity)", "divide-(op|opacity)-<percent>"] }],
654
- ["divide-solid", { "border-style": "solid" }],
655
- ["divide-dashed", { "border-style": "dashed" }],
656
- ["divide-dotted", { "border-style": "dotted" }],
657
- ["divide-double", { "border-style": "double" }],
658
- ["divide-none", { "border-style": "none" }]
658
+ ...rules$1.borderStyles.map((style) => [`divide-${style}`, { "border-style": style }])
659
659
  ];
660
660
  function handlerDivide([, d, s], { theme }) {
661
661
  const v = theme.lineWidth?.[s || "DEFAULT"] ?? utils.handler.bracket.cssvar.px(s || "1");
@@ -682,10 +682,10 @@ const lineClamps = [
682
682
  "-webkit-line-clamp": v,
683
683
  "line-clamp": v
684
684
  }), { autocomplete: ["line-clamp", "line-clamp-<num>"] }],
685
- ["line-clamp-none", {
686
- "-webkit-line-clamp": "unset",
687
- "line-clamp": "unset"
688
- }]
685
+ ...["none", ...utils.globalKeywords].map((keyword) => [`line-clamp-${keyword}`, {
686
+ "-webkit-line-clamp": keyword,
687
+ "line-clamp": keyword
688
+ }])
689
689
  ];
690
690
 
691
691
  const fontVariantNumericBase = {
@@ -1134,7 +1134,8 @@ const presetWind = (options = {}) => {
1134
1134
  shortcuts,
1135
1135
  variants: variants(options),
1136
1136
  options,
1137
- preflights: presetMini.preflights
1137
+ preflights: presetMini.preflights,
1138
+ prefix: options.prefix
1138
1139
  };
1139
1140
  };
1140
1141
 
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { preflights } from '@unocss/preset-mini';
2
2
  export { colors, preflights } from '@unocss/preset-mini';
3
- import { handler, positionMap, makeGlobalStaticRules, globalKeywords, parseColor, colorToString, colorOpacityToString, colorResolver, resolveBreakpoints, colorableShadows, directionMap, directionSize, variantMatcher, variantParentMatcher, hasParseableColor } from '@unocss/preset-mini/utils';
4
- 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
+ import { handler, globalKeywords, makeGlobalStaticRules, positionMap, parseColor, colorToString, colorOpacityToString, colorResolver, resolveBreakpoints, colorableShadows, directionMap, directionSize, variantMatcher, variantParentMatcher, hasParseableColor } from '@unocss/preset-mini/utils';
4
+ import { varEmpty, borderStyles, 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';
5
5
  import { theme as theme$1 } from '@unocss/preset-mini/theme';
6
6
  import { variants as variants$1 } from '@unocss/preset-mini/variants';
7
7
 
@@ -37,8 +37,8 @@ const animations = [
37
37
  [/^animate-delay-(.+)$/, ([, d], { theme }) => ({ "animation-delay": theme.duration?.[d || "DEFAULT"] ?? handler.bracket.cssvar.time(d) }), { autocomplete: ["animate-delay", "animate-delay-$duration"] }],
38
38
  [/^animate-ease(?:-(.+))?$/, ([, d], { theme }) => ({ "animation-timing-function": theme.easing?.[d || "DEFAULT"] ?? handler.bracket.cssvar(d) }), { autocomplete: "animate-delay-$easing" }],
39
39
  [
40
- /^animate-(?:fill-|mode-|fill-mode-)?(none|forwards|backwards|both|inherit|initial|revert|revert-layer|unset)$/,
41
- ([, d]) => ({ "animation-fill-mode": d }),
40
+ /^animate-(fill-mode-|fill-|mode-)?(.+)$/,
41
+ ([, t, d]) => ["none", "forwards", "backwards", "both", ...[t ? globalKeywords : []]].includes(d) ? { "animation-fill-mode": d } : void 0,
42
42
  {
43
43
  autocomplete: [
44
44
  "animate-(fill|mode|fill-mode)",
@@ -48,8 +48,8 @@ const animations = [
48
48
  }
49
49
  ],
50
50
  [
51
- /^animate-(?:direction-)?(normal|reverse|alternate|alternate-reverse|inherit|initial|revert|revert-layer|unset)$/,
52
- ([, d]) => ({ "animation-direction": d }),
51
+ /^animate-(direction-)?(.+)$/,
52
+ ([, t, d]) => ["normal", "reverse", "alternate", "alternate-reverse", ...[t ? globalKeywords : []]].includes(d) ? { "animation-direction": d } : void 0,
53
53
  {
54
54
  autocomplete: [
55
55
  "animate-direction",
@@ -60,8 +60,8 @@ const animations = [
60
60
  ],
61
61
  [/^animate-(?:iteration-|count-|iteration-count-)(.+)$/, ([, d]) => ({ "animation-iteration-count": handler.bracket.cssvar(d) ?? d.replace(/\-/g, ",") }), { autocomplete: ["animate-(iteration|count|iteration-count)", "animate-(iteration|count|iteration-count)-<num>"] }],
62
62
  [
63
- /^animate-(?:play-|state-|play-state-)?(paused|running|inherit|initial|revert|revert-layer|unset)$/,
64
- ([, d]) => ({ "animation-play-state": d }),
63
+ /^animate-(play-state-|play-|state-)?(.+)$/,
64
+ ([, t, d]) => ["paused", "running", ...[t ? globalKeywords : []]].includes(d) ? { "animation-play-state": d } : void 0,
65
65
  {
66
66
  autocomplete: [
67
67
  "animate-(play|state|play-state)",
@@ -70,7 +70,8 @@ const animations = [
70
70
  ]
71
71
  }
72
72
  ],
73
- ["animate-none", { animation: "none" }]
73
+ ["animate-none", { animation: "none" }],
74
+ ...makeGlobalStaticRules("animate", "animation")
74
75
  ];
75
76
 
76
77
  const bgGradientToValue = (cssColor) => {
@@ -203,19 +204,22 @@ const listStyles = {
203
204
  "upper-latin": "upper-latin"
204
205
  };
205
206
  const listStyle = [
206
- [/^list-(.+)(?:-(outside|inside))?$/, ([, style, position]) => {
207
- if (position != null) {
208
- return {
209
- "list-style-position": position,
210
- "list-style-type": listStyles[style]
211
- };
207
+ [/^list-(.+?)(?:-(outside|inside))?$/, ([, alias, position]) => {
208
+ const style = listStyles[alias];
209
+ if (style) {
210
+ if (position) {
211
+ return {
212
+ "list-style-position": position,
213
+ "list-style-type": style
214
+ };
215
+ }
216
+ return { "list-style-type": style };
212
217
  }
213
- return { "list-style-type": listStyles[style] };
214
218
  }, { autocomplete: [`list-(${Object.keys(listStyles).join("|")})`, `list-(${Object.keys(listStyles).join("|")})-(outside|inside)`] }],
215
219
  ["list-outside", { "list-style-position": "outside" }],
216
220
  ["list-inside", { "list-style-position": "inside" }],
217
221
  ["list-none", { "list-style-type": "none" }],
218
- ...makeGlobalStaticRules("list", "list-style")
222
+ ...makeGlobalStaticRules("list", "list-style-type")
219
223
  ];
220
224
  const accents = [
221
225
  [/^accent-(.+)$/, colorResolver("accent-color", "accent"), { autocomplete: "accent-$colors" }],
@@ -648,11 +652,7 @@ const divides = [
648
652
  [/^divide-(block|inline)-reverse$/, ([, d]) => ({ [`--un-divide-${d}-reverse`]: 1 })],
649
653
  [/^divide-(.+)$/, colorResolver("border-color", "divide"), { autocomplete: "divide-$colors" }],
650
654
  [/^divide-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-divide-opacity": handler.bracket.percent(opacity) }), { autocomplete: ["divide-(op|opacity)", "divide-(op|opacity)-<percent>"] }],
651
- ["divide-solid", { "border-style": "solid" }],
652
- ["divide-dashed", { "border-style": "dashed" }],
653
- ["divide-dotted", { "border-style": "dotted" }],
654
- ["divide-double", { "border-style": "double" }],
655
- ["divide-none", { "border-style": "none" }]
655
+ ...borderStyles.map((style) => [`divide-${style}`, { "border-style": style }])
656
656
  ];
657
657
  function handlerDivide([, d, s], { theme }) {
658
658
  const v = theme.lineWidth?.[s || "DEFAULT"] ?? handler.bracket.cssvar.px(s || "1");
@@ -679,10 +679,10 @@ const lineClamps = [
679
679
  "-webkit-line-clamp": v,
680
680
  "line-clamp": v
681
681
  }), { autocomplete: ["line-clamp", "line-clamp-<num>"] }],
682
- ["line-clamp-none", {
683
- "-webkit-line-clamp": "unset",
684
- "line-clamp": "unset"
685
- }]
682
+ ...["none", ...globalKeywords].map((keyword) => [`line-clamp-${keyword}`, {
683
+ "-webkit-line-clamp": keyword,
684
+ "line-clamp": keyword
685
+ }])
686
686
  ];
687
687
 
688
688
  const fontVariantNumericBase = {
@@ -1131,7 +1131,8 @@ const presetWind = (options = {}) => {
1131
1131
  shortcuts,
1132
1132
  variants: variants(options),
1133
1133
  options,
1134
- preflights
1134
+ preflights,
1135
+ prefix: options.prefix
1135
1136
  };
1136
1137
  };
1137
1138
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/preset-wind",
3
- "version": "0.41.2",
3
+ "version": "0.43.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.41.2",
39
- "@unocss/preset-mini": "0.41.2"
38
+ "@unocss/core": "0.43.0",
39
+ "@unocss/preset-mini": "0.43.0"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "unbuild",