@unocss/preset-wind 0.39.3 → 0.41.1

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/README.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  Tailwind / Windi CSS compact preset for [UnoCSS](https://github.com/unocss/unocss).
4
4
 
5
+ > This preset inherits
6
+ > - [@unocss/preset-mini](https://github.com/antfu/unocss/tree/main/packages/preset-mini)
7
+
5
8
  ## Installation
6
9
 
7
10
  ```bash
@@ -18,6 +21,24 @@ Unocss({
18
21
  })
19
22
  ```
20
23
 
24
+ ## Differences from Windi CSS
25
+
26
+ ### `<sm` `@lg` Variants
27
+
28
+ - `<sm:p-1` -> `lt-sm:p-1`
29
+ - `@lg:p-1` -> `at-lg:p-1`
30
+ - `>xl:p-1` -> `gt-lg:p-1`
31
+
32
+ to have more consistent naming.
33
+
34
+ ### Bracket Syntax Spaces
35
+
36
+ This preset uses `_` instead of `,` for respecting space in bracket syntax.
37
+
38
+ - `grid-cols-[1fr,10px,max-content]` -> `grid-cols-[1fr_10px_max-content]`
39
+
40
+ since some CSS rules require `,` as parts of the value, e.g. `grid-cols-[repeat(3,auto)]`
41
+
21
42
  ## License
22
43
 
23
44
  MIT License &copy; 2021-PRESENT [Anthony Fu](https://github.com/antfu)
package/dist/index.cjs CHANGED
@@ -3,7 +3,6 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const presetMini = require('@unocss/preset-mini');
6
- const core = require('@unocss/core');
7
6
  const utils = require('@unocss/preset-mini/utils');
8
7
  const rules$1 = require('@unocss/preset-mini/rules');
9
8
  const theme$1 = require('@unocss/preset-mini/theme');
@@ -134,11 +133,11 @@ const backgroundStyles = [
134
133
  }],
135
134
  [/^(?:bg-gradient-)?stops-(\[.+\])$/, ([, s]) => ({ "--un-gradient-stops": utils.handler.bracket(s) })],
136
135
  [/^(?:bg-gradient-)?from-(.+)$/, bgGradientColorResolver("from")],
137
- [/^(?:bg-gradient-)?to-(.+)$/, bgGradientColorResolver("to")],
138
136
  [/^(?:bg-gradient-)?via-(.+)$/, bgGradientColorResolver("via")],
137
+ [/^(?:bg-gradient-)?to-(.+)$/, bgGradientColorResolver("to")],
139
138
  [/^(?:bg-gradient-)?from-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-from-opacity": utils.handler.bracket.percent(opacity) })],
140
- [/^(?:bg-gradient-)?to-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-to-opacity": utils.handler.bracket.percent(opacity) })],
141
139
  [/^(?:bg-gradient-)?via-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-via-opacity": utils.handler.bracket.percent(opacity) })],
140
+ [/^(?:bg-gradient-)?to-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-to-opacity": utils.handler.bracket.percent(opacity) })],
142
141
  [/^bg-gradient-((?:repeating-)?(?:linear|radial|conic))$/, ([, s]) => ({
143
142
  "background-image": `${s}-gradient(var(--un-gradient, var(--un-gradient-stops, rgba(255, 255, 255, 0))))`
144
143
  }), { autocomplete: ["bg-gradient-repeating", "bg-gradient-(linear|radial|conic)", "bg-gradient-repeating-(linear|radial|conic)"] }],
@@ -163,6 +162,7 @@ const backgroundStyles = [
163
162
  ["bg-none", { "background-image": "none" }],
164
163
  ["box-decoration-slice", { "box-decoration-break": "slice" }],
165
164
  ["box-decoration-clone", { "box-decoration-break": "clone" }],
165
+ ...utils.makeGlobalStaticRules("box-decoration", "box-decoration-break"),
166
166
  ["bg-auto", { "background-size": "auto" }],
167
167
  ["bg-cover", { "background-size": "cover" }],
168
168
  ["bg-contain", { "background-size": "contain" }],
@@ -173,6 +173,10 @@ const backgroundStyles = [
173
173
  ["bg-clip-content", { "-webkit-background-clip": "content-box", "background-clip": "content-box" }],
174
174
  ["bg-clip-padding", { "-webkit-background-clip": "padding-box", "background-clip": "padding-box" }],
175
175
  ["bg-clip-text", { "-webkit-background-clip": "text", "background-clip": "text" }],
176
+ ...utils.globalKeywords.map((keyword) => [`bg-clip-${keyword}`, {
177
+ "-webkit-background-clip": keyword,
178
+ "background-clip": keyword
179
+ }]),
176
180
  [/^bg-([-\w]{3,})$/, ([, s]) => ({ "background-position": utils.positionMap[s] })],
177
181
  ["bg-repeat", { "background-repeat": "repeat" }],
178
182
  ["bg-no-repeat", { "background-repeat": "no-repeat" }],
@@ -180,9 +184,11 @@ const backgroundStyles = [
180
184
  ["bg-repeat-y", { "background-repeat": "repeat-y" }],
181
185
  ["bg-repeat-round", { "background-repeat": "round" }],
182
186
  ["bg-repeat-space", { "background-repeat": "space" }],
187
+ ...utils.makeGlobalStaticRules("bg-repeat", "background-repeat"),
183
188
  ["bg-origin-border", { "background-origin": "border-box" }],
184
189
  ["bg-origin-padding", { "background-origin": "padding-box" }],
185
- ["bg-origin-content", { "background-origin": "content-box" }]
190
+ ["bg-origin-content", { "background-origin": "content-box" }],
191
+ ...utils.makeGlobalStaticRules("bg-origin", "background-origin")
186
192
  ];
187
193
 
188
194
  const listStyles = {
@@ -211,7 +217,8 @@ const listStyle = [
211
217
  }, { autocomplete: [`list-(${Object.keys(listStyles).join("|")})`, `list-(${Object.keys(listStyles).join("|")})-(outside|inside)`] }],
212
218
  ["list-outside", { "list-style-position": "outside" }],
213
219
  ["list-inside", { "list-style-position": "inside" }],
214
- ["list-none", { "list-style-type": "none" }]
220
+ ["list-none", { "list-style-type": "none" }],
221
+ ...utils.makeGlobalStaticRules("list", "list-style")
215
222
  ];
216
223
  const accents = [
217
224
  [/^accent-(.+)$/, utils.colorResolver("accent-color", "accent"), { autocomplete: "accent-$colors" }],
@@ -236,16 +243,20 @@ const overscrolls = [
236
243
  ["overscroll-auto", { "overscroll-behavior": "auto" }],
237
244
  ["overscroll-contain", { "overscroll-behavior": "contain" }],
238
245
  ["overscroll-none", { "overscroll-behavior": "none" }],
246
+ ...utils.makeGlobalStaticRules("overscroll", "overscroll-behavior"),
239
247
  ["overscroll-x-auto", { "overscroll-behavior-x": "auto" }],
240
248
  ["overscroll-x-contain", { "overscroll-behavior-x": "contain" }],
241
249
  ["overscroll-x-none", { "overscroll-behavior-x": "none" }],
250
+ ...utils.makeGlobalStaticRules("overscroll-x", "overscroll-behavior-x"),
242
251
  ["overscroll-y-auto", { "overscroll-behavior-y": "auto" }],
243
252
  ["overscroll-y-contain", { "overscroll-behavior-y": "contain" }],
244
- ["overscroll-y-none", { "overscroll-behavior-y": "none" }]
253
+ ["overscroll-y-none", { "overscroll-behavior-y": "none" }],
254
+ ...utils.makeGlobalStaticRules("overscroll-y", "overscroll-behavior-y")
245
255
  ];
246
256
  const scrollBehaviors = [
247
257
  ["scroll-auto", { "scroll-behavior": "auto" }],
248
- ["scroll-smooth", { "scroll-behavior": "smooth" }]
258
+ ["scroll-smooth", { "scroll-behavior": "smooth" }],
259
+ ...utils.makeGlobalStaticRules("scroll", "scroll-behavior")
249
260
  ];
250
261
 
251
262
  const columns = [
@@ -258,10 +269,12 @@ const columns = [
258
269
  ["break-before-left", { "break-before": "left" }],
259
270
  ["break-before-right", { "break-before": "right" }],
260
271
  ["break-before-column", { "break-before": "column" }],
272
+ ...utils.makeGlobalStaticRules("break-before"),
261
273
  ["break-inside-auto", { "break-inside": "auto" }],
262
274
  ["break-inside-avoid", { "break-inside": "avoid" }],
263
275
  ["break-inside-avoid-page", { "break-inside": "avoid-page" }],
264
276
  ["break-inside-avoid-column", { "break-inside": "avoid-column" }],
277
+ ...utils.makeGlobalStaticRules("break-inside"),
265
278
  ["break-after-auto", { "break-after": "auto" }],
266
279
  ["break-after-avoid", { "break-after": "avoid" }],
267
280
  ["break-after-all", { "break-after": "all" }],
@@ -269,7 +282,8 @@ const columns = [
269
282
  ["break-after-page", { "break-after": "page" }],
270
283
  ["break-after-left", { "break-after": "left" }],
271
284
  ["break-after-right", { "break-after": "right" }],
272
- ["break-after-column", { "break-after": "column" }]
285
+ ["break-after-column", { "break-after": "column" }],
286
+ ...utils.makeGlobalStaticRules("break-after")
273
287
  ];
274
288
 
275
289
  const queryMatcher = /@media \(min-width: (.+)\)/;
@@ -279,7 +293,7 @@ const container = [
279
293
  (m, { variantHandlers }) => {
280
294
  let width = "100%";
281
295
  for (const v of variantHandlers) {
282
- const query = core.toArray(v.parent || [])[0];
296
+ const query = v.handle?.({}, (x) => x)?.parent;
283
297
  if (typeof query === "string") {
284
298
  const match = query.match(queryMatcher)?.[1];
285
299
  if (match)
@@ -410,7 +424,12 @@ const filters = [
410
424
  ["backdrop-filter-none", {
411
425
  "-webkit-backdrop-filter": "none",
412
426
  "backdrop-filter": "none"
413
- }]
427
+ }],
428
+ ...utils.globalKeywords.map((keyword) => [`filter-${keyword}`, { filter: keyword }]),
429
+ ...utils.globalKeywords.map((keyword) => [`backdrop-filter-${keyword}`, {
430
+ "-webkit-backdrop-filter": keyword,
431
+ "backdrop-filter": keyword
432
+ }])
414
433
  ];
415
434
 
416
435
  const spaces = [
@@ -443,31 +462,23 @@ const textTransforms = [
443
462
  ["normal-case", { "text-transform": "none" }]
444
463
  ];
445
464
  const hyphens = [
446
- ["hyphens-manual", {
447
- "-webkit-hyphens": "manual",
448
- "-ms-hyphens": "manual",
449
- "hyphens": "manual"
450
- }],
451
- ["hyphens-auto", {
452
- "-webkit-hyphens": "auto",
453
- "-ms-hyphens": "auto",
454
- "hyphens": "auto"
455
- }],
456
- ["hyphens-none", {
457
- "-webkit-hyphens": "none",
458
- "-ms-hyphens": "none",
459
- "hyphens": "none"
460
- }]
465
+ ...["manual", "auto", "none", ...utils.globalKeywords].map((keyword) => [`hyphens-${keyword}`, {
466
+ "-webkit-hyphens": keyword,
467
+ "-ms-hyphens": keyword,
468
+ "hyphens": keyword
469
+ }])
461
470
  ];
462
471
  const writingModes = [
463
472
  ["write-vertical-right", { "writing-mode": "vertical-rl" }],
464
473
  ["write-vertical-left", { "writing-mode": "vertical-lr" }],
465
- ["write-normal", { "writing-mode": "horizontal-tb" }]
474
+ ["write-normal", { "writing-mode": "horizontal-tb" }],
475
+ ...utils.makeGlobalStaticRules("write", "writing-mode")
466
476
  ];
467
477
  const writingOrientations = [
468
478
  ["write-orient-mixed", { "text-orientation": "mixed" }],
469
479
  ["write-orient-sideways", { "text-orientation": "sideways" }],
470
- ["write-orient-upright", { "text-orientation": "upright" }]
480
+ ["write-orient-upright", { "text-orientation": "upright" }],
481
+ ...utils.makeGlobalStaticRules("write-orient", "text-orientation")
471
482
  ];
472
483
  const screenReadersAccess = [
473
484
  [
@@ -532,7 +543,8 @@ const backgroundBlendModes = [
532
543
  ["bg-blend-saturation", { "background-blend-mode": "saturation" }],
533
544
  ["bg-blend-color", { "background-blend-mode": "color" }],
534
545
  ["bg-blend-luminosity", { "background-blend-mode": "luminosity" }],
535
- ["bg-blend-normal", { "background-blend-mode": "normal" }]
546
+ ["bg-blend-normal", { "background-blend-mode": "normal" }],
547
+ ...utils.makeGlobalStaticRules("bg-blend", "background-blend")
536
548
  ];
537
549
  const mixBlendModes = [
538
550
  ["mix-blend-multiply", { "mix-blend-mode": "multiply" }],
@@ -551,7 +563,8 @@ const mixBlendModes = [
551
563
  ["mix-blend-color", { "mix-blend-mode": "color" }],
552
564
  ["mix-blend-luminosity", { "mix-blend-mode": "luminosity" }],
553
565
  ["mix-blend-plus-lighter", { "mix-blend-mode": "plus-lighter" }],
554
- ["mix-blend-normal", { "mix-blend-mode": "normal" }]
566
+ ["mix-blend-normal", { "mix-blend-mode": "normal" }],
567
+ ...utils.makeGlobalStaticRules("mix-blend")
555
568
  ];
556
569
 
557
570
  const borderSpacingBase = {
@@ -712,7 +725,8 @@ const touchActions = [
712
725
  }],
713
726
  ["touch-auto", { "touch-action": "auto" }],
714
727
  ["touch-manipulation", { "touch-action": "manipulation" }],
715
- ["touch-none", { "touch-action": "none" }]
728
+ ["touch-none", { "touch-action": "none" }],
729
+ ...utils.makeGlobalStaticRules("touch", "touch-action")
716
730
  ];
717
731
 
718
732
  const scrollSnapTypeBase = {
@@ -1040,12 +1054,12 @@ const theme = {
1040
1054
  };
1041
1055
 
1042
1056
  const variantCombinators = [
1043
- utils.variantMatcher("svg", (input) => `${input} svg`)
1057
+ utils.variantMatcher("svg", (input) => ({ selector: `${input.selector} svg` }))
1044
1058
  ];
1045
1059
 
1046
1060
  const variantColorsScheme = [
1047
- utils.variantMatcher(".dark", (input) => `.dark $$ ${input}`),
1048
- utils.variantMatcher(".light", (input) => `.light $$ ${input}`),
1061
+ utils.variantMatcher(".dark", (input) => ({ prefix: `.dark $$ ${input.prefix}` })),
1062
+ utils.variantMatcher(".light", (input) => ({ prefix: `.light $$ ${input.prefix}` })),
1049
1063
  utils.variantParentMatcher("@dark", "@media (prefers-color-scheme: dark)"),
1050
1064
  utils.variantParentMatcher("@light", "@media (prefers-color-scheme: light)")
1051
1065
  ];
package/dist/index.mjs CHANGED
@@ -1,7 +1,6 @@
1
1
  import { preflights } from '@unocss/preset-mini';
2
2
  export { colors, preflights } from '@unocss/preset-mini';
3
- import { toArray } from '@unocss/core';
4
- import { handler, positionMap, parseColor, colorToString, colorOpacityToString, colorResolver, resolveBreakpoints, colorableShadows, directionMap, directionSize, variantMatcher, variantParentMatcher, hasParseableColor } from '@unocss/preset-mini/utils';
3
+ import { handler, positionMap, makeGlobalStaticRules, globalKeywords, parseColor, colorToString, colorOpacityToString, colorResolver, resolveBreakpoints, colorableShadows, directionMap, directionSize, variantMatcher, variantParentMatcher, hasParseableColor } from '@unocss/preset-mini/utils';
5
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';
6
5
  import { theme as theme$1 } from '@unocss/preset-mini/theme';
7
6
  import { variants as variants$1 } from '@unocss/preset-mini/variants';
@@ -131,11 +130,11 @@ const backgroundStyles = [
131
130
  }],
132
131
  [/^(?:bg-gradient-)?stops-(\[.+\])$/, ([, s]) => ({ "--un-gradient-stops": handler.bracket(s) })],
133
132
  [/^(?:bg-gradient-)?from-(.+)$/, bgGradientColorResolver("from")],
134
- [/^(?:bg-gradient-)?to-(.+)$/, bgGradientColorResolver("to")],
135
133
  [/^(?:bg-gradient-)?via-(.+)$/, bgGradientColorResolver("via")],
134
+ [/^(?:bg-gradient-)?to-(.+)$/, bgGradientColorResolver("to")],
136
135
  [/^(?:bg-gradient-)?from-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-from-opacity": handler.bracket.percent(opacity) })],
137
- [/^(?:bg-gradient-)?to-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-to-opacity": handler.bracket.percent(opacity) })],
138
136
  [/^(?:bg-gradient-)?via-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-via-opacity": handler.bracket.percent(opacity) })],
137
+ [/^(?:bg-gradient-)?to-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-to-opacity": handler.bracket.percent(opacity) })],
139
138
  [/^bg-gradient-((?:repeating-)?(?:linear|radial|conic))$/, ([, s]) => ({
140
139
  "background-image": `${s}-gradient(var(--un-gradient, var(--un-gradient-stops, rgba(255, 255, 255, 0))))`
141
140
  }), { autocomplete: ["bg-gradient-repeating", "bg-gradient-(linear|radial|conic)", "bg-gradient-repeating-(linear|radial|conic)"] }],
@@ -160,6 +159,7 @@ const backgroundStyles = [
160
159
  ["bg-none", { "background-image": "none" }],
161
160
  ["box-decoration-slice", { "box-decoration-break": "slice" }],
162
161
  ["box-decoration-clone", { "box-decoration-break": "clone" }],
162
+ ...makeGlobalStaticRules("box-decoration", "box-decoration-break"),
163
163
  ["bg-auto", { "background-size": "auto" }],
164
164
  ["bg-cover", { "background-size": "cover" }],
165
165
  ["bg-contain", { "background-size": "contain" }],
@@ -170,6 +170,10 @@ const backgroundStyles = [
170
170
  ["bg-clip-content", { "-webkit-background-clip": "content-box", "background-clip": "content-box" }],
171
171
  ["bg-clip-padding", { "-webkit-background-clip": "padding-box", "background-clip": "padding-box" }],
172
172
  ["bg-clip-text", { "-webkit-background-clip": "text", "background-clip": "text" }],
173
+ ...globalKeywords.map((keyword) => [`bg-clip-${keyword}`, {
174
+ "-webkit-background-clip": keyword,
175
+ "background-clip": keyword
176
+ }]),
173
177
  [/^bg-([-\w]{3,})$/, ([, s]) => ({ "background-position": positionMap[s] })],
174
178
  ["bg-repeat", { "background-repeat": "repeat" }],
175
179
  ["bg-no-repeat", { "background-repeat": "no-repeat" }],
@@ -177,9 +181,11 @@ const backgroundStyles = [
177
181
  ["bg-repeat-y", { "background-repeat": "repeat-y" }],
178
182
  ["bg-repeat-round", { "background-repeat": "round" }],
179
183
  ["bg-repeat-space", { "background-repeat": "space" }],
184
+ ...makeGlobalStaticRules("bg-repeat", "background-repeat"),
180
185
  ["bg-origin-border", { "background-origin": "border-box" }],
181
186
  ["bg-origin-padding", { "background-origin": "padding-box" }],
182
- ["bg-origin-content", { "background-origin": "content-box" }]
187
+ ["bg-origin-content", { "background-origin": "content-box" }],
188
+ ...makeGlobalStaticRules("bg-origin", "background-origin")
183
189
  ];
184
190
 
185
191
  const listStyles = {
@@ -208,7 +214,8 @@ const listStyle = [
208
214
  }, { autocomplete: [`list-(${Object.keys(listStyles).join("|")})`, `list-(${Object.keys(listStyles).join("|")})-(outside|inside)`] }],
209
215
  ["list-outside", { "list-style-position": "outside" }],
210
216
  ["list-inside", { "list-style-position": "inside" }],
211
- ["list-none", { "list-style-type": "none" }]
217
+ ["list-none", { "list-style-type": "none" }],
218
+ ...makeGlobalStaticRules("list", "list-style")
212
219
  ];
213
220
  const accents = [
214
221
  [/^accent-(.+)$/, colorResolver("accent-color", "accent"), { autocomplete: "accent-$colors" }],
@@ -233,16 +240,20 @@ const overscrolls = [
233
240
  ["overscroll-auto", { "overscroll-behavior": "auto" }],
234
241
  ["overscroll-contain", { "overscroll-behavior": "contain" }],
235
242
  ["overscroll-none", { "overscroll-behavior": "none" }],
243
+ ...makeGlobalStaticRules("overscroll", "overscroll-behavior"),
236
244
  ["overscroll-x-auto", { "overscroll-behavior-x": "auto" }],
237
245
  ["overscroll-x-contain", { "overscroll-behavior-x": "contain" }],
238
246
  ["overscroll-x-none", { "overscroll-behavior-x": "none" }],
247
+ ...makeGlobalStaticRules("overscroll-x", "overscroll-behavior-x"),
239
248
  ["overscroll-y-auto", { "overscroll-behavior-y": "auto" }],
240
249
  ["overscroll-y-contain", { "overscroll-behavior-y": "contain" }],
241
- ["overscroll-y-none", { "overscroll-behavior-y": "none" }]
250
+ ["overscroll-y-none", { "overscroll-behavior-y": "none" }],
251
+ ...makeGlobalStaticRules("overscroll-y", "overscroll-behavior-y")
242
252
  ];
243
253
  const scrollBehaviors = [
244
254
  ["scroll-auto", { "scroll-behavior": "auto" }],
245
- ["scroll-smooth", { "scroll-behavior": "smooth" }]
255
+ ["scroll-smooth", { "scroll-behavior": "smooth" }],
256
+ ...makeGlobalStaticRules("scroll", "scroll-behavior")
246
257
  ];
247
258
 
248
259
  const columns = [
@@ -255,10 +266,12 @@ const columns = [
255
266
  ["break-before-left", { "break-before": "left" }],
256
267
  ["break-before-right", { "break-before": "right" }],
257
268
  ["break-before-column", { "break-before": "column" }],
269
+ ...makeGlobalStaticRules("break-before"),
258
270
  ["break-inside-auto", { "break-inside": "auto" }],
259
271
  ["break-inside-avoid", { "break-inside": "avoid" }],
260
272
  ["break-inside-avoid-page", { "break-inside": "avoid-page" }],
261
273
  ["break-inside-avoid-column", { "break-inside": "avoid-column" }],
274
+ ...makeGlobalStaticRules("break-inside"),
262
275
  ["break-after-auto", { "break-after": "auto" }],
263
276
  ["break-after-avoid", { "break-after": "avoid" }],
264
277
  ["break-after-all", { "break-after": "all" }],
@@ -266,7 +279,8 @@ const columns = [
266
279
  ["break-after-page", { "break-after": "page" }],
267
280
  ["break-after-left", { "break-after": "left" }],
268
281
  ["break-after-right", { "break-after": "right" }],
269
- ["break-after-column", { "break-after": "column" }]
282
+ ["break-after-column", { "break-after": "column" }],
283
+ ...makeGlobalStaticRules("break-after")
270
284
  ];
271
285
 
272
286
  const queryMatcher = /@media \(min-width: (.+)\)/;
@@ -276,7 +290,7 @@ const container = [
276
290
  (m, { variantHandlers }) => {
277
291
  let width = "100%";
278
292
  for (const v of variantHandlers) {
279
- const query = toArray(v.parent || [])[0];
293
+ const query = v.handle?.({}, (x) => x)?.parent;
280
294
  if (typeof query === "string") {
281
295
  const match = query.match(queryMatcher)?.[1];
282
296
  if (match)
@@ -407,7 +421,12 @@ const filters = [
407
421
  ["backdrop-filter-none", {
408
422
  "-webkit-backdrop-filter": "none",
409
423
  "backdrop-filter": "none"
410
- }]
424
+ }],
425
+ ...globalKeywords.map((keyword) => [`filter-${keyword}`, { filter: keyword }]),
426
+ ...globalKeywords.map((keyword) => [`backdrop-filter-${keyword}`, {
427
+ "-webkit-backdrop-filter": keyword,
428
+ "backdrop-filter": keyword
429
+ }])
411
430
  ];
412
431
 
413
432
  const spaces = [
@@ -440,31 +459,23 @@ const textTransforms = [
440
459
  ["normal-case", { "text-transform": "none" }]
441
460
  ];
442
461
  const hyphens = [
443
- ["hyphens-manual", {
444
- "-webkit-hyphens": "manual",
445
- "-ms-hyphens": "manual",
446
- "hyphens": "manual"
447
- }],
448
- ["hyphens-auto", {
449
- "-webkit-hyphens": "auto",
450
- "-ms-hyphens": "auto",
451
- "hyphens": "auto"
452
- }],
453
- ["hyphens-none", {
454
- "-webkit-hyphens": "none",
455
- "-ms-hyphens": "none",
456
- "hyphens": "none"
457
- }]
462
+ ...["manual", "auto", "none", ...globalKeywords].map((keyword) => [`hyphens-${keyword}`, {
463
+ "-webkit-hyphens": keyword,
464
+ "-ms-hyphens": keyword,
465
+ "hyphens": keyword
466
+ }])
458
467
  ];
459
468
  const writingModes = [
460
469
  ["write-vertical-right", { "writing-mode": "vertical-rl" }],
461
470
  ["write-vertical-left", { "writing-mode": "vertical-lr" }],
462
- ["write-normal", { "writing-mode": "horizontal-tb" }]
471
+ ["write-normal", { "writing-mode": "horizontal-tb" }],
472
+ ...makeGlobalStaticRules("write", "writing-mode")
463
473
  ];
464
474
  const writingOrientations = [
465
475
  ["write-orient-mixed", { "text-orientation": "mixed" }],
466
476
  ["write-orient-sideways", { "text-orientation": "sideways" }],
467
- ["write-orient-upright", { "text-orientation": "upright" }]
477
+ ["write-orient-upright", { "text-orientation": "upright" }],
478
+ ...makeGlobalStaticRules("write-orient", "text-orientation")
468
479
  ];
469
480
  const screenReadersAccess = [
470
481
  [
@@ -529,7 +540,8 @@ const backgroundBlendModes = [
529
540
  ["bg-blend-saturation", { "background-blend-mode": "saturation" }],
530
541
  ["bg-blend-color", { "background-blend-mode": "color" }],
531
542
  ["bg-blend-luminosity", { "background-blend-mode": "luminosity" }],
532
- ["bg-blend-normal", { "background-blend-mode": "normal" }]
543
+ ["bg-blend-normal", { "background-blend-mode": "normal" }],
544
+ ...makeGlobalStaticRules("bg-blend", "background-blend")
533
545
  ];
534
546
  const mixBlendModes = [
535
547
  ["mix-blend-multiply", { "mix-blend-mode": "multiply" }],
@@ -548,7 +560,8 @@ const mixBlendModes = [
548
560
  ["mix-blend-color", { "mix-blend-mode": "color" }],
549
561
  ["mix-blend-luminosity", { "mix-blend-mode": "luminosity" }],
550
562
  ["mix-blend-plus-lighter", { "mix-blend-mode": "plus-lighter" }],
551
- ["mix-blend-normal", { "mix-blend-mode": "normal" }]
563
+ ["mix-blend-normal", { "mix-blend-mode": "normal" }],
564
+ ...makeGlobalStaticRules("mix-blend")
552
565
  ];
553
566
 
554
567
  const borderSpacingBase = {
@@ -709,7 +722,8 @@ const touchActions = [
709
722
  }],
710
723
  ["touch-auto", { "touch-action": "auto" }],
711
724
  ["touch-manipulation", { "touch-action": "manipulation" }],
712
- ["touch-none", { "touch-action": "none" }]
725
+ ["touch-none", { "touch-action": "none" }],
726
+ ...makeGlobalStaticRules("touch", "touch-action")
713
727
  ];
714
728
 
715
729
  const scrollSnapTypeBase = {
@@ -1037,12 +1051,12 @@ const theme = {
1037
1051
  };
1038
1052
 
1039
1053
  const variantCombinators = [
1040
- variantMatcher("svg", (input) => `${input} svg`)
1054
+ variantMatcher("svg", (input) => ({ selector: `${input.selector} svg` }))
1041
1055
  ];
1042
1056
 
1043
1057
  const variantColorsScheme = [
1044
- variantMatcher(".dark", (input) => `.dark $$ ${input}`),
1045
- variantMatcher(".light", (input) => `.light $$ ${input}`),
1058
+ variantMatcher(".dark", (input) => ({ prefix: `.dark $$ ${input.prefix}` })),
1059
+ variantMatcher(".light", (input) => ({ prefix: `.light $$ ${input.prefix}` })),
1046
1060
  variantParentMatcher("@dark", "@media (prefers-color-scheme: dark)"),
1047
1061
  variantParentMatcher("@light", "@media (prefers-color-scheme: light)")
1048
1062
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/preset-wind",
3
- "version": "0.39.3",
3
+ "version": "0.41.1",
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.3",
39
- "@unocss/preset-mini": "0.39.3"
38
+ "@unocss/core": "0.41.1",
39
+ "@unocss/preset-mini": "0.41.1"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "unbuild",