@unocss/preset-wind 0.22.4 → 0.23.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 +35 -35
- package/dist/index.mjs +36 -36
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -10,7 +10,7 @@ const rules$1 = require('@unocss/preset-mini/rules');
|
|
|
10
10
|
const utils = require('@unocss/preset-mini/utils');
|
|
11
11
|
|
|
12
12
|
const animations = [
|
|
13
|
-
[/^keyframes-(.+)$/, ([, name], { theme, constructCSS }) => {
|
|
13
|
+
[/^(?:animate-)?keyframes-(.+)$/, ([, name], { theme, constructCSS }) => {
|
|
14
14
|
const kf = theme.animation?.keyframes?.[name];
|
|
15
15
|
if (kf)
|
|
16
16
|
return `@keyframes ${name}${kf}
|
|
@@ -25,18 +25,16 @@ ${constructCSS({ animation: `${name}` })}`;
|
|
|
25
25
|
return `@keyframes ${name}${kf}
|
|
26
26
|
${constructCSS(Object.assign({ animation: `${name} ${duration} ${timing} infinite` }, props))}`;
|
|
27
27
|
}
|
|
28
|
+
return { animation: utils.handler.bracket.cssvar(name) };
|
|
28
29
|
}],
|
|
29
|
-
[/^animate-
|
|
30
|
+
[/^animate-name-(.+)/, ([, d]) => ({ "animation-name": utils.handler.bracket.cssvar(d) ?? d })],
|
|
31
|
+
[/^animate-duration-(.+)$/, ([, d]) => ({ "animation-duration": utils.handler.bracket.cssvar.time(d) })],
|
|
30
32
|
[/^animate-delay-(.+)$/, ([, d]) => ({ "animation-delay": utils.handler.bracket.cssvar.time(d) })],
|
|
31
|
-
[/^animate-(
|
|
32
|
-
[
|
|
33
|
-
[
|
|
34
|
-
[/^animate-(?:
|
|
35
|
-
[
|
|
36
|
-
["animate-direction-normal", { "animation-direction": "normal" }],
|
|
37
|
-
[/^animate-(?:iteration-)?count-(.+)$/, ([, d]) => ({ "animation-iteration-count": utils.handler.bracket.cssvar(d) ?? d.replace(/\-/g, ",") })],
|
|
38
|
-
[/^animate-name-(.+)/, ([, d]) => ({ "animation-name": d })],
|
|
39
|
-
[/^animate-play-(?:state-)?(paused|running|inherit|initial|revert|unset)$/, ([, d]) => ({ "animation-play-state": d })],
|
|
33
|
+
[/^animate-ease(?:-(.+))?$/, ([, d], { theme }) => ({ "animation-timing-function": theme.easing?.[d || "DEFAULT"] ?? utils.handler.bracket.cssvar(d) })],
|
|
34
|
+
[/^animate-(?:fill-|mode-|fill-mode-)?(none|forwards|backwards|both|inherit|initial|revert|unset)$/, ([, d]) => ({ "animation-fill-mode": d })],
|
|
35
|
+
[/^animate-(?:direction-)?(normal|reverse|alternate|alternate-reverse|inherit|initial|revert|unset)$/, ([, d]) => ({ "animation-direction": d })],
|
|
36
|
+
[/^animate-(?:iteration-|count-|iteration-count-)(.+)$/, ([, d]) => ({ "animation-iteration-count": utils.handler.bracket.cssvar(d) ?? d.replace(/\-/g, ",") })],
|
|
37
|
+
[/^animate-(?:play-|state-|play-state-)?(paused|running|inherit|initial|revert|unset)$/, ([, d]) => ({ "animation-play-state": d })],
|
|
40
38
|
["animate-none", { animation: "none" }]
|
|
41
39
|
];
|
|
42
40
|
|
|
@@ -267,8 +265,8 @@ const percentWithDefault = (str) => {
|
|
|
267
265
|
return v;
|
|
268
266
|
};
|
|
269
267
|
const toFilter = (varName, resolver) => ([, b, s], { theme }) => {
|
|
270
|
-
const value = resolver(s, theme);
|
|
271
|
-
if (value
|
|
268
|
+
const value = resolver(s, theme) ?? (s === "none" ? "0" : "");
|
|
269
|
+
if (value !== "") {
|
|
272
270
|
if (b) {
|
|
273
271
|
return [
|
|
274
272
|
backdropFilterBase,
|
|
@@ -340,12 +338,7 @@ const filters = [
|
|
|
340
338
|
["backdrop-filter-none", {
|
|
341
339
|
"-webkit-backdrop-filter": "none",
|
|
342
340
|
"backdrop-filter": "none"
|
|
343
|
-
}]
|
|
344
|
-
[/^(?:filter-)?(blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|saturate|sepia)-none$/, ([, s]) => ({ filter: `${s}(0)` })],
|
|
345
|
-
[/^backdrop-(blur|brightness|contrast|grayscale|hue-rotate|invert|opacity|saturate|sepia)-none$/, ([, s]) => ({
|
|
346
|
-
"-webkit-backdrop-filter": `${s}(0)`,
|
|
347
|
-
"backdrop-filter": `${s}(0)`
|
|
348
|
-
})]
|
|
341
|
+
}]
|
|
349
342
|
];
|
|
350
343
|
|
|
351
344
|
const spaces = [
|
|
@@ -354,17 +347,20 @@ const spaces = [
|
|
|
354
347
|
[/^space-(block|inline)-(-?.+)$/, handlerSpace],
|
|
355
348
|
[/^space-(block|inline)-reverse$/, ([, d]) => ({ [`--un-space-${d}-reverse`]: 1 })]
|
|
356
349
|
];
|
|
357
|
-
function handlerSpace(
|
|
358
|
-
const
|
|
359
|
-
|
|
360
|
-
const
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
350
|
+
function handlerSpace([, d, s = "1"]) {
|
|
351
|
+
const v = utils.handler.bracket.cssvar.auto.fraction.rem(s);
|
|
352
|
+
if (v != null) {
|
|
353
|
+
const results = utils.directionMap[d].map((item) => {
|
|
354
|
+
const key = `margin${item}`;
|
|
355
|
+
const value = item.endsWith("right") || item.endsWith("bottom") ? `calc(${v} * var(--un-space-${d}-reverse))` : `calc(${v} * calc(1 - var(--un-space-${d}-reverse)))`;
|
|
356
|
+
return [key, value];
|
|
357
|
+
});
|
|
358
|
+
if (results) {
|
|
359
|
+
return [
|
|
360
|
+
[`--un-space-${d}-reverse`, 0],
|
|
361
|
+
...results
|
|
362
|
+
];
|
|
363
|
+
}
|
|
368
364
|
}
|
|
369
365
|
}
|
|
370
366
|
|
|
@@ -517,10 +513,10 @@ const variablesAbbrMap = {
|
|
|
517
513
|
"write-orient": "text-orientation"
|
|
518
514
|
};
|
|
519
515
|
const cssVariables = [
|
|
520
|
-
[/^(
|
|
521
|
-
const prop = variablesAbbrMap[name
|
|
516
|
+
[/^(.+?)-(\$.+)$/, ([, name, varname]) => {
|
|
517
|
+
const prop = variablesAbbrMap[name];
|
|
522
518
|
if (prop)
|
|
523
|
-
return { [prop]:
|
|
519
|
+
return { [prop]: utils.handler.cssvar(varname) };
|
|
524
520
|
}]
|
|
525
521
|
];
|
|
526
522
|
|
|
@@ -547,8 +543,12 @@ function handlerDivide([, d, s = "1"]) {
|
|
|
547
543
|
const value = item.endsWith("right") || item.endsWith("bottom") ? `calc(${v} * var(--un-divide-${d}-reverse))` : `calc(${v} * calc(1 - var(--un-divide-${d}-reverse)))`;
|
|
548
544
|
return [key, value];
|
|
549
545
|
});
|
|
550
|
-
if (results)
|
|
551
|
-
return [
|
|
546
|
+
if (results) {
|
|
547
|
+
return [
|
|
548
|
+
[`--un-divide-${d}-reverse`, 0],
|
|
549
|
+
...results
|
|
550
|
+
];
|
|
551
|
+
}
|
|
552
552
|
}
|
|
553
553
|
}
|
|
554
554
|
|
package/dist/index.mjs
CHANGED
|
@@ -3,10 +3,10 @@ import { toArray, CONTROL_SHORTCUT_NO_MERGE } from '@unocss/core';
|
|
|
3
3
|
import { theme as theme$1 } from '@unocss/preset-mini/theme';
|
|
4
4
|
export { colors } from '@unocss/preset-mini';
|
|
5
5
|
import { varEmpty, colorableShadows, 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, fontStyles, textColors, textDecorations, fontSmoothings, tabSizes, textStrokes, textShadows, opacity, boxShadows, outline, rings, transitions, willChange, contents, questionMark } from '@unocss/preset-mini/rules';
|
|
6
|
-
import { handler, positionMap, parseColor, colorResolver,
|
|
6
|
+
import { handler, positionMap, parseColor, colorResolver, directionMap, directionSize, variantMatcher, variantParentMatcher } from '@unocss/preset-mini/utils';
|
|
7
7
|
|
|
8
8
|
const animations = [
|
|
9
|
-
[/^keyframes-(.+)$/, ([, name], { theme, constructCSS }) => {
|
|
9
|
+
[/^(?:animate-)?keyframes-(.+)$/, ([, name], { theme, constructCSS }) => {
|
|
10
10
|
const kf = theme.animation?.keyframes?.[name];
|
|
11
11
|
if (kf)
|
|
12
12
|
return `@keyframes ${name}${kf}
|
|
@@ -21,18 +21,16 @@ ${constructCSS({ animation: `${name}` })}`;
|
|
|
21
21
|
return `@keyframes ${name}${kf}
|
|
22
22
|
${constructCSS(Object.assign({ animation: `${name} ${duration} ${timing} infinite` }, props))}`;
|
|
23
23
|
}
|
|
24
|
+
return { animation: handler.bracket.cssvar(name) };
|
|
24
25
|
}],
|
|
25
|
-
[/^animate-
|
|
26
|
+
[/^animate-name-(.+)/, ([, d]) => ({ "animation-name": handler.bracket.cssvar(d) ?? d })],
|
|
27
|
+
[/^animate-duration-(.+)$/, ([, d]) => ({ "animation-duration": handler.bracket.cssvar.time(d) })],
|
|
26
28
|
[/^animate-delay-(.+)$/, ([, d]) => ({ "animation-delay": handler.bracket.cssvar.time(d) })],
|
|
27
|
-
[/^animate-(
|
|
28
|
-
[
|
|
29
|
-
[
|
|
30
|
-
[/^animate-(?:
|
|
31
|
-
[
|
|
32
|
-
["animate-direction-normal", { "animation-direction": "normal" }],
|
|
33
|
-
[/^animate-(?:iteration-)?count-(.+)$/, ([, d]) => ({ "animation-iteration-count": handler.bracket.cssvar(d) ?? d.replace(/\-/g, ",") })],
|
|
34
|
-
[/^animate-name-(.+)/, ([, d]) => ({ "animation-name": d })],
|
|
35
|
-
[/^animate-play-(?:state-)?(paused|running|inherit|initial|revert|unset)$/, ([, d]) => ({ "animation-play-state": d })],
|
|
29
|
+
[/^animate-ease(?:-(.+))?$/, ([, d], { theme }) => ({ "animation-timing-function": theme.easing?.[d || "DEFAULT"] ?? handler.bracket.cssvar(d) })],
|
|
30
|
+
[/^animate-(?:fill-|mode-|fill-mode-)?(none|forwards|backwards|both|inherit|initial|revert|unset)$/, ([, d]) => ({ "animation-fill-mode": d })],
|
|
31
|
+
[/^animate-(?:direction-)?(normal|reverse|alternate|alternate-reverse|inherit|initial|revert|unset)$/, ([, d]) => ({ "animation-direction": d })],
|
|
32
|
+
[/^animate-(?:iteration-|count-|iteration-count-)(.+)$/, ([, d]) => ({ "animation-iteration-count": handler.bracket.cssvar(d) ?? d.replace(/\-/g, ",") })],
|
|
33
|
+
[/^animate-(?:play-|state-|play-state-)?(paused|running|inherit|initial|revert|unset)$/, ([, d]) => ({ "animation-play-state": d })],
|
|
36
34
|
["animate-none", { animation: "none" }]
|
|
37
35
|
];
|
|
38
36
|
|
|
@@ -263,8 +261,8 @@ const percentWithDefault = (str) => {
|
|
|
263
261
|
return v;
|
|
264
262
|
};
|
|
265
263
|
const toFilter = (varName, resolver) => ([, b, s], { theme }) => {
|
|
266
|
-
const value = resolver(s, theme);
|
|
267
|
-
if (value
|
|
264
|
+
const value = resolver(s, theme) ?? (s === "none" ? "0" : "");
|
|
265
|
+
if (value !== "") {
|
|
268
266
|
if (b) {
|
|
269
267
|
return [
|
|
270
268
|
backdropFilterBase,
|
|
@@ -336,12 +334,7 @@ const filters = [
|
|
|
336
334
|
["backdrop-filter-none", {
|
|
337
335
|
"-webkit-backdrop-filter": "none",
|
|
338
336
|
"backdrop-filter": "none"
|
|
339
|
-
}]
|
|
340
|
-
[/^(?:filter-)?(blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|saturate|sepia)-none$/, ([, s]) => ({ filter: `${s}(0)` })],
|
|
341
|
-
[/^backdrop-(blur|brightness|contrast|grayscale|hue-rotate|invert|opacity|saturate|sepia)-none$/, ([, s]) => ({
|
|
342
|
-
"-webkit-backdrop-filter": `${s}(0)`,
|
|
343
|
-
"backdrop-filter": `${s}(0)`
|
|
344
|
-
})]
|
|
337
|
+
}]
|
|
345
338
|
];
|
|
346
339
|
|
|
347
340
|
const spaces = [
|
|
@@ -350,17 +343,20 @@ const spaces = [
|
|
|
350
343
|
[/^space-(block|inline)-(-?.+)$/, handlerSpace],
|
|
351
344
|
[/^space-(block|inline)-reverse$/, ([, d]) => ({ [`--un-space-${d}-reverse`]: 1 })]
|
|
352
345
|
];
|
|
353
|
-
function handlerSpace(
|
|
354
|
-
const
|
|
355
|
-
|
|
356
|
-
const
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
346
|
+
function handlerSpace([, d, s = "1"]) {
|
|
347
|
+
const v = handler.bracket.cssvar.auto.fraction.rem(s);
|
|
348
|
+
if (v != null) {
|
|
349
|
+
const results = directionMap[d].map((item) => {
|
|
350
|
+
const key = `margin${item}`;
|
|
351
|
+
const value = item.endsWith("right") || item.endsWith("bottom") ? `calc(${v} * var(--un-space-${d}-reverse))` : `calc(${v} * calc(1 - var(--un-space-${d}-reverse)))`;
|
|
352
|
+
return [key, value];
|
|
353
|
+
});
|
|
354
|
+
if (results) {
|
|
355
|
+
return [
|
|
356
|
+
[`--un-space-${d}-reverse`, 0],
|
|
357
|
+
...results
|
|
358
|
+
];
|
|
359
|
+
}
|
|
364
360
|
}
|
|
365
361
|
}
|
|
366
362
|
|
|
@@ -513,10 +509,10 @@ const variablesAbbrMap = {
|
|
|
513
509
|
"write-orient": "text-orientation"
|
|
514
510
|
};
|
|
515
511
|
const cssVariables = [
|
|
516
|
-
[/^(
|
|
517
|
-
const prop = variablesAbbrMap[name
|
|
512
|
+
[/^(.+?)-(\$.+)$/, ([, name, varname]) => {
|
|
513
|
+
const prop = variablesAbbrMap[name];
|
|
518
514
|
if (prop)
|
|
519
|
-
return { [prop]:
|
|
515
|
+
return { [prop]: handler.cssvar(varname) };
|
|
520
516
|
}]
|
|
521
517
|
];
|
|
522
518
|
|
|
@@ -543,8 +539,12 @@ function handlerDivide([, d, s = "1"]) {
|
|
|
543
539
|
const value = item.endsWith("right") || item.endsWith("bottom") ? `calc(${v} * var(--un-divide-${d}-reverse))` : `calc(${v} * calc(1 - var(--un-divide-${d}-reverse)))`;
|
|
544
540
|
return [key, value];
|
|
545
541
|
});
|
|
546
|
-
if (results)
|
|
547
|
-
return [
|
|
542
|
+
if (results) {
|
|
543
|
+
return [
|
|
544
|
+
[`--un-divide-${d}-reverse`, 0],
|
|
545
|
+
...results
|
|
546
|
+
];
|
|
547
|
+
}
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
550
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-wind",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.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.23.0",
|
|
39
|
+
"@unocss/preset-mini": "0.23.0"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "unbuild",
|