@unocss/preset-wind 0.41.0 → 0.42.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) => {
@@ -162,6 +163,7 @@ const backgroundStyles = [
162
163
  ["bg-none", { "background-image": "none" }],
163
164
  ["box-decoration-slice", { "box-decoration-break": "slice" }],
164
165
  ["box-decoration-clone", { "box-decoration-break": "clone" }],
166
+ ...utils.makeGlobalStaticRules("box-decoration", "box-decoration-break"),
165
167
  ["bg-auto", { "background-size": "auto" }],
166
168
  ["bg-cover", { "background-size": "cover" }],
167
169
  ["bg-contain", { "background-size": "contain" }],
@@ -172,6 +174,10 @@ const backgroundStyles = [
172
174
  ["bg-clip-content", { "-webkit-background-clip": "content-box", "background-clip": "content-box" }],
173
175
  ["bg-clip-padding", { "-webkit-background-clip": "padding-box", "background-clip": "padding-box" }],
174
176
  ["bg-clip-text", { "-webkit-background-clip": "text", "background-clip": "text" }],
177
+ ...utils.globalKeywords.map((keyword) => [`bg-clip-${keyword}`, {
178
+ "-webkit-background-clip": keyword,
179
+ "background-clip": keyword
180
+ }]),
175
181
  [/^bg-([-\w]{3,})$/, ([, s]) => ({ "background-position": utils.positionMap[s] })],
176
182
  ["bg-repeat", { "background-repeat": "repeat" }],
177
183
  ["bg-no-repeat", { "background-repeat": "no-repeat" }],
@@ -179,9 +185,11 @@ const backgroundStyles = [
179
185
  ["bg-repeat-y", { "background-repeat": "repeat-y" }],
180
186
  ["bg-repeat-round", { "background-repeat": "round" }],
181
187
  ["bg-repeat-space", { "background-repeat": "space" }],
188
+ ...utils.makeGlobalStaticRules("bg-repeat", "background-repeat"),
182
189
  ["bg-origin-border", { "background-origin": "border-box" }],
183
190
  ["bg-origin-padding", { "background-origin": "padding-box" }],
184
- ["bg-origin-content", { "background-origin": "content-box" }]
191
+ ["bg-origin-content", { "background-origin": "content-box" }],
192
+ ...utils.makeGlobalStaticRules("bg-origin", "background-origin")
185
193
  ];
186
194
 
187
195
  const listStyles = {
@@ -199,18 +207,22 @@ const listStyles = {
199
207
  "upper-latin": "upper-latin"
200
208
  };
201
209
  const listStyle = [
202
- [/^list-(.+)(?:-(outside|inside))?$/, ([, style, position]) => {
203
- if (position != null) {
204
- return {
205
- "list-style-position": position,
206
- "list-style-type": listStyles[style]
207
- };
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 };
208
220
  }
209
- return { "list-style-type": listStyles[style] };
210
221
  }, { autocomplete: [`list-(${Object.keys(listStyles).join("|")})`, `list-(${Object.keys(listStyles).join("|")})-(outside|inside)`] }],
211
222
  ["list-outside", { "list-style-position": "outside" }],
212
223
  ["list-inside", { "list-style-position": "inside" }],
213
- ["list-none", { "list-style-type": "none" }]
224
+ ["list-none", { "list-style-type": "none" }],
225
+ ...utils.makeGlobalStaticRules("list", "list-style-type")
214
226
  ];
215
227
  const accents = [
216
228
  [/^accent-(.+)$/, utils.colorResolver("accent-color", "accent"), { autocomplete: "accent-$colors" }],
@@ -235,16 +247,20 @@ const overscrolls = [
235
247
  ["overscroll-auto", { "overscroll-behavior": "auto" }],
236
248
  ["overscroll-contain", { "overscroll-behavior": "contain" }],
237
249
  ["overscroll-none", { "overscroll-behavior": "none" }],
250
+ ...utils.makeGlobalStaticRules("overscroll", "overscroll-behavior"),
238
251
  ["overscroll-x-auto", { "overscroll-behavior-x": "auto" }],
239
252
  ["overscroll-x-contain", { "overscroll-behavior-x": "contain" }],
240
253
  ["overscroll-x-none", { "overscroll-behavior-x": "none" }],
254
+ ...utils.makeGlobalStaticRules("overscroll-x", "overscroll-behavior-x"),
241
255
  ["overscroll-y-auto", { "overscroll-behavior-y": "auto" }],
242
256
  ["overscroll-y-contain", { "overscroll-behavior-y": "contain" }],
243
- ["overscroll-y-none", { "overscroll-behavior-y": "none" }]
257
+ ["overscroll-y-none", { "overscroll-behavior-y": "none" }],
258
+ ...utils.makeGlobalStaticRules("overscroll-y", "overscroll-behavior-y")
244
259
  ];
245
260
  const scrollBehaviors = [
246
261
  ["scroll-auto", { "scroll-behavior": "auto" }],
247
- ["scroll-smooth", { "scroll-behavior": "smooth" }]
262
+ ["scroll-smooth", { "scroll-behavior": "smooth" }],
263
+ ...utils.makeGlobalStaticRules("scroll", "scroll-behavior")
248
264
  ];
249
265
 
250
266
  const columns = [
@@ -257,10 +273,12 @@ const columns = [
257
273
  ["break-before-left", { "break-before": "left" }],
258
274
  ["break-before-right", { "break-before": "right" }],
259
275
  ["break-before-column", { "break-before": "column" }],
276
+ ...utils.makeGlobalStaticRules("break-before"),
260
277
  ["break-inside-auto", { "break-inside": "auto" }],
261
278
  ["break-inside-avoid", { "break-inside": "avoid" }],
262
279
  ["break-inside-avoid-page", { "break-inside": "avoid-page" }],
263
280
  ["break-inside-avoid-column", { "break-inside": "avoid-column" }],
281
+ ...utils.makeGlobalStaticRules("break-inside"),
264
282
  ["break-after-auto", { "break-after": "auto" }],
265
283
  ["break-after-avoid", { "break-after": "avoid" }],
266
284
  ["break-after-all", { "break-after": "all" }],
@@ -268,14 +286,15 @@ const columns = [
268
286
  ["break-after-page", { "break-after": "page" }],
269
287
  ["break-after-left", { "break-after": "left" }],
270
288
  ["break-after-right", { "break-after": "right" }],
271
- ["break-after-column", { "break-after": "column" }]
289
+ ["break-after-column", { "break-after": "column" }],
290
+ ...utils.makeGlobalStaticRules("break-after")
272
291
  ];
273
292
 
274
293
  const queryMatcher = /@media \(min-width: (.+)\)/;
275
294
  const container = [
276
295
  [
277
296
  /^__container$/,
278
- (m, { variantHandlers }) => {
297
+ (m, { theme, variantHandlers }) => {
279
298
  let width = "100%";
280
299
  for (const v of variantHandlers) {
281
300
  const query = v.handle?.({}, (x) => x)?.parent;
@@ -285,6 +304,13 @@ const container = [
285
304
  width = match;
286
305
  }
287
306
  }
307
+ if (theme.container?.center) {
308
+ return {
309
+ "max-width": width,
310
+ "margin-left": "auto",
311
+ "margin-right": "auto"
312
+ };
313
+ }
288
314
  return { "max-width": width };
289
315
  },
290
316
  { internal: true }
@@ -409,7 +435,12 @@ const filters = [
409
435
  ["backdrop-filter-none", {
410
436
  "-webkit-backdrop-filter": "none",
411
437
  "backdrop-filter": "none"
412
- }]
438
+ }],
439
+ ...utils.globalKeywords.map((keyword) => [`filter-${keyword}`, { filter: keyword }]),
440
+ ...utils.globalKeywords.map((keyword) => [`backdrop-filter-${keyword}`, {
441
+ "-webkit-backdrop-filter": keyword,
442
+ "backdrop-filter": keyword
443
+ }])
413
444
  ];
414
445
 
415
446
  const spaces = [
@@ -442,31 +473,23 @@ const textTransforms = [
442
473
  ["normal-case", { "text-transform": "none" }]
443
474
  ];
444
475
  const hyphens = [
445
- ["hyphens-manual", {
446
- "-webkit-hyphens": "manual",
447
- "-ms-hyphens": "manual",
448
- "hyphens": "manual"
449
- }],
450
- ["hyphens-auto", {
451
- "-webkit-hyphens": "auto",
452
- "-ms-hyphens": "auto",
453
- "hyphens": "auto"
454
- }],
455
- ["hyphens-none", {
456
- "-webkit-hyphens": "none",
457
- "-ms-hyphens": "none",
458
- "hyphens": "none"
459
- }]
476
+ ...["manual", "auto", "none", ...utils.globalKeywords].map((keyword) => [`hyphens-${keyword}`, {
477
+ "-webkit-hyphens": keyword,
478
+ "-ms-hyphens": keyword,
479
+ "hyphens": keyword
480
+ }])
460
481
  ];
461
482
  const writingModes = [
462
483
  ["write-vertical-right", { "writing-mode": "vertical-rl" }],
463
484
  ["write-vertical-left", { "writing-mode": "vertical-lr" }],
464
- ["write-normal", { "writing-mode": "horizontal-tb" }]
485
+ ["write-normal", { "writing-mode": "horizontal-tb" }],
486
+ ...utils.makeGlobalStaticRules("write", "writing-mode")
465
487
  ];
466
488
  const writingOrientations = [
467
489
  ["write-orient-mixed", { "text-orientation": "mixed" }],
468
490
  ["write-orient-sideways", { "text-orientation": "sideways" }],
469
- ["write-orient-upright", { "text-orientation": "upright" }]
491
+ ["write-orient-upright", { "text-orientation": "upright" }],
492
+ ...utils.makeGlobalStaticRules("write-orient", "text-orientation")
470
493
  ];
471
494
  const screenReadersAccess = [
472
495
  [
@@ -531,7 +554,8 @@ const backgroundBlendModes = [
531
554
  ["bg-blend-saturation", { "background-blend-mode": "saturation" }],
532
555
  ["bg-blend-color", { "background-blend-mode": "color" }],
533
556
  ["bg-blend-luminosity", { "background-blend-mode": "luminosity" }],
534
- ["bg-blend-normal", { "background-blend-mode": "normal" }]
557
+ ["bg-blend-normal", { "background-blend-mode": "normal" }],
558
+ ...utils.makeGlobalStaticRules("bg-blend", "background-blend")
535
559
  ];
536
560
  const mixBlendModes = [
537
561
  ["mix-blend-multiply", { "mix-blend-mode": "multiply" }],
@@ -550,7 +574,8 @@ const mixBlendModes = [
550
574
  ["mix-blend-color", { "mix-blend-mode": "color" }],
551
575
  ["mix-blend-luminosity", { "mix-blend-mode": "luminosity" }],
552
576
  ["mix-blend-plus-lighter", { "mix-blend-mode": "plus-lighter" }],
553
- ["mix-blend-normal", { "mix-blend-mode": "normal" }]
577
+ ["mix-blend-normal", { "mix-blend-mode": "normal" }],
578
+ ...utils.makeGlobalStaticRules("mix-blend")
554
579
  ];
555
580
 
556
581
  const borderSpacingBase = {
@@ -630,11 +655,7 @@ const divides = [
630
655
  [/^divide-(block|inline)-reverse$/, ([, d]) => ({ [`--un-divide-${d}-reverse`]: 1 })],
631
656
  [/^divide-(.+)$/, utils.colorResolver("border-color", "divide"), { autocomplete: "divide-$colors" }],
632
657
  [/^divide-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-divide-opacity": utils.handler.bracket.percent(opacity) }), { autocomplete: ["divide-(op|opacity)", "divide-(op|opacity)-<percent>"] }],
633
- ["divide-solid", { "border-style": "solid" }],
634
- ["divide-dashed", { "border-style": "dashed" }],
635
- ["divide-dotted", { "border-style": "dotted" }],
636
- ["divide-double", { "border-style": "double" }],
637
- ["divide-none", { "border-style": "none" }]
658
+ ...rules$1.borderStyles.map((style) => [`divide-${style}`, { "border-style": style }])
638
659
  ];
639
660
  function handlerDivide([, d, s], { theme }) {
640
661
  const v = theme.lineWidth?.[s || "DEFAULT"] ?? utils.handler.bracket.cssvar.px(s || "1");
@@ -661,10 +682,10 @@ const lineClamps = [
661
682
  "-webkit-line-clamp": v,
662
683
  "line-clamp": v
663
684
  }), { autocomplete: ["line-clamp", "line-clamp-<num>"] }],
664
- ["line-clamp-none", {
665
- "-webkit-line-clamp": "unset",
666
- "line-clamp": "unset"
667
- }]
685
+ ...["none", ...utils.globalKeywords].map((keyword) => [`line-clamp-${keyword}`, {
686
+ "-webkit-line-clamp": keyword,
687
+ "line-clamp": keyword
688
+ }])
668
689
  ];
669
690
 
670
691
  const fontVariantNumericBase = {
@@ -711,7 +732,8 @@ const touchActions = [
711
732
  }],
712
733
  ["touch-auto", { "touch-action": "auto" }],
713
734
  ["touch-manipulation", { "touch-action": "manipulation" }],
714
- ["touch-none", { "touch-action": "none" }]
735
+ ["touch-none", { "touch-action": "none" }],
736
+ ...utils.makeGlobalStaticRules("touch", "touch-action")
715
737
  ];
716
738
 
717
739
  const scrollSnapTypeBase = {
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, 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) => {
@@ -159,6 +160,7 @@ const backgroundStyles = [
159
160
  ["bg-none", { "background-image": "none" }],
160
161
  ["box-decoration-slice", { "box-decoration-break": "slice" }],
161
162
  ["box-decoration-clone", { "box-decoration-break": "clone" }],
163
+ ...makeGlobalStaticRules("box-decoration", "box-decoration-break"),
162
164
  ["bg-auto", { "background-size": "auto" }],
163
165
  ["bg-cover", { "background-size": "cover" }],
164
166
  ["bg-contain", { "background-size": "contain" }],
@@ -169,6 +171,10 @@ const backgroundStyles = [
169
171
  ["bg-clip-content", { "-webkit-background-clip": "content-box", "background-clip": "content-box" }],
170
172
  ["bg-clip-padding", { "-webkit-background-clip": "padding-box", "background-clip": "padding-box" }],
171
173
  ["bg-clip-text", { "-webkit-background-clip": "text", "background-clip": "text" }],
174
+ ...globalKeywords.map((keyword) => [`bg-clip-${keyword}`, {
175
+ "-webkit-background-clip": keyword,
176
+ "background-clip": keyword
177
+ }]),
172
178
  [/^bg-([-\w]{3,})$/, ([, s]) => ({ "background-position": positionMap[s] })],
173
179
  ["bg-repeat", { "background-repeat": "repeat" }],
174
180
  ["bg-no-repeat", { "background-repeat": "no-repeat" }],
@@ -176,9 +182,11 @@ const backgroundStyles = [
176
182
  ["bg-repeat-y", { "background-repeat": "repeat-y" }],
177
183
  ["bg-repeat-round", { "background-repeat": "round" }],
178
184
  ["bg-repeat-space", { "background-repeat": "space" }],
185
+ ...makeGlobalStaticRules("bg-repeat", "background-repeat"),
179
186
  ["bg-origin-border", { "background-origin": "border-box" }],
180
187
  ["bg-origin-padding", { "background-origin": "padding-box" }],
181
- ["bg-origin-content", { "background-origin": "content-box" }]
188
+ ["bg-origin-content", { "background-origin": "content-box" }],
189
+ ...makeGlobalStaticRules("bg-origin", "background-origin")
182
190
  ];
183
191
 
184
192
  const listStyles = {
@@ -196,18 +204,22 @@ const listStyles = {
196
204
  "upper-latin": "upper-latin"
197
205
  };
198
206
  const listStyle = [
199
- [/^list-(.+)(?:-(outside|inside))?$/, ([, style, position]) => {
200
- if (position != null) {
201
- return {
202
- "list-style-position": position,
203
- "list-style-type": listStyles[style]
204
- };
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 };
205
217
  }
206
- return { "list-style-type": listStyles[style] };
207
218
  }, { autocomplete: [`list-(${Object.keys(listStyles).join("|")})`, `list-(${Object.keys(listStyles).join("|")})-(outside|inside)`] }],
208
219
  ["list-outside", { "list-style-position": "outside" }],
209
220
  ["list-inside", { "list-style-position": "inside" }],
210
- ["list-none", { "list-style-type": "none" }]
221
+ ["list-none", { "list-style-type": "none" }],
222
+ ...makeGlobalStaticRules("list", "list-style-type")
211
223
  ];
212
224
  const accents = [
213
225
  [/^accent-(.+)$/, colorResolver("accent-color", "accent"), { autocomplete: "accent-$colors" }],
@@ -232,16 +244,20 @@ const overscrolls = [
232
244
  ["overscroll-auto", { "overscroll-behavior": "auto" }],
233
245
  ["overscroll-contain", { "overscroll-behavior": "contain" }],
234
246
  ["overscroll-none", { "overscroll-behavior": "none" }],
247
+ ...makeGlobalStaticRules("overscroll", "overscroll-behavior"),
235
248
  ["overscroll-x-auto", { "overscroll-behavior-x": "auto" }],
236
249
  ["overscroll-x-contain", { "overscroll-behavior-x": "contain" }],
237
250
  ["overscroll-x-none", { "overscroll-behavior-x": "none" }],
251
+ ...makeGlobalStaticRules("overscroll-x", "overscroll-behavior-x"),
238
252
  ["overscroll-y-auto", { "overscroll-behavior-y": "auto" }],
239
253
  ["overscroll-y-contain", { "overscroll-behavior-y": "contain" }],
240
- ["overscroll-y-none", { "overscroll-behavior-y": "none" }]
254
+ ["overscroll-y-none", { "overscroll-behavior-y": "none" }],
255
+ ...makeGlobalStaticRules("overscroll-y", "overscroll-behavior-y")
241
256
  ];
242
257
  const scrollBehaviors = [
243
258
  ["scroll-auto", { "scroll-behavior": "auto" }],
244
- ["scroll-smooth", { "scroll-behavior": "smooth" }]
259
+ ["scroll-smooth", { "scroll-behavior": "smooth" }],
260
+ ...makeGlobalStaticRules("scroll", "scroll-behavior")
245
261
  ];
246
262
 
247
263
  const columns = [
@@ -254,10 +270,12 @@ const columns = [
254
270
  ["break-before-left", { "break-before": "left" }],
255
271
  ["break-before-right", { "break-before": "right" }],
256
272
  ["break-before-column", { "break-before": "column" }],
273
+ ...makeGlobalStaticRules("break-before"),
257
274
  ["break-inside-auto", { "break-inside": "auto" }],
258
275
  ["break-inside-avoid", { "break-inside": "avoid" }],
259
276
  ["break-inside-avoid-page", { "break-inside": "avoid-page" }],
260
277
  ["break-inside-avoid-column", { "break-inside": "avoid-column" }],
278
+ ...makeGlobalStaticRules("break-inside"),
261
279
  ["break-after-auto", { "break-after": "auto" }],
262
280
  ["break-after-avoid", { "break-after": "avoid" }],
263
281
  ["break-after-all", { "break-after": "all" }],
@@ -265,14 +283,15 @@ const columns = [
265
283
  ["break-after-page", { "break-after": "page" }],
266
284
  ["break-after-left", { "break-after": "left" }],
267
285
  ["break-after-right", { "break-after": "right" }],
268
- ["break-after-column", { "break-after": "column" }]
286
+ ["break-after-column", { "break-after": "column" }],
287
+ ...makeGlobalStaticRules("break-after")
269
288
  ];
270
289
 
271
290
  const queryMatcher = /@media \(min-width: (.+)\)/;
272
291
  const container = [
273
292
  [
274
293
  /^__container$/,
275
- (m, { variantHandlers }) => {
294
+ (m, { theme, variantHandlers }) => {
276
295
  let width = "100%";
277
296
  for (const v of variantHandlers) {
278
297
  const query = v.handle?.({}, (x) => x)?.parent;
@@ -282,6 +301,13 @@ const container = [
282
301
  width = match;
283
302
  }
284
303
  }
304
+ if (theme.container?.center) {
305
+ return {
306
+ "max-width": width,
307
+ "margin-left": "auto",
308
+ "margin-right": "auto"
309
+ };
310
+ }
285
311
  return { "max-width": width };
286
312
  },
287
313
  { internal: true }
@@ -406,7 +432,12 @@ const filters = [
406
432
  ["backdrop-filter-none", {
407
433
  "-webkit-backdrop-filter": "none",
408
434
  "backdrop-filter": "none"
409
- }]
435
+ }],
436
+ ...globalKeywords.map((keyword) => [`filter-${keyword}`, { filter: keyword }]),
437
+ ...globalKeywords.map((keyword) => [`backdrop-filter-${keyword}`, {
438
+ "-webkit-backdrop-filter": keyword,
439
+ "backdrop-filter": keyword
440
+ }])
410
441
  ];
411
442
 
412
443
  const spaces = [
@@ -439,31 +470,23 @@ const textTransforms = [
439
470
  ["normal-case", { "text-transform": "none" }]
440
471
  ];
441
472
  const hyphens = [
442
- ["hyphens-manual", {
443
- "-webkit-hyphens": "manual",
444
- "-ms-hyphens": "manual",
445
- "hyphens": "manual"
446
- }],
447
- ["hyphens-auto", {
448
- "-webkit-hyphens": "auto",
449
- "-ms-hyphens": "auto",
450
- "hyphens": "auto"
451
- }],
452
- ["hyphens-none", {
453
- "-webkit-hyphens": "none",
454
- "-ms-hyphens": "none",
455
- "hyphens": "none"
456
- }]
473
+ ...["manual", "auto", "none", ...globalKeywords].map((keyword) => [`hyphens-${keyword}`, {
474
+ "-webkit-hyphens": keyword,
475
+ "-ms-hyphens": keyword,
476
+ "hyphens": keyword
477
+ }])
457
478
  ];
458
479
  const writingModes = [
459
480
  ["write-vertical-right", { "writing-mode": "vertical-rl" }],
460
481
  ["write-vertical-left", { "writing-mode": "vertical-lr" }],
461
- ["write-normal", { "writing-mode": "horizontal-tb" }]
482
+ ["write-normal", { "writing-mode": "horizontal-tb" }],
483
+ ...makeGlobalStaticRules("write", "writing-mode")
462
484
  ];
463
485
  const writingOrientations = [
464
486
  ["write-orient-mixed", { "text-orientation": "mixed" }],
465
487
  ["write-orient-sideways", { "text-orientation": "sideways" }],
466
- ["write-orient-upright", { "text-orientation": "upright" }]
488
+ ["write-orient-upright", { "text-orientation": "upright" }],
489
+ ...makeGlobalStaticRules("write-orient", "text-orientation")
467
490
  ];
468
491
  const screenReadersAccess = [
469
492
  [
@@ -528,7 +551,8 @@ const backgroundBlendModes = [
528
551
  ["bg-blend-saturation", { "background-blend-mode": "saturation" }],
529
552
  ["bg-blend-color", { "background-blend-mode": "color" }],
530
553
  ["bg-blend-luminosity", { "background-blend-mode": "luminosity" }],
531
- ["bg-blend-normal", { "background-blend-mode": "normal" }]
554
+ ["bg-blend-normal", { "background-blend-mode": "normal" }],
555
+ ...makeGlobalStaticRules("bg-blend", "background-blend")
532
556
  ];
533
557
  const mixBlendModes = [
534
558
  ["mix-blend-multiply", { "mix-blend-mode": "multiply" }],
@@ -547,7 +571,8 @@ const mixBlendModes = [
547
571
  ["mix-blend-color", { "mix-blend-mode": "color" }],
548
572
  ["mix-blend-luminosity", { "mix-blend-mode": "luminosity" }],
549
573
  ["mix-blend-plus-lighter", { "mix-blend-mode": "plus-lighter" }],
550
- ["mix-blend-normal", { "mix-blend-mode": "normal" }]
574
+ ["mix-blend-normal", { "mix-blend-mode": "normal" }],
575
+ ...makeGlobalStaticRules("mix-blend")
551
576
  ];
552
577
 
553
578
  const borderSpacingBase = {
@@ -627,11 +652,7 @@ const divides = [
627
652
  [/^divide-(block|inline)-reverse$/, ([, d]) => ({ [`--un-divide-${d}-reverse`]: 1 })],
628
653
  [/^divide-(.+)$/, colorResolver("border-color", "divide"), { autocomplete: "divide-$colors" }],
629
654
  [/^divide-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-divide-opacity": handler.bracket.percent(opacity) }), { autocomplete: ["divide-(op|opacity)", "divide-(op|opacity)-<percent>"] }],
630
- ["divide-solid", { "border-style": "solid" }],
631
- ["divide-dashed", { "border-style": "dashed" }],
632
- ["divide-dotted", { "border-style": "dotted" }],
633
- ["divide-double", { "border-style": "double" }],
634
- ["divide-none", { "border-style": "none" }]
655
+ ...borderStyles.map((style) => [`divide-${style}`, { "border-style": style }])
635
656
  ];
636
657
  function handlerDivide([, d, s], { theme }) {
637
658
  const v = theme.lineWidth?.[s || "DEFAULT"] ?? handler.bracket.cssvar.px(s || "1");
@@ -658,10 +679,10 @@ const lineClamps = [
658
679
  "-webkit-line-clamp": v,
659
680
  "line-clamp": v
660
681
  }), { autocomplete: ["line-clamp", "line-clamp-<num>"] }],
661
- ["line-clamp-none", {
662
- "-webkit-line-clamp": "unset",
663
- "line-clamp": "unset"
664
- }]
682
+ ...["none", ...globalKeywords].map((keyword) => [`line-clamp-${keyword}`, {
683
+ "-webkit-line-clamp": keyword,
684
+ "line-clamp": keyword
685
+ }])
665
686
  ];
666
687
 
667
688
  const fontVariantNumericBase = {
@@ -708,7 +729,8 @@ const touchActions = [
708
729
  }],
709
730
  ["touch-auto", { "touch-action": "auto" }],
710
731
  ["touch-manipulation", { "touch-action": "manipulation" }],
711
- ["touch-none", { "touch-action": "none" }]
732
+ ["touch-none", { "touch-action": "none" }],
733
+ ...makeGlobalStaticRules("touch", "touch-action")
712
734
  ];
713
735
 
714
736
  const scrollSnapTypeBase = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/preset-wind",
3
- "version": "0.41.0",
3
+ "version": "0.42.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.0",
39
- "@unocss/preset-mini": "0.41.0"
38
+ "@unocss/core": "0.42.0",
39
+ "@unocss/preset-mini": "0.42.0"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "unbuild",