@unocss/preset-wind 0.16.3 → 0.18.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 +223 -111
- package/dist/index.d.ts +4 -0
- package/dist/index.mjs +211 -99
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -158,25 +158,29 @@ const properties = {
|
|
|
158
158
|
"zoom-out-up": { "transform-origin": "center bottom" }
|
|
159
159
|
};
|
|
160
160
|
const animations = [
|
|
161
|
-
[/^animate-(
|
|
161
|
+
[/^animate-(.+)$/, ([, name], { constructCSS }) => {
|
|
162
162
|
const kf = keyframes[name];
|
|
163
163
|
if (kf) {
|
|
164
164
|
return `@keyframes ${name}${kf}
|
|
165
165
|
${constructCSS(Object.assign({ animation: `${name} ${durations[name] || "1s"} ${timingFns[name] || "linear"} infinite` }, properties[name]))}`;
|
|
166
166
|
}
|
|
167
167
|
}],
|
|
168
|
-
["animate-none", { animation: "none" }],
|
|
169
168
|
[/^animate(?:-duration)?-((.+)(?:(s|ms)?))$/, ([, d]) => ({ "animation-duration": utils.handler.bracket.time(d.replace(/-duration/, "")) })],
|
|
170
169
|
[/^animate-delay-((.+)(?:(s|ms)?))$/, ([, d]) => ({ "animation-delay": utils.handler.bracket.time(d) })],
|
|
171
|
-
[/^animate-(?:fill-)?mode-(
|
|
172
|
-
[
|
|
170
|
+
[/^animate-(?:fill-)?mode-(forwards|backwards|both|inherit|initial|revert|unset)$/, ([, d]) => ({ "animation-fill-mode": d })],
|
|
171
|
+
["animate-mode-none", { "animation-fill-mode": "none" }],
|
|
172
|
+
["animate-fill-mode-none", { "animation-fill-mode": "none" }],
|
|
173
|
+
[/^animate-(?:direction-)?(reverse|alternate|alternate-reverse|inherit|initial|revert|unset)$/, ([, d]) => ({ "animation-direction": d })],
|
|
174
|
+
["animate-normal", { "animation-direction": "normal" }],
|
|
175
|
+
["animate-direction-normal", { "animation-direction": "normal" }],
|
|
173
176
|
[/^animate-(?:iteration-)?count-(.+)$/, ([, d]) => ({ "animation-iteration-count": d.replace(/\-/g, ", ") })],
|
|
174
177
|
[/^animate-name-(.+)/, ([, d]) => ({ "animation-name": d })],
|
|
175
|
-
[/^animate-play(?:-state)?-(paused|running|inherit|initial|revert|unset)$/, ([, d]) => ({ "animation-play-state": d })]
|
|
178
|
+
[/^animate-play(?:-state)?-(paused|running|inherit|initial|revert|unset)$/, ([, d]) => ({ "animation-play-state": d })],
|
|
179
|
+
["animate-none", { animation: "none" }]
|
|
176
180
|
];
|
|
177
181
|
|
|
178
182
|
const colorResolver = (mode) => ([, body], { theme }) => {
|
|
179
|
-
const data =
|
|
183
|
+
const data = utils.parseColor(body, theme);
|
|
180
184
|
if (!data)
|
|
181
185
|
return;
|
|
182
186
|
const { opacity, color, rgba } = data;
|
|
@@ -208,11 +212,20 @@ const colorResolver = (mode) => ([, body], { theme }) => {
|
|
|
208
212
|
};
|
|
209
213
|
}
|
|
210
214
|
};
|
|
215
|
+
const bgGradientDirections = {
|
|
216
|
+
t: "top",
|
|
217
|
+
tr: "top right",
|
|
218
|
+
r: "right",
|
|
219
|
+
br: "bottom right",
|
|
220
|
+
b: "bottom",
|
|
221
|
+
bl: "bottom left",
|
|
222
|
+
l: "left",
|
|
223
|
+
tl: "top left"
|
|
224
|
+
};
|
|
211
225
|
const backgroundStyles = [
|
|
212
226
|
["bg-fixed", { "background-attachment": "fixed" }],
|
|
213
227
|
["bg-local", { "background-attachment": "local" }],
|
|
214
228
|
["bg-scroll", { "background-attachment": "scroll" }],
|
|
215
|
-
["bg-blend-normal", { "background-blend-mode": "normal" }],
|
|
216
229
|
["bg-blend-multiply", { "background-blend-mode": "multiply" }],
|
|
217
230
|
["bg-blend-screen", { "background-blend-mode": "screen" }],
|
|
218
231
|
["bg-blend-overlay", { "background-blend-mode": "overlay" }],
|
|
@@ -228,41 +241,23 @@ const backgroundStyles = [
|
|
|
228
241
|
["bg-blend-saturation", { "background-blend-mode": "saturation" }],
|
|
229
242
|
["bg-blend-color", { "background-blend-mode": "color" }],
|
|
230
243
|
["bg-blend-luminosity", { "background-blend-mode": "luminosity" }],
|
|
244
|
+
["bg-blend-normal", { "background-blend-mode": "normal" }],
|
|
231
245
|
["bg-clip-border", { "-webkit-background-clip": "border-box", "background-attachment": "border-box" }],
|
|
232
246
|
["bg-clip-content", { "-webkit-background-clip": "content-box", "background-attachment": "content-box" }],
|
|
233
247
|
["bg-clip-padding", { "-webkit-background-clip": "padding-box", "background-attachment": "padding-box" }],
|
|
234
248
|
["bg-clip-text", { "-webkit-background-clip": "text", "background-attachment": "text" }],
|
|
235
|
-
[/^from-(.+)$/, colorResolver("from")],
|
|
236
|
-
[/^to-(.+)$/, colorResolver("to")],
|
|
237
|
-
[/^via-(.+)$/, colorResolver("via")],
|
|
238
|
-
[/^from-op(?:acity)?-?(.+)
|
|
239
|
-
[/^to-op(?:acity)?-?(.+)
|
|
240
|
-
[/^via-op(?:acity)?-?(.+)
|
|
241
|
-
[
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
["bg-gradient-to-tr", {
|
|
246
|
-
"background-image": "linear-gradient(to top right, var(--un-gradient-stops))"
|
|
247
|
-
}],
|
|
248
|
-
["bg-gradient-to-r", {
|
|
249
|
-
"background-image": "linear-gradient(to right, var(--un-gradient-stops))"
|
|
250
|
-
}],
|
|
251
|
-
["bg-gradient-to-br", {
|
|
252
|
-
"background-image": "linear-gradient(to bottom right, var(--un-gradient-stops))"
|
|
253
|
-
}],
|
|
254
|
-
["bg-gradient-to-b", {
|
|
255
|
-
"background-image": "linear-gradient(to bottom, var(--un-gradient-stops))"
|
|
256
|
-
}],
|
|
257
|
-
["bg-gradient-to-bl", {
|
|
258
|
-
"background-image": "linear-gradient(to bottom left, var(--un-gradient-stops))"
|
|
259
|
-
}],
|
|
260
|
-
["bg-gradient-to-l", {
|
|
261
|
-
"background-image": "linear-gradient(to left, var(--un-gradient-stops))"
|
|
262
|
-
}],
|
|
263
|
-
["bg-gradient-to-tl", {
|
|
264
|
-
"background-image": "linear-gradient(to top left, var(--un-gradient-stops))"
|
|
249
|
+
[/^(?:bg-gradient-)?from-(.+)$/, colorResolver("from")],
|
|
250
|
+
[/^(?:bg-gradient-)?to-(.+)$/, colorResolver("to")],
|
|
251
|
+
[/^(?:bg-gradient-)?via-(.+)$/, colorResolver("via")],
|
|
252
|
+
[/^(?:bg-gradient-)?from-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-from-opacity": utils.handler.bracket.percent(opacity) })],
|
|
253
|
+
[/^(?:bg-gradient-)?to-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-to-opacity": utils.handler.bracket.percent(opacity) })],
|
|
254
|
+
[/^(?:bg-gradient-)?via-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-via-opacity": utils.handler.bracket.percent(opacity) })],
|
|
255
|
+
[/^bg-gradient-to-([trbl]{1,2})$/, ([, d]) => {
|
|
256
|
+
const v = bgGradientDirections[d];
|
|
257
|
+
if (v)
|
|
258
|
+
return { "background-image": `linear-gradient(to ${v}, var(--un-gradient-stops))` };
|
|
265
259
|
}],
|
|
260
|
+
["bg-none", { "background-image": "none" }],
|
|
266
261
|
["bg-origin-border", { "background-origin": "border-box" }],
|
|
267
262
|
["bg-origin-padding", { "background-origin": "padding-box" }],
|
|
268
263
|
["bg-origin-content", { "background-origin": "content-box" }],
|
|
@@ -286,36 +281,37 @@ const backgroundStyles = [
|
|
|
286
281
|
["bg-contain", { "background-size": "contain" }]
|
|
287
282
|
];
|
|
288
283
|
|
|
289
|
-
const listStyleProps = ["
|
|
284
|
+
const listStyleProps = ["disc", "circle", "square", "decimal", "zero-decimal", "greek", "roman", "upper-roman", "alpha", "upper-alpha"];
|
|
290
285
|
const listStyle = [
|
|
291
|
-
[new RegExp(`^list-((
|
|
286
|
+
[new RegExp(`^list-((?:${listStyleProps.join("|")})(?:-outside|-inside)?)$`), ([, value]) => {
|
|
292
287
|
const style = value.split(/-outside|-inside/)[0];
|
|
293
|
-
const position = /inside
|
|
288
|
+
const position = /outside|inside/.exec(value) ?? [];
|
|
294
289
|
if (position.length) {
|
|
295
290
|
return {
|
|
296
291
|
"list-style-position": `${position[0]}`,
|
|
297
|
-
"list-style-type":
|
|
292
|
+
"list-style-type": style
|
|
298
293
|
};
|
|
299
294
|
}
|
|
300
|
-
return {
|
|
301
|
-
"list-style-type": `${style}`
|
|
302
|
-
};
|
|
295
|
+
return { "list-style-type": style };
|
|
303
296
|
}],
|
|
304
|
-
[/^list-(inside
|
|
305
|
-
|
|
306
|
-
"list-style-position": value
|
|
307
|
-
};
|
|
308
|
-
}]
|
|
297
|
+
[/^list-(outside|inside)$/, ([, value]) => ({ "list-style-position": value })],
|
|
298
|
+
["list-none", { "list-style-type": "none" }]
|
|
309
299
|
];
|
|
310
300
|
const boxDecorationBreaks = [
|
|
311
301
|
["decoration-slice", { "box-decoration-break": "slice" }],
|
|
312
302
|
["decoration-clone", { "box-decoration-break": "clone" }]
|
|
313
303
|
];
|
|
304
|
+
const accentOpacity = [
|
|
305
|
+
[/^accent-op(?:acity)?-?(.+)$/, ([, d]) => ({ "--un-accent-opacity": utils.handler.bracket.percent(d) })]
|
|
306
|
+
];
|
|
307
|
+
const accentColors = [
|
|
308
|
+
[/^accent-(.+)$/, utils.colorResolver("accent-color", "accent")]
|
|
309
|
+
];
|
|
314
310
|
const caretOpacity = [
|
|
315
311
|
[/^caret-op(?:acity)?-?(.+)$/, ([, d]) => ({ "--un-caret-opacity": utils.handler.bracket.percent(d) })]
|
|
316
312
|
];
|
|
317
313
|
const caretColors = [
|
|
318
|
-
[/^caret-(.+)$/,
|
|
314
|
+
[/^caret-(.+)$/, utils.colorResolver("caret-color", "caret")]
|
|
319
315
|
];
|
|
320
316
|
const imageRenderings = [
|
|
321
317
|
["image-render-auto", { "image-rendering": "auto" }],
|
|
@@ -329,7 +325,6 @@ const imageRenderings = [
|
|
|
329
325
|
]]
|
|
330
326
|
];
|
|
331
327
|
const overflowValues = [
|
|
332
|
-
"none",
|
|
333
328
|
"auto",
|
|
334
329
|
"hidden",
|
|
335
330
|
"visible",
|
|
@@ -338,7 +333,42 @@ const overflowValues = [
|
|
|
338
333
|
];
|
|
339
334
|
const overscrolls = [
|
|
340
335
|
[/^overscroll-(.+)$/, ([, v]) => overflowValues.includes(v) ? { "overscroll-behavior": v } : void 0],
|
|
341
|
-
[
|
|
336
|
+
["overscroll-none", { "overscroll-behavior": "none" }],
|
|
337
|
+
[/^overscroll-([xy])-(.+)$/, ([, d, v]) => overflowValues.includes(v) ? { [`overscroll-behavior-${d}`]: v } : void 0],
|
|
338
|
+
["overscroll-x-none", { "overscroll-behavior-x": "none" }],
|
|
339
|
+
["overscroll-y-none", { "overscroll-behavior-y": "none" }]
|
|
340
|
+
];
|
|
341
|
+
const scrollBehaviors = [
|
|
342
|
+
["scroll-auto", { "scroll-behavior": "auto" }],
|
|
343
|
+
["scroll-smooth", { "scroll-behavior": "smooth" }]
|
|
344
|
+
];
|
|
345
|
+
|
|
346
|
+
const columns = [
|
|
347
|
+
[/^columns-(.+)$/, ([, v]) => {
|
|
348
|
+
const column = utils.handler.bracket.global.number.auto.numberWithUnit(v);
|
|
349
|
+
if (column)
|
|
350
|
+
return { column };
|
|
351
|
+
}],
|
|
352
|
+
["break-before-auto", { "break-before": "auto" }],
|
|
353
|
+
["break-before-avoid", { "break-before": "avoid" }],
|
|
354
|
+
["break-before-all", { "break-before": "all" }],
|
|
355
|
+
["break-before-avoid-page", { "break-before": "avoid-page" }],
|
|
356
|
+
["break-before-page", { "break-before": "page" }],
|
|
357
|
+
["break-before-left", { "break-before": "left" }],
|
|
358
|
+
["break-before-right", { "break-before": "right" }],
|
|
359
|
+
["break-before-column", { "break-before": "column" }],
|
|
360
|
+
["break-inside-auto", { "break-inside": "auto" }],
|
|
361
|
+
["break-inside-avoid", { "break-inside": "avoid" }],
|
|
362
|
+
["break-inside-avoid-page", { "break-inside": "avoid-page" }],
|
|
363
|
+
["break-inside-avoid-column", { "break-inside": "avoid-column" }],
|
|
364
|
+
["break-after-auto", { "break-after": "auto" }],
|
|
365
|
+
["break-after-avoid", { "break-after": "avoid" }],
|
|
366
|
+
["break-after-all", { "break-after": "all" }],
|
|
367
|
+
["break-after-avoid-page", { "break-after": "avoid-page" }],
|
|
368
|
+
["break-after-page", { "break-after": "page" }],
|
|
369
|
+
["break-after-left", { "break-after": "left" }],
|
|
370
|
+
["break-after-right", { "break-after": "right" }],
|
|
371
|
+
["break-after-column", { "break-after": "column" }]
|
|
342
372
|
];
|
|
343
373
|
|
|
344
374
|
const queryMatcher = /@media \(min-width: (.+)\)/;
|
|
@@ -375,34 +405,33 @@ const containerShortcuts = [
|
|
|
375
405
|
}]
|
|
376
406
|
];
|
|
377
407
|
|
|
378
|
-
const varEmpty = "var(--un-empty,/*!*/ /*!*/)";
|
|
379
408
|
const filterContnet = "var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia) var(--un-drop-shadow)";
|
|
380
409
|
const filterBase = {
|
|
381
|
-
"--un-blur": varEmpty,
|
|
382
|
-
"--un-brightness": varEmpty,
|
|
383
|
-
"--un-contrast": varEmpty,
|
|
384
|
-
"--un-grayscale": varEmpty,
|
|
385
|
-
"--un-hue-rotate": varEmpty,
|
|
386
|
-
"--un-invert": varEmpty,
|
|
387
|
-
"--un-saturate": varEmpty,
|
|
388
|
-
"--un-sepia": varEmpty,
|
|
389
|
-
"--un-drop-shadow": varEmpty,
|
|
410
|
+
"--un-blur": rules$1.varEmpty,
|
|
411
|
+
"--un-brightness": rules$1.varEmpty,
|
|
412
|
+
"--un-contrast": rules$1.varEmpty,
|
|
413
|
+
"--un-grayscale": rules$1.varEmpty,
|
|
414
|
+
"--un-hue-rotate": rules$1.varEmpty,
|
|
415
|
+
"--un-invert": rules$1.varEmpty,
|
|
416
|
+
"--un-saturate": rules$1.varEmpty,
|
|
417
|
+
"--un-sepia": rules$1.varEmpty,
|
|
418
|
+
"--un-drop-shadow": rules$1.varEmpty,
|
|
390
419
|
"filter": filterContnet,
|
|
391
|
-
[variants.
|
|
420
|
+
[variants.CONTROL_BYPASS_PSEUDO_CLASS]: ""
|
|
392
421
|
};
|
|
393
422
|
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
423
|
const backdropFilterBase = {
|
|
395
|
-
"--un-backdrop-blur": varEmpty,
|
|
396
|
-
"--un-backdrop-brightness": varEmpty,
|
|
397
|
-
"--un-backdrop-contrast": varEmpty,
|
|
398
|
-
"--un-backdrop-grayscale": varEmpty,
|
|
399
|
-
"--un-backdrop-hue-rotate": varEmpty,
|
|
400
|
-
"--un-backdrop-invert": varEmpty,
|
|
401
|
-
"--un-backdrop-saturate": varEmpty,
|
|
402
|
-
"--un-backdrop-sepia": varEmpty,
|
|
424
|
+
"--un-backdrop-blur": rules$1.varEmpty,
|
|
425
|
+
"--un-backdrop-brightness": rules$1.varEmpty,
|
|
426
|
+
"--un-backdrop-contrast": rules$1.varEmpty,
|
|
427
|
+
"--un-backdrop-grayscale": rules$1.varEmpty,
|
|
428
|
+
"--un-backdrop-hue-rotate": rules$1.varEmpty,
|
|
429
|
+
"--un-backdrop-invert": rules$1.varEmpty,
|
|
430
|
+
"--un-backdrop-saturate": rules$1.varEmpty,
|
|
431
|
+
"--un-backdrop-sepia": rules$1.varEmpty,
|
|
403
432
|
"-webkit-backdrop-filter": backdropFilterContent,
|
|
404
433
|
"backdrop-filter": backdropFilterContent,
|
|
405
|
-
[variants.
|
|
434
|
+
[variants.CONTROL_BYPASS_PSEUDO_CLASS]: ""
|
|
406
435
|
};
|
|
407
436
|
const percentWithDefault = (defaultValue = "1") => (str) => {
|
|
408
437
|
const v = str ? utils.handler.bracket.percent(str) : defaultValue;
|
|
@@ -419,12 +448,7 @@ const toFilter = (varName, resolver) => ([, b, s], { theme }) => {
|
|
|
419
448
|
};
|
|
420
449
|
const filters = [
|
|
421
450
|
["filter", filterBase],
|
|
422
|
-
["filter-none", { filter: "none" }],
|
|
423
451
|
["backdrop-filter", backdropFilterBase],
|
|
424
|
-
["backdrop-filter-none", {
|
|
425
|
-
"-webkit-backdrop-filter": "none",
|
|
426
|
-
"backdrop-filter": "none"
|
|
427
|
-
}],
|
|
428
452
|
[/^(backdrop-)?blur(?:-(.+))?$/, toFilter("blur", (s, theme) => theme.blur?.[s || "DEFAULT"] || utils.handler.bracket.px(s))],
|
|
429
453
|
[/^(backdrop-)?brightness-(\d+)$/, toFilter("brightness", (s) => utils.handler.bracket.percent(s))],
|
|
430
454
|
[/^(backdrop-)?contrast-(\d+)$/, toFilter("contrast", (s) => utils.handler.bracket.percent(s))],
|
|
@@ -437,11 +461,15 @@ const filters = [
|
|
|
437
461
|
[/^(backdrop-)?hue-rotate-(\d+)$/, toFilter("hue-rotate", (s) => `${utils.handler.bracket.number(s)}deg`)],
|
|
438
462
|
[/^(backdrop-)?invert(?:-(\d+))?$/, toFilter("invert", percentWithDefault())],
|
|
439
463
|
[/^(backdrop-)?saturate(?:-(\d+))?$/, toFilter("saturate", percentWithDefault("0"))],
|
|
440
|
-
[/^(backdrop-)?sepia(?:-(\d+))?$/, toFilter("sepia", percentWithDefault())]
|
|
464
|
+
[/^(backdrop-)?sepia(?:-(\d+))?$/, toFilter("sepia", percentWithDefault())],
|
|
465
|
+
["filter-none", { filter: "none" }],
|
|
466
|
+
["backdrop-filter-none", {
|
|
467
|
+
"-webkit-backdrop-filter": "none",
|
|
468
|
+
"backdrop-filter": "none"
|
|
469
|
+
}]
|
|
441
470
|
];
|
|
442
471
|
|
|
443
472
|
const mixBlendModes = [
|
|
444
|
-
["mix-blend-normal", { "mix-blend-mode": "normal" }],
|
|
445
473
|
["mix-blend-multiply", { "mix-blend-mode": "multiply" }],
|
|
446
474
|
["mix-blend-screen", { "mix-blend-mode": "screen" }],
|
|
447
475
|
["mix-blend-overlay", { "mix-blend-mode": "overlay" }],
|
|
@@ -456,20 +484,16 @@ const mixBlendModes = [
|
|
|
456
484
|
["mix-blend-hue", { "mix-blend-mode": "hue" }],
|
|
457
485
|
["mix-blend-saturation", { "mix-blend-mode": "saturation" }],
|
|
458
486
|
["mix-blend-color", { "mix-blend-mode": "color" }],
|
|
459
|
-
["mix-blend-luminosity", { "mix-blend-mode": "luminosity" }]
|
|
487
|
+
["mix-blend-luminosity", { "mix-blend-mode": "luminosity" }],
|
|
488
|
+
["mix-blend-normal", { "mix-blend-mode": "normal" }]
|
|
460
489
|
];
|
|
461
490
|
|
|
462
|
-
const directionSize = (prefix) => ([_, direction, size]) => {
|
|
463
|
-
const v = utils.handler.bracket.rem.fraction.cssvar(size);
|
|
464
|
-
if (v)
|
|
465
|
-
return utils.directionMap[direction].map((i) => [prefix + i, v]);
|
|
466
|
-
};
|
|
467
491
|
const spaces = [
|
|
468
492
|
[/^space-?([xy])-?(-?.+)$/, (match) => {
|
|
469
493
|
const [, direction, size] = match;
|
|
470
494
|
if (size === "reverse")
|
|
471
495
|
return { [`--un-space-${direction}-reverse`]: 1 };
|
|
472
|
-
const results = directionSize("margin")(match)?.map((item) => {
|
|
496
|
+
const results = utils.directionSize("margin")(match)?.map((item) => {
|
|
473
497
|
const value = item[0].endsWith("right") || item[0].endsWith("bottom") ? `calc(${item[1]} * var(--un-space-${direction}-reverse))` : `calc(${item[1]} * calc(1 - var(--un-space-${direction}-reverse)))`;
|
|
474
498
|
return [item[0], value];
|
|
475
499
|
});
|
|
@@ -489,11 +513,6 @@ const textTransforms = [
|
|
|
489
513
|
["normal-case", { "text-transform": "none" }]
|
|
490
514
|
];
|
|
491
515
|
const hyphens = [
|
|
492
|
-
["hyphens-none", {
|
|
493
|
-
"-webkit-hyphens": "none",
|
|
494
|
-
"-ms-hyphens": "none",
|
|
495
|
-
"hyphens": "none"
|
|
496
|
-
}],
|
|
497
516
|
["hyphens-manual", {
|
|
498
517
|
"-webkit-hyphens": "manual",
|
|
499
518
|
"-ms-hyphens": "manual",
|
|
@@ -503,17 +522,22 @@ const hyphens = [
|
|
|
503
522
|
"-webkit-hyphens": "auto",
|
|
504
523
|
"-ms-hyphens": "auto",
|
|
505
524
|
"hyphens": "auto"
|
|
525
|
+
}],
|
|
526
|
+
["hyphens-none", {
|
|
527
|
+
"-webkit-hyphens": "none",
|
|
528
|
+
"-ms-hyphens": "none",
|
|
529
|
+
"hyphens": "none"
|
|
506
530
|
}]
|
|
507
531
|
];
|
|
508
532
|
const writingModes = [
|
|
509
|
-
["write-normal", { "writing-mode": "horizontal-tb" }],
|
|
510
533
|
["write-vertical-right", { "writing-mode": "vertical-rl" }],
|
|
511
|
-
["write-vertical-left", { "writing-mode": "vertical-lr" }]
|
|
534
|
+
["write-vertical-left", { "writing-mode": "vertical-lr" }],
|
|
535
|
+
["write-normal", { "writing-mode": "horizontal-tb" }]
|
|
512
536
|
];
|
|
513
537
|
const writingOrientations = [
|
|
514
538
|
["write-orient-mixed", { "text-orientation": "mixed" }],
|
|
515
|
-
["write-orient-
|
|
516
|
-
["write-orient-
|
|
539
|
+
["write-orient-sideways", { "text-orientation": "sideways" }],
|
|
540
|
+
["write-orient-upright", { "text-orientation": "upright" }]
|
|
517
541
|
];
|
|
518
542
|
const screenReadersAccess = [
|
|
519
543
|
[
|
|
@@ -568,16 +592,8 @@ const objectPositions = [
|
|
|
568
592
|
];
|
|
569
593
|
|
|
570
594
|
const tables = [
|
|
571
|
-
["border-collapse", { "border-collapse": "collapse" }],
|
|
572
|
-
["border-separate", { "border-collapse": "separate" }],
|
|
573
|
-
["caption-top", { "caption-side": "top" }],
|
|
574
|
-
["caption-bottom", { "caption-side": "bottom" }],
|
|
575
595
|
["inline-table", { display: "inline-table" }],
|
|
576
596
|
["table", { display: "table" }],
|
|
577
|
-
["table-auto", { "table-layout": "auto" }],
|
|
578
|
-
["table-empty-cells-visible", { "empty-cells": "show" }],
|
|
579
|
-
["table-empty-cells-hidden", { "empty-cells": "hide" }],
|
|
580
|
-
["table-fixed", { "table-layout": "fixed" }],
|
|
581
597
|
["table-caption", { display: "table-caption" }],
|
|
582
598
|
["table-cell", { display: "table-cell" }],
|
|
583
599
|
["table-column", { display: "table-column" }],
|
|
@@ -585,7 +601,15 @@ const tables = [
|
|
|
585
601
|
["table-footer-group", { display: "table-footer-group" }],
|
|
586
602
|
["table-header-group", { display: "table-header-group" }],
|
|
587
603
|
["table-row", { display: "table-row" }],
|
|
588
|
-
["table-row-group", { display: "table-row-group" }]
|
|
604
|
+
["table-row-group", { display: "table-row-group" }],
|
|
605
|
+
["border-collapse", { "border-collapse": "collapse" }],
|
|
606
|
+
["border-separate", { "border-collapse": "separate" }],
|
|
607
|
+
["caption-top", { "caption-side": "top" }],
|
|
608
|
+
["caption-bottom", { "caption-side": "bottom" }],
|
|
609
|
+
["table-auto", { "table-layout": "auto" }],
|
|
610
|
+
["table-fixed", { "table-layout": "fixed" }],
|
|
611
|
+
["table-empty-cells-visible", { "empty-cells": "show" }],
|
|
612
|
+
["table-empty-cells-hidden", { "empty-cells": "hide" }]
|
|
589
613
|
];
|
|
590
614
|
|
|
591
615
|
const variablesAbbrMap = {
|
|
@@ -614,8 +638,8 @@ const cssVariables = [[
|
|
|
614
638
|
]];
|
|
615
639
|
|
|
616
640
|
const divideColors = [
|
|
617
|
-
[/^divide-(.+)$/,
|
|
618
|
-
[/^divide-op(?:acity)?-?(.+)
|
|
641
|
+
[/^divide-(.+)$/, utils.colorResolver("border-color", "divide")],
|
|
642
|
+
[/^divide-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-divide-opacity": utils.handler.bracket.percent(opacity) })]
|
|
619
643
|
];
|
|
620
644
|
const divideSizes = [
|
|
621
645
|
[/^divide-?([xy])$/, handlerDivide],
|
|
@@ -665,7 +689,7 @@ const fontVariantNumericBase = {
|
|
|
665
689
|
"--un-numeric-spacing": rules$1.varEmpty,
|
|
666
690
|
"--un-numeric-fraction": rules$1.varEmpty,
|
|
667
691
|
"font-variant-numeric": "var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)",
|
|
668
|
-
[variants.
|
|
692
|
+
[variants.CONTROL_BYPASS_PSEUDO_CLASS]: ""
|
|
669
693
|
};
|
|
670
694
|
const fontVariantNumeric = [
|
|
671
695
|
[/^ordinal$/, () => [fontVariantNumericBase, { "--un-ordinal": "ordinal" }]],
|
|
@@ -679,6 +703,67 @@ const fontVariantNumeric = [
|
|
|
679
703
|
["normal-nums", { "font-variant-numeric": "normal" }]
|
|
680
704
|
];
|
|
681
705
|
|
|
706
|
+
const touchActionBase = {
|
|
707
|
+
"--un-pan-x": rules$1.varEmpty,
|
|
708
|
+
"--un-pan-y": rules$1.varEmpty,
|
|
709
|
+
"--un-pinch-zoom": rules$1.varEmpty,
|
|
710
|
+
"--un-touch-action": "var(--un-pan-x) var(--un-pan-y) var(--un-pinch-zoom)",
|
|
711
|
+
[variants.CONTROL_BYPASS_PSEUDO_CLASS]: ""
|
|
712
|
+
};
|
|
713
|
+
const touchActions = [
|
|
714
|
+
[/^touch-pan-(x|left|right)$/, ([, d]) => [
|
|
715
|
+
touchActionBase,
|
|
716
|
+
{
|
|
717
|
+
"--un-pan-x": `pan-${d}`,
|
|
718
|
+
"touch-action": "var(--un-touch-action)"
|
|
719
|
+
}
|
|
720
|
+
]],
|
|
721
|
+
[/^touch-pan-(y|up|down)$/, ([, d]) => [
|
|
722
|
+
touchActionBase,
|
|
723
|
+
{
|
|
724
|
+
"--un-pan-y": `pan-${d}`,
|
|
725
|
+
"touch-action": "var(--un-touch-action)"
|
|
726
|
+
}
|
|
727
|
+
]],
|
|
728
|
+
[/^touch-pinch-zoom$/, () => [
|
|
729
|
+
touchActionBase,
|
|
730
|
+
{
|
|
731
|
+
"--un-pinch-zoom": "pinch-zoom",
|
|
732
|
+
"touch-action": "var(--un-touch-action)"
|
|
733
|
+
}
|
|
734
|
+
]],
|
|
735
|
+
["touch-auto", { "touch-action": "auto" }],
|
|
736
|
+
["touch-manipulation", { "touch-action": "manipulation" }],
|
|
737
|
+
["touch-none", { "touch-action": "none" }]
|
|
738
|
+
];
|
|
739
|
+
|
|
740
|
+
const scrolls = [
|
|
741
|
+
[/^snap-(x|y|base)$/, ([, d]) => [
|
|
742
|
+
{
|
|
743
|
+
"--un-scroll-snap-strictness": "proximity",
|
|
744
|
+
[variants.CONTROL_BYPASS_PSEUDO_CLASS]: ""
|
|
745
|
+
},
|
|
746
|
+
{
|
|
747
|
+
"scroll-snap-type": `${d} var(--un-scroll-snap-strictness)`
|
|
748
|
+
}
|
|
749
|
+
]],
|
|
750
|
+
["snap-mandatory", { "--un-scroll-snap-strictness": "mandatory" }],
|
|
751
|
+
["snap-proximity", { "--un-scroll-snap-strictness": "proximity" }],
|
|
752
|
+
["snap-none", { "scroll-snap-type": "none" }],
|
|
753
|
+
["snap-start", { "scroll-snap-align": "start" }],
|
|
754
|
+
["snap-end", { "scroll-snap-align": "end" }],
|
|
755
|
+
["snap-center", { "scroll-snap-align": "center" }],
|
|
756
|
+
["snap-align-none", { "scroll-snap-align": "none" }],
|
|
757
|
+
["snap-normal", { "scroll-snap-stop": "normal" }],
|
|
758
|
+
["snap-always", { "scroll-snap-stop": "always" }],
|
|
759
|
+
[/^scroll-ma?()-?(-?.+)$/, utils.directionSize("scroll-margin")],
|
|
760
|
+
[/^scroll-m-?([xy])-?(-?.+)$/, utils.directionSize("scroll-margin")],
|
|
761
|
+
[/^scroll-m-?([rltb])-?(-?.+)$/, utils.directionSize("scroll-margin")],
|
|
762
|
+
[/^scroll-pa?()-?(-?.+)$/, utils.directionSize("scroll-padding")],
|
|
763
|
+
[/^scroll-p-?([xy])-?(-?.+)$/, utils.directionSize("scroll-padding")],
|
|
764
|
+
[/^scroll-p-?([rltb])-?(-?.+)$/, utils.directionSize("scroll-padding")]
|
|
765
|
+
];
|
|
766
|
+
|
|
682
767
|
const rules = [
|
|
683
768
|
rules$1.cssVariables,
|
|
684
769
|
cssVariables,
|
|
@@ -704,10 +789,13 @@ const rules = [
|
|
|
704
789
|
rules$1.transforms,
|
|
705
790
|
animations,
|
|
706
791
|
rules$1.cursors,
|
|
792
|
+
touchActions,
|
|
707
793
|
rules$1.userSelects,
|
|
708
794
|
rules$1.resizes,
|
|
795
|
+
scrolls,
|
|
709
796
|
listStyle,
|
|
710
797
|
rules$1.appearance,
|
|
798
|
+
columns,
|
|
711
799
|
rules$1.placements,
|
|
712
800
|
rules$1.alignments,
|
|
713
801
|
rules$1.justifies,
|
|
@@ -716,6 +804,7 @@ const rules = [
|
|
|
716
804
|
divides,
|
|
717
805
|
rules$1.overflows,
|
|
718
806
|
overscrolls,
|
|
807
|
+
scrollBehaviors,
|
|
719
808
|
rules$1.textOverflows,
|
|
720
809
|
rules$1.whitespaces,
|
|
721
810
|
rules$1.breaks,
|
|
@@ -723,7 +812,7 @@ const rules = [
|
|
|
723
812
|
rules$1.bgColors,
|
|
724
813
|
boxDecorationBreaks,
|
|
725
814
|
backgroundStyles,
|
|
726
|
-
rules$1.
|
|
815
|
+
rules$1.svgUtilities,
|
|
727
816
|
objectPositions,
|
|
728
817
|
rules$1.paddings,
|
|
729
818
|
rules$1.textAligns,
|
|
@@ -742,9 +831,10 @@ const rules = [
|
|
|
742
831
|
hyphens,
|
|
743
832
|
writingModes,
|
|
744
833
|
writingOrientations,
|
|
745
|
-
rules$1.placeholder,
|
|
746
834
|
caretColors,
|
|
747
835
|
caretOpacity,
|
|
836
|
+
accentColors,
|
|
837
|
+
accentOpacity,
|
|
748
838
|
rules$1.opacity,
|
|
749
839
|
mixBlendModes,
|
|
750
840
|
rules$1.boxShadows,
|
|
@@ -753,10 +843,32 @@ const rules = [
|
|
|
753
843
|
imageRenderings,
|
|
754
844
|
filters,
|
|
755
845
|
rules$1.transitions,
|
|
846
|
+
rules$1.willChange,
|
|
756
847
|
rules$1.contents,
|
|
757
848
|
rules$1.questionMark
|
|
758
849
|
].flat(1);
|
|
759
850
|
|
|
851
|
+
const variantColorsScheme = [
|
|
852
|
+
utils.variantMatcher("\\.dark", (input) => `.dark $$ ${input}`),
|
|
853
|
+
utils.variantMatcher("\\.light", (input) => `.light $$ ${input}`),
|
|
854
|
+
(v) => {
|
|
855
|
+
const dark = utils.variantMatcher("@dark")(v);
|
|
856
|
+
if (dark) {
|
|
857
|
+
return {
|
|
858
|
+
...dark,
|
|
859
|
+
parent: "@media (prefers-color-scheme: dark)"
|
|
860
|
+
};
|
|
861
|
+
}
|
|
862
|
+
const light = utils.variantMatcher("@light")(v);
|
|
863
|
+
if (light) {
|
|
864
|
+
return {
|
|
865
|
+
...light,
|
|
866
|
+
parent: "@media (prefers-color-scheme: light)"
|
|
867
|
+
};
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
];
|
|
871
|
+
|
|
760
872
|
const presetWind = (options = {}) => ({
|
|
761
873
|
name: "@unocss/preset-wind",
|
|
762
874
|
theme: theme.theme,
|
|
@@ -765,8 +877,8 @@ const presetWind = (options = {}) => ({
|
|
|
765
877
|
...containerShortcuts
|
|
766
878
|
],
|
|
767
879
|
variants: [
|
|
768
|
-
...variants.variants,
|
|
769
|
-
...
|
|
880
|
+
...variants.variants(options),
|
|
881
|
+
...variantColorsScheme
|
|
770
882
|
],
|
|
771
883
|
options
|
|
772
884
|
});
|
package/dist/index.d.ts
CHANGED
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 } from '@unocss/preset-mini/variants';
|
|
3
3
|
import { toArray } from '@unocss/core';
|
|
4
4
|
export { colors, theme } from '@unocss/preset-mini';
|
|
5
|
-
import {
|
|
6
|
-
import { handler, directionMap } from '@unocss/preset-mini/utils';
|
|
5
|
+
import { varEmpty, 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, opacity, boxShadows, outline, rings, transitions, willChange, contents, questionMark } from '@unocss/preset-mini/rules';
|
|
6
|
+
import { handler, parseColor, colorResolver as colorResolver$1, directionSize, directionMap, variantMatcher } from '@unocss/preset-mini/utils';
|
|
7
7
|
|
|
8
8
|
const keyframes = {
|
|
9
9
|
"pulse": "{0%, 100% {opacity:1} 50% {opacity:.5}}",
|
|
@@ -154,25 +154,29 @@ const properties = {
|
|
|
154
154
|
"zoom-out-up": { "transform-origin": "center bottom" }
|
|
155
155
|
};
|
|
156
156
|
const animations = [
|
|
157
|
-
[/^animate-(
|
|
157
|
+
[/^animate-(.+)$/, ([, name], { constructCSS }) => {
|
|
158
158
|
const kf = keyframes[name];
|
|
159
159
|
if (kf) {
|
|
160
160
|
return `@keyframes ${name}${kf}
|
|
161
161
|
${constructCSS(Object.assign({ animation: `${name} ${durations[name] || "1s"} ${timingFns[name] || "linear"} infinite` }, properties[name]))}`;
|
|
162
162
|
}
|
|
163
163
|
}],
|
|
164
|
-
["animate-none", { animation: "none" }],
|
|
165
164
|
[/^animate(?:-duration)?-((.+)(?:(s|ms)?))$/, ([, d]) => ({ "animation-duration": handler.bracket.time(d.replace(/-duration/, "")) })],
|
|
166
165
|
[/^animate-delay-((.+)(?:(s|ms)?))$/, ([, d]) => ({ "animation-delay": handler.bracket.time(d) })],
|
|
167
|
-
[/^animate-(?:fill-)?mode-(
|
|
168
|
-
[
|
|
166
|
+
[/^animate-(?:fill-)?mode-(forwards|backwards|both|inherit|initial|revert|unset)$/, ([, d]) => ({ "animation-fill-mode": d })],
|
|
167
|
+
["animate-mode-none", { "animation-fill-mode": "none" }],
|
|
168
|
+
["animate-fill-mode-none", { "animation-fill-mode": "none" }],
|
|
169
|
+
[/^animate-(?:direction-)?(reverse|alternate|alternate-reverse|inherit|initial|revert|unset)$/, ([, d]) => ({ "animation-direction": d })],
|
|
170
|
+
["animate-normal", { "animation-direction": "normal" }],
|
|
171
|
+
["animate-direction-normal", { "animation-direction": "normal" }],
|
|
169
172
|
[/^animate-(?:iteration-)?count-(.+)$/, ([, d]) => ({ "animation-iteration-count": d.replace(/\-/g, ", ") })],
|
|
170
173
|
[/^animate-name-(.+)/, ([, d]) => ({ "animation-name": d })],
|
|
171
|
-
[/^animate-play(?:-state)?-(paused|running|inherit|initial|revert|unset)$/, ([, d]) => ({ "animation-play-state": d })]
|
|
174
|
+
[/^animate-play(?:-state)?-(paused|running|inherit|initial|revert|unset)$/, ([, d]) => ({ "animation-play-state": d })],
|
|
175
|
+
["animate-none", { animation: "none" }]
|
|
172
176
|
];
|
|
173
177
|
|
|
174
178
|
const colorResolver = (mode) => ([, body], { theme }) => {
|
|
175
|
-
const data =
|
|
179
|
+
const data = parseColor(body, theme);
|
|
176
180
|
if (!data)
|
|
177
181
|
return;
|
|
178
182
|
const { opacity, color, rgba } = data;
|
|
@@ -204,11 +208,20 @@ const colorResolver = (mode) => ([, body], { theme }) => {
|
|
|
204
208
|
};
|
|
205
209
|
}
|
|
206
210
|
};
|
|
211
|
+
const bgGradientDirections = {
|
|
212
|
+
t: "top",
|
|
213
|
+
tr: "top right",
|
|
214
|
+
r: "right",
|
|
215
|
+
br: "bottom right",
|
|
216
|
+
b: "bottom",
|
|
217
|
+
bl: "bottom left",
|
|
218
|
+
l: "left",
|
|
219
|
+
tl: "top left"
|
|
220
|
+
};
|
|
207
221
|
const backgroundStyles = [
|
|
208
222
|
["bg-fixed", { "background-attachment": "fixed" }],
|
|
209
223
|
["bg-local", { "background-attachment": "local" }],
|
|
210
224
|
["bg-scroll", { "background-attachment": "scroll" }],
|
|
211
|
-
["bg-blend-normal", { "background-blend-mode": "normal" }],
|
|
212
225
|
["bg-blend-multiply", { "background-blend-mode": "multiply" }],
|
|
213
226
|
["bg-blend-screen", { "background-blend-mode": "screen" }],
|
|
214
227
|
["bg-blend-overlay", { "background-blend-mode": "overlay" }],
|
|
@@ -224,41 +237,23 @@ const backgroundStyles = [
|
|
|
224
237
|
["bg-blend-saturation", { "background-blend-mode": "saturation" }],
|
|
225
238
|
["bg-blend-color", { "background-blend-mode": "color" }],
|
|
226
239
|
["bg-blend-luminosity", { "background-blend-mode": "luminosity" }],
|
|
240
|
+
["bg-blend-normal", { "background-blend-mode": "normal" }],
|
|
227
241
|
["bg-clip-border", { "-webkit-background-clip": "border-box", "background-attachment": "border-box" }],
|
|
228
242
|
["bg-clip-content", { "-webkit-background-clip": "content-box", "background-attachment": "content-box" }],
|
|
229
243
|
["bg-clip-padding", { "-webkit-background-clip": "padding-box", "background-attachment": "padding-box" }],
|
|
230
244
|
["bg-clip-text", { "-webkit-background-clip": "text", "background-attachment": "text" }],
|
|
231
|
-
[/^from-(.+)$/, colorResolver("from")],
|
|
232
|
-
[/^to-(.+)$/, colorResolver("to")],
|
|
233
|
-
[/^via-(.+)$/, colorResolver("via")],
|
|
234
|
-
[/^from-op(?:acity)?-?(.+)
|
|
235
|
-
[/^to-op(?:acity)?-?(.+)
|
|
236
|
-
[/^via-op(?:acity)?-?(.+)
|
|
237
|
-
[
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
["bg-gradient-to-tr", {
|
|
242
|
-
"background-image": "linear-gradient(to top right, var(--un-gradient-stops))"
|
|
243
|
-
}],
|
|
244
|
-
["bg-gradient-to-r", {
|
|
245
|
-
"background-image": "linear-gradient(to right, var(--un-gradient-stops))"
|
|
246
|
-
}],
|
|
247
|
-
["bg-gradient-to-br", {
|
|
248
|
-
"background-image": "linear-gradient(to bottom right, var(--un-gradient-stops))"
|
|
249
|
-
}],
|
|
250
|
-
["bg-gradient-to-b", {
|
|
251
|
-
"background-image": "linear-gradient(to bottom, var(--un-gradient-stops))"
|
|
252
|
-
}],
|
|
253
|
-
["bg-gradient-to-bl", {
|
|
254
|
-
"background-image": "linear-gradient(to bottom left, var(--un-gradient-stops))"
|
|
255
|
-
}],
|
|
256
|
-
["bg-gradient-to-l", {
|
|
257
|
-
"background-image": "linear-gradient(to left, var(--un-gradient-stops))"
|
|
258
|
-
}],
|
|
259
|
-
["bg-gradient-to-tl", {
|
|
260
|
-
"background-image": "linear-gradient(to top left, var(--un-gradient-stops))"
|
|
245
|
+
[/^(?:bg-gradient-)?from-(.+)$/, colorResolver("from")],
|
|
246
|
+
[/^(?:bg-gradient-)?to-(.+)$/, colorResolver("to")],
|
|
247
|
+
[/^(?:bg-gradient-)?via-(.+)$/, colorResolver("via")],
|
|
248
|
+
[/^(?:bg-gradient-)?from-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-from-opacity": handler.bracket.percent(opacity) })],
|
|
249
|
+
[/^(?:bg-gradient-)?to-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-to-opacity": handler.bracket.percent(opacity) })],
|
|
250
|
+
[/^(?:bg-gradient-)?via-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-via-opacity": handler.bracket.percent(opacity) })],
|
|
251
|
+
[/^bg-gradient-to-([trbl]{1,2})$/, ([, d]) => {
|
|
252
|
+
const v = bgGradientDirections[d];
|
|
253
|
+
if (v)
|
|
254
|
+
return { "background-image": `linear-gradient(to ${v}, var(--un-gradient-stops))` };
|
|
261
255
|
}],
|
|
256
|
+
["bg-none", { "background-image": "none" }],
|
|
262
257
|
["bg-origin-border", { "background-origin": "border-box" }],
|
|
263
258
|
["bg-origin-padding", { "background-origin": "padding-box" }],
|
|
264
259
|
["bg-origin-content", { "background-origin": "content-box" }],
|
|
@@ -282,31 +277,32 @@ const backgroundStyles = [
|
|
|
282
277
|
["bg-contain", { "background-size": "contain" }]
|
|
283
278
|
];
|
|
284
279
|
|
|
285
|
-
const listStyleProps = ["
|
|
280
|
+
const listStyleProps = ["disc", "circle", "square", "decimal", "zero-decimal", "greek", "roman", "upper-roman", "alpha", "upper-alpha"];
|
|
286
281
|
const listStyle = [
|
|
287
|
-
[new RegExp(`^list-((
|
|
282
|
+
[new RegExp(`^list-((?:${listStyleProps.join("|")})(?:-outside|-inside)?)$`), ([, value]) => {
|
|
288
283
|
const style = value.split(/-outside|-inside/)[0];
|
|
289
|
-
const position = /inside
|
|
284
|
+
const position = /outside|inside/.exec(value) ?? [];
|
|
290
285
|
if (position.length) {
|
|
291
286
|
return {
|
|
292
287
|
"list-style-position": `${position[0]}`,
|
|
293
|
-
"list-style-type":
|
|
288
|
+
"list-style-type": style
|
|
294
289
|
};
|
|
295
290
|
}
|
|
296
|
-
return {
|
|
297
|
-
"list-style-type": `${style}`
|
|
298
|
-
};
|
|
291
|
+
return { "list-style-type": style };
|
|
299
292
|
}],
|
|
300
|
-
[/^list-(inside
|
|
301
|
-
|
|
302
|
-
"list-style-position": value
|
|
303
|
-
};
|
|
304
|
-
}]
|
|
293
|
+
[/^list-(outside|inside)$/, ([, value]) => ({ "list-style-position": value })],
|
|
294
|
+
["list-none", { "list-style-type": "none" }]
|
|
305
295
|
];
|
|
306
296
|
const boxDecorationBreaks = [
|
|
307
297
|
["decoration-slice", { "box-decoration-break": "slice" }],
|
|
308
298
|
["decoration-clone", { "box-decoration-break": "clone" }]
|
|
309
299
|
];
|
|
300
|
+
const accentOpacity = [
|
|
301
|
+
[/^accent-op(?:acity)?-?(.+)$/, ([, d]) => ({ "--un-accent-opacity": handler.bracket.percent(d) })]
|
|
302
|
+
];
|
|
303
|
+
const accentColors = [
|
|
304
|
+
[/^accent-(.+)$/, colorResolver$1("accent-color", "accent")]
|
|
305
|
+
];
|
|
310
306
|
const caretOpacity = [
|
|
311
307
|
[/^caret-op(?:acity)?-?(.+)$/, ([, d]) => ({ "--un-caret-opacity": handler.bracket.percent(d) })]
|
|
312
308
|
];
|
|
@@ -325,7 +321,6 @@ const imageRenderings = [
|
|
|
325
321
|
]]
|
|
326
322
|
];
|
|
327
323
|
const overflowValues = [
|
|
328
|
-
"none",
|
|
329
324
|
"auto",
|
|
330
325
|
"hidden",
|
|
331
326
|
"visible",
|
|
@@ -334,7 +329,42 @@ const overflowValues = [
|
|
|
334
329
|
];
|
|
335
330
|
const overscrolls = [
|
|
336
331
|
[/^overscroll-(.+)$/, ([, v]) => overflowValues.includes(v) ? { "overscroll-behavior": v } : void 0],
|
|
337
|
-
[
|
|
332
|
+
["overscroll-none", { "overscroll-behavior": "none" }],
|
|
333
|
+
[/^overscroll-([xy])-(.+)$/, ([, d, v]) => overflowValues.includes(v) ? { [`overscroll-behavior-${d}`]: v } : void 0],
|
|
334
|
+
["overscroll-x-none", { "overscroll-behavior-x": "none" }],
|
|
335
|
+
["overscroll-y-none", { "overscroll-behavior-y": "none" }]
|
|
336
|
+
];
|
|
337
|
+
const scrollBehaviors = [
|
|
338
|
+
["scroll-auto", { "scroll-behavior": "auto" }],
|
|
339
|
+
["scroll-smooth", { "scroll-behavior": "smooth" }]
|
|
340
|
+
];
|
|
341
|
+
|
|
342
|
+
const columns = [
|
|
343
|
+
[/^columns-(.+)$/, ([, v]) => {
|
|
344
|
+
const column = handler.bracket.global.number.auto.numberWithUnit(v);
|
|
345
|
+
if (column)
|
|
346
|
+
return { column };
|
|
347
|
+
}],
|
|
348
|
+
["break-before-auto", { "break-before": "auto" }],
|
|
349
|
+
["break-before-avoid", { "break-before": "avoid" }],
|
|
350
|
+
["break-before-all", { "break-before": "all" }],
|
|
351
|
+
["break-before-avoid-page", { "break-before": "avoid-page" }],
|
|
352
|
+
["break-before-page", { "break-before": "page" }],
|
|
353
|
+
["break-before-left", { "break-before": "left" }],
|
|
354
|
+
["break-before-right", { "break-before": "right" }],
|
|
355
|
+
["break-before-column", { "break-before": "column" }],
|
|
356
|
+
["break-inside-auto", { "break-inside": "auto" }],
|
|
357
|
+
["break-inside-avoid", { "break-inside": "avoid" }],
|
|
358
|
+
["break-inside-avoid-page", { "break-inside": "avoid-page" }],
|
|
359
|
+
["break-inside-avoid-column", { "break-inside": "avoid-column" }],
|
|
360
|
+
["break-after-auto", { "break-after": "auto" }],
|
|
361
|
+
["break-after-avoid", { "break-after": "avoid" }],
|
|
362
|
+
["break-after-all", { "break-after": "all" }],
|
|
363
|
+
["break-after-avoid-page", { "break-after": "avoid-page" }],
|
|
364
|
+
["break-after-page", { "break-after": "page" }],
|
|
365
|
+
["break-after-left", { "break-after": "left" }],
|
|
366
|
+
["break-after-right", { "break-after": "right" }],
|
|
367
|
+
["break-after-column", { "break-after": "column" }]
|
|
338
368
|
];
|
|
339
369
|
|
|
340
370
|
const queryMatcher = /@media \(min-width: (.+)\)/;
|
|
@@ -371,7 +401,6 @@ const containerShortcuts = [
|
|
|
371
401
|
}]
|
|
372
402
|
];
|
|
373
403
|
|
|
374
|
-
const varEmpty = "var(--un-empty,/*!*/ /*!*/)";
|
|
375
404
|
const filterContnet = "var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia) var(--un-drop-shadow)";
|
|
376
405
|
const filterBase = {
|
|
377
406
|
"--un-blur": varEmpty,
|
|
@@ -384,7 +413,7 @@ const filterBase = {
|
|
|
384
413
|
"--un-sepia": varEmpty,
|
|
385
414
|
"--un-drop-shadow": varEmpty,
|
|
386
415
|
"filter": filterContnet,
|
|
387
|
-
[
|
|
416
|
+
[CONTROL_BYPASS_PSEUDO_CLASS]: ""
|
|
388
417
|
};
|
|
389
418
|
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
419
|
const backdropFilterBase = {
|
|
@@ -398,7 +427,7 @@ const backdropFilterBase = {
|
|
|
398
427
|
"--un-backdrop-sepia": varEmpty,
|
|
399
428
|
"-webkit-backdrop-filter": backdropFilterContent,
|
|
400
429
|
"backdrop-filter": backdropFilterContent,
|
|
401
|
-
[
|
|
430
|
+
[CONTROL_BYPASS_PSEUDO_CLASS]: ""
|
|
402
431
|
};
|
|
403
432
|
const percentWithDefault = (defaultValue = "1") => (str) => {
|
|
404
433
|
const v = str ? handler.bracket.percent(str) : defaultValue;
|
|
@@ -415,12 +444,7 @@ const toFilter = (varName, resolver) => ([, b, s], { theme }) => {
|
|
|
415
444
|
};
|
|
416
445
|
const filters = [
|
|
417
446
|
["filter", filterBase],
|
|
418
|
-
["filter-none", { filter: "none" }],
|
|
419
447
|
["backdrop-filter", backdropFilterBase],
|
|
420
|
-
["backdrop-filter-none", {
|
|
421
|
-
"-webkit-backdrop-filter": "none",
|
|
422
|
-
"backdrop-filter": "none"
|
|
423
|
-
}],
|
|
424
448
|
[/^(backdrop-)?blur(?:-(.+))?$/, toFilter("blur", (s, theme) => theme.blur?.[s || "DEFAULT"] || handler.bracket.px(s))],
|
|
425
449
|
[/^(backdrop-)?brightness-(\d+)$/, toFilter("brightness", (s) => handler.bracket.percent(s))],
|
|
426
450
|
[/^(backdrop-)?contrast-(\d+)$/, toFilter("contrast", (s) => handler.bracket.percent(s))],
|
|
@@ -433,11 +457,15 @@ const filters = [
|
|
|
433
457
|
[/^(backdrop-)?hue-rotate-(\d+)$/, toFilter("hue-rotate", (s) => `${handler.bracket.number(s)}deg`)],
|
|
434
458
|
[/^(backdrop-)?invert(?:-(\d+))?$/, toFilter("invert", percentWithDefault())],
|
|
435
459
|
[/^(backdrop-)?saturate(?:-(\d+))?$/, toFilter("saturate", percentWithDefault("0"))],
|
|
436
|
-
[/^(backdrop-)?sepia(?:-(\d+))?$/, toFilter("sepia", percentWithDefault())]
|
|
460
|
+
[/^(backdrop-)?sepia(?:-(\d+))?$/, toFilter("sepia", percentWithDefault())],
|
|
461
|
+
["filter-none", { filter: "none" }],
|
|
462
|
+
["backdrop-filter-none", {
|
|
463
|
+
"-webkit-backdrop-filter": "none",
|
|
464
|
+
"backdrop-filter": "none"
|
|
465
|
+
}]
|
|
437
466
|
];
|
|
438
467
|
|
|
439
468
|
const mixBlendModes = [
|
|
440
|
-
["mix-blend-normal", { "mix-blend-mode": "normal" }],
|
|
441
469
|
["mix-blend-multiply", { "mix-blend-mode": "multiply" }],
|
|
442
470
|
["mix-blend-screen", { "mix-blend-mode": "screen" }],
|
|
443
471
|
["mix-blend-overlay", { "mix-blend-mode": "overlay" }],
|
|
@@ -452,14 +480,10 @@ const mixBlendModes = [
|
|
|
452
480
|
["mix-blend-hue", { "mix-blend-mode": "hue" }],
|
|
453
481
|
["mix-blend-saturation", { "mix-blend-mode": "saturation" }],
|
|
454
482
|
["mix-blend-color", { "mix-blend-mode": "color" }],
|
|
455
|
-
["mix-blend-luminosity", { "mix-blend-mode": "luminosity" }]
|
|
483
|
+
["mix-blend-luminosity", { "mix-blend-mode": "luminosity" }],
|
|
484
|
+
["mix-blend-normal", { "mix-blend-mode": "normal" }]
|
|
456
485
|
];
|
|
457
486
|
|
|
458
|
-
const directionSize = (prefix) => ([_, direction, size]) => {
|
|
459
|
-
const v = handler.bracket.rem.fraction.cssvar(size);
|
|
460
|
-
if (v)
|
|
461
|
-
return directionMap[direction].map((i) => [prefix + i, v]);
|
|
462
|
-
};
|
|
463
487
|
const spaces = [
|
|
464
488
|
[/^space-?([xy])-?(-?.+)$/, (match) => {
|
|
465
489
|
const [, direction, size] = match;
|
|
@@ -485,11 +509,6 @@ const textTransforms = [
|
|
|
485
509
|
["normal-case", { "text-transform": "none" }]
|
|
486
510
|
];
|
|
487
511
|
const hyphens = [
|
|
488
|
-
["hyphens-none", {
|
|
489
|
-
"-webkit-hyphens": "none",
|
|
490
|
-
"-ms-hyphens": "none",
|
|
491
|
-
"hyphens": "none"
|
|
492
|
-
}],
|
|
493
512
|
["hyphens-manual", {
|
|
494
513
|
"-webkit-hyphens": "manual",
|
|
495
514
|
"-ms-hyphens": "manual",
|
|
@@ -499,17 +518,22 @@ const hyphens = [
|
|
|
499
518
|
"-webkit-hyphens": "auto",
|
|
500
519
|
"-ms-hyphens": "auto",
|
|
501
520
|
"hyphens": "auto"
|
|
521
|
+
}],
|
|
522
|
+
["hyphens-none", {
|
|
523
|
+
"-webkit-hyphens": "none",
|
|
524
|
+
"-ms-hyphens": "none",
|
|
525
|
+
"hyphens": "none"
|
|
502
526
|
}]
|
|
503
527
|
];
|
|
504
528
|
const writingModes = [
|
|
505
|
-
["write-normal", { "writing-mode": "horizontal-tb" }],
|
|
506
529
|
["write-vertical-right", { "writing-mode": "vertical-rl" }],
|
|
507
|
-
["write-vertical-left", { "writing-mode": "vertical-lr" }]
|
|
530
|
+
["write-vertical-left", { "writing-mode": "vertical-lr" }],
|
|
531
|
+
["write-normal", { "writing-mode": "horizontal-tb" }]
|
|
508
532
|
];
|
|
509
533
|
const writingOrientations = [
|
|
510
534
|
["write-orient-mixed", { "text-orientation": "mixed" }],
|
|
511
|
-
["write-orient-
|
|
512
|
-
["write-orient-
|
|
535
|
+
["write-orient-sideways", { "text-orientation": "sideways" }],
|
|
536
|
+
["write-orient-upright", { "text-orientation": "upright" }]
|
|
513
537
|
];
|
|
514
538
|
const screenReadersAccess = [
|
|
515
539
|
[
|
|
@@ -564,16 +588,8 @@ const objectPositions = [
|
|
|
564
588
|
];
|
|
565
589
|
|
|
566
590
|
const tables = [
|
|
567
|
-
["border-collapse", { "border-collapse": "collapse" }],
|
|
568
|
-
["border-separate", { "border-collapse": "separate" }],
|
|
569
|
-
["caption-top", { "caption-side": "top" }],
|
|
570
|
-
["caption-bottom", { "caption-side": "bottom" }],
|
|
571
591
|
["inline-table", { display: "inline-table" }],
|
|
572
592
|
["table", { display: "table" }],
|
|
573
|
-
["table-auto", { "table-layout": "auto" }],
|
|
574
|
-
["table-empty-cells-visible", { "empty-cells": "show" }],
|
|
575
|
-
["table-empty-cells-hidden", { "empty-cells": "hide" }],
|
|
576
|
-
["table-fixed", { "table-layout": "fixed" }],
|
|
577
593
|
["table-caption", { display: "table-caption" }],
|
|
578
594
|
["table-cell", { display: "table-cell" }],
|
|
579
595
|
["table-column", { display: "table-column" }],
|
|
@@ -581,7 +597,15 @@ const tables = [
|
|
|
581
597
|
["table-footer-group", { display: "table-footer-group" }],
|
|
582
598
|
["table-header-group", { display: "table-header-group" }],
|
|
583
599
|
["table-row", { display: "table-row" }],
|
|
584
|
-
["table-row-group", { display: "table-row-group" }]
|
|
600
|
+
["table-row-group", { display: "table-row-group" }],
|
|
601
|
+
["border-collapse", { "border-collapse": "collapse" }],
|
|
602
|
+
["border-separate", { "border-collapse": "separate" }],
|
|
603
|
+
["caption-top", { "caption-side": "top" }],
|
|
604
|
+
["caption-bottom", { "caption-side": "bottom" }],
|
|
605
|
+
["table-auto", { "table-layout": "auto" }],
|
|
606
|
+
["table-fixed", { "table-layout": "fixed" }],
|
|
607
|
+
["table-empty-cells-visible", { "empty-cells": "show" }],
|
|
608
|
+
["table-empty-cells-hidden", { "empty-cells": "hide" }]
|
|
585
609
|
];
|
|
586
610
|
|
|
587
611
|
const variablesAbbrMap = {
|
|
@@ -611,7 +635,7 @@ const cssVariables = [[
|
|
|
611
635
|
|
|
612
636
|
const divideColors = [
|
|
613
637
|
[/^divide-(.+)$/, colorResolver$1("border-color", "divide")],
|
|
614
|
-
[/^divide-op(?:acity)?-?(.+)
|
|
638
|
+
[/^divide-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-divide-opacity": handler.bracket.percent(opacity) })]
|
|
615
639
|
];
|
|
616
640
|
const divideSizes = [
|
|
617
641
|
[/^divide-?([xy])$/, handlerDivide],
|
|
@@ -655,13 +679,13 @@ const lineClamps = [
|
|
|
655
679
|
];
|
|
656
680
|
|
|
657
681
|
const fontVariantNumericBase = {
|
|
658
|
-
"--un-ordinal": varEmpty
|
|
659
|
-
"--un-slashed-zero": varEmpty
|
|
660
|
-
"--un-numeric-figure": varEmpty
|
|
661
|
-
"--un-numeric-spacing": varEmpty
|
|
662
|
-
"--un-numeric-fraction": varEmpty
|
|
682
|
+
"--un-ordinal": varEmpty,
|
|
683
|
+
"--un-slashed-zero": varEmpty,
|
|
684
|
+
"--un-numeric-figure": varEmpty,
|
|
685
|
+
"--un-numeric-spacing": varEmpty,
|
|
686
|
+
"--un-numeric-fraction": varEmpty,
|
|
663
687
|
"font-variant-numeric": "var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)",
|
|
664
|
-
[
|
|
688
|
+
[CONTROL_BYPASS_PSEUDO_CLASS]: ""
|
|
665
689
|
};
|
|
666
690
|
const fontVariantNumeric = [
|
|
667
691
|
[/^ordinal$/, () => [fontVariantNumericBase, { "--un-ordinal": "ordinal" }]],
|
|
@@ -675,6 +699,67 @@ const fontVariantNumeric = [
|
|
|
675
699
|
["normal-nums", { "font-variant-numeric": "normal" }]
|
|
676
700
|
];
|
|
677
701
|
|
|
702
|
+
const touchActionBase = {
|
|
703
|
+
"--un-pan-x": varEmpty,
|
|
704
|
+
"--un-pan-y": varEmpty,
|
|
705
|
+
"--un-pinch-zoom": varEmpty,
|
|
706
|
+
"--un-touch-action": "var(--un-pan-x) var(--un-pan-y) var(--un-pinch-zoom)",
|
|
707
|
+
[CONTROL_BYPASS_PSEUDO_CLASS]: ""
|
|
708
|
+
};
|
|
709
|
+
const touchActions = [
|
|
710
|
+
[/^touch-pan-(x|left|right)$/, ([, d]) => [
|
|
711
|
+
touchActionBase,
|
|
712
|
+
{
|
|
713
|
+
"--un-pan-x": `pan-${d}`,
|
|
714
|
+
"touch-action": "var(--un-touch-action)"
|
|
715
|
+
}
|
|
716
|
+
]],
|
|
717
|
+
[/^touch-pan-(y|up|down)$/, ([, d]) => [
|
|
718
|
+
touchActionBase,
|
|
719
|
+
{
|
|
720
|
+
"--un-pan-y": `pan-${d}`,
|
|
721
|
+
"touch-action": "var(--un-touch-action)"
|
|
722
|
+
}
|
|
723
|
+
]],
|
|
724
|
+
[/^touch-pinch-zoom$/, () => [
|
|
725
|
+
touchActionBase,
|
|
726
|
+
{
|
|
727
|
+
"--un-pinch-zoom": "pinch-zoom",
|
|
728
|
+
"touch-action": "var(--un-touch-action)"
|
|
729
|
+
}
|
|
730
|
+
]],
|
|
731
|
+
["touch-auto", { "touch-action": "auto" }],
|
|
732
|
+
["touch-manipulation", { "touch-action": "manipulation" }],
|
|
733
|
+
["touch-none", { "touch-action": "none" }]
|
|
734
|
+
];
|
|
735
|
+
|
|
736
|
+
const scrolls = [
|
|
737
|
+
[/^snap-(x|y|base)$/, ([, d]) => [
|
|
738
|
+
{
|
|
739
|
+
"--un-scroll-snap-strictness": "proximity",
|
|
740
|
+
[CONTROL_BYPASS_PSEUDO_CLASS]: ""
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
"scroll-snap-type": `${d} var(--un-scroll-snap-strictness)`
|
|
744
|
+
}
|
|
745
|
+
]],
|
|
746
|
+
["snap-mandatory", { "--un-scroll-snap-strictness": "mandatory" }],
|
|
747
|
+
["snap-proximity", { "--un-scroll-snap-strictness": "proximity" }],
|
|
748
|
+
["snap-none", { "scroll-snap-type": "none" }],
|
|
749
|
+
["snap-start", { "scroll-snap-align": "start" }],
|
|
750
|
+
["snap-end", { "scroll-snap-align": "end" }],
|
|
751
|
+
["snap-center", { "scroll-snap-align": "center" }],
|
|
752
|
+
["snap-align-none", { "scroll-snap-align": "none" }],
|
|
753
|
+
["snap-normal", { "scroll-snap-stop": "normal" }],
|
|
754
|
+
["snap-always", { "scroll-snap-stop": "always" }],
|
|
755
|
+
[/^scroll-ma?()-?(-?.+)$/, directionSize("scroll-margin")],
|
|
756
|
+
[/^scroll-m-?([xy])-?(-?.+)$/, directionSize("scroll-margin")],
|
|
757
|
+
[/^scroll-m-?([rltb])-?(-?.+)$/, directionSize("scroll-margin")],
|
|
758
|
+
[/^scroll-pa?()-?(-?.+)$/, directionSize("scroll-padding")],
|
|
759
|
+
[/^scroll-p-?([xy])-?(-?.+)$/, directionSize("scroll-padding")],
|
|
760
|
+
[/^scroll-p-?([rltb])-?(-?.+)$/, directionSize("scroll-padding")]
|
|
761
|
+
];
|
|
762
|
+
|
|
678
763
|
const rules = [
|
|
679
764
|
cssVariables$1,
|
|
680
765
|
cssVariables,
|
|
@@ -700,10 +785,13 @@ const rules = [
|
|
|
700
785
|
transforms,
|
|
701
786
|
animations,
|
|
702
787
|
cursors,
|
|
788
|
+
touchActions,
|
|
703
789
|
userSelects,
|
|
704
790
|
resizes,
|
|
791
|
+
scrolls,
|
|
705
792
|
listStyle,
|
|
706
793
|
appearance,
|
|
794
|
+
columns,
|
|
707
795
|
placements,
|
|
708
796
|
alignments,
|
|
709
797
|
justifies,
|
|
@@ -712,6 +800,7 @@ const rules = [
|
|
|
712
800
|
divides,
|
|
713
801
|
overflows,
|
|
714
802
|
overscrolls,
|
|
803
|
+
scrollBehaviors,
|
|
715
804
|
textOverflows,
|
|
716
805
|
whitespaces,
|
|
717
806
|
breaks,
|
|
@@ -719,7 +808,7 @@ const rules = [
|
|
|
719
808
|
bgColors,
|
|
720
809
|
boxDecorationBreaks,
|
|
721
810
|
backgroundStyles,
|
|
722
|
-
|
|
811
|
+
svgUtilities,
|
|
723
812
|
objectPositions,
|
|
724
813
|
paddings,
|
|
725
814
|
textAligns,
|
|
@@ -738,9 +827,10 @@ const rules = [
|
|
|
738
827
|
hyphens,
|
|
739
828
|
writingModes,
|
|
740
829
|
writingOrientations,
|
|
741
|
-
placeholder,
|
|
742
830
|
caretColors,
|
|
743
831
|
caretOpacity,
|
|
832
|
+
accentColors,
|
|
833
|
+
accentOpacity,
|
|
744
834
|
opacity,
|
|
745
835
|
mixBlendModes,
|
|
746
836
|
boxShadows,
|
|
@@ -749,10 +839,32 @@ const rules = [
|
|
|
749
839
|
imageRenderings,
|
|
750
840
|
filters,
|
|
751
841
|
transitions,
|
|
842
|
+
willChange,
|
|
752
843
|
contents,
|
|
753
844
|
questionMark
|
|
754
845
|
].flat(1);
|
|
755
846
|
|
|
847
|
+
const variantColorsScheme = [
|
|
848
|
+
variantMatcher("\\.dark", (input) => `.dark $$ ${input}`),
|
|
849
|
+
variantMatcher("\\.light", (input) => `.light $$ ${input}`),
|
|
850
|
+
(v) => {
|
|
851
|
+
const dark = variantMatcher("@dark")(v);
|
|
852
|
+
if (dark) {
|
|
853
|
+
return {
|
|
854
|
+
...dark,
|
|
855
|
+
parent: "@media (prefers-color-scheme: dark)"
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
const light = variantMatcher("@light")(v);
|
|
859
|
+
if (light) {
|
|
860
|
+
return {
|
|
861
|
+
...light,
|
|
862
|
+
parent: "@media (prefers-color-scheme: light)"
|
|
863
|
+
};
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
];
|
|
867
|
+
|
|
756
868
|
const presetWind = (options = {}) => ({
|
|
757
869
|
name: "@unocss/preset-wind",
|
|
758
870
|
theme,
|
|
@@ -761,8 +873,8 @@ const presetWind = (options = {}) => ({
|
|
|
761
873
|
...containerShortcuts
|
|
762
874
|
],
|
|
763
875
|
variants: [
|
|
764
|
-
...variants,
|
|
765
|
-
...
|
|
876
|
+
...variants(options),
|
|
877
|
+
...variantColorsScheme
|
|
766
878
|
],
|
|
767
879
|
options
|
|
768
880
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-wind",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
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.
|
|
39
|
-
"@unocss/preset-mini": "0.
|
|
38
|
+
"@unocss/core": "0.18.0",
|
|
39
|
+
"@unocss/preset-mini": "0.18.0"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "unbuild",
|