@unocss/preset-wind 0.57.7 → 0.58.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/dist/index.cjs +6 -22
- package/dist/index.mjs +9 -25
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -138,18 +138,7 @@ function bgGradientPositionResolver() {
|
|
|
138
138
|
};
|
|
139
139
|
};
|
|
140
140
|
}
|
|
141
|
-
const bgUrlRE = /^\[url\(.+\)\]$/;
|
|
142
|
-
const bgLengthRE = /^\[length:.+\]$/;
|
|
143
|
-
const bgPositionRE = /^\[position:.+\]$/;
|
|
144
141
|
const backgroundStyles = [
|
|
145
|
-
[/^bg-(.+)$/, ([, d]) => {
|
|
146
|
-
if (bgUrlRE.test(d))
|
|
147
|
-
return { "--un-url": utils.h.bracket(d), "background-image": "var(--un-url)" };
|
|
148
|
-
if (bgLengthRE.test(d) && utils.h.bracketOfLength(d) != null)
|
|
149
|
-
return { "background-size": utils.h.bracketOfLength(d).split(" ").map((e) => utils.h.fraction.auto.px.cssvar(e) ?? e).join(" ") };
|
|
150
|
-
if ((utils.isSize(d) || bgPositionRE.test(d)) && utils.h.bracketOfPosition(d) != null)
|
|
151
|
-
return { "background-position": utils.h.bracketOfPosition(d).split(" ").map((e) => utils.h.position.fraction.auto.px.cssvar(e) ?? e).join(" ") };
|
|
152
|
-
}],
|
|
153
142
|
// gradients
|
|
154
143
|
[/^bg-gradient-(.+)$/, ([, d]) => ({ "--un-gradient": utils.h.bracket(d) }), {
|
|
155
144
|
autocomplete: ["bg-gradient", "bg-gradient-(from|to|via)", "bg-gradient-(from|to|via)-$colors", "bg-gradient-(from|to|via)-(op|opacity)", "bg-gradient-(from|to|via)-(op|opacity)-<percent>"]
|
|
@@ -941,7 +930,6 @@ const rules = [
|
|
|
941
930
|
textTransforms,
|
|
942
931
|
___namespace.fontStyles,
|
|
943
932
|
fontVariantNumeric,
|
|
944
|
-
___namespace.textColors,
|
|
945
933
|
___namespace.textDecorations,
|
|
946
934
|
___namespace.fontSmoothings,
|
|
947
935
|
___namespace.tabSizes,
|
|
@@ -1192,16 +1180,6 @@ const variantColorsScheme = [
|
|
|
1192
1180
|
utils.variantParentMatcher("@light", "@media (prefers-color-scheme: light)")
|
|
1193
1181
|
];
|
|
1194
1182
|
|
|
1195
|
-
const variantStickyHover = [
|
|
1196
|
-
utils.variantMatcher("@hover", (input) => {
|
|
1197
|
-
core.warnOnce("The @hover variant is experimental and may not follow semver.");
|
|
1198
|
-
return {
|
|
1199
|
-
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (hover: hover) and (pointer: fine)`,
|
|
1200
|
-
selector: `${input.selector || ""}:hover`
|
|
1201
|
-
};
|
|
1202
|
-
})
|
|
1203
|
-
];
|
|
1204
|
-
|
|
1205
1183
|
const variantContrasts = [
|
|
1206
1184
|
utils.variantParentMatcher("contrast-more", "@media (prefers-contrast: more)"),
|
|
1207
1185
|
utils.variantParentMatcher("contrast-less", "@media (prefers-contrast: less)")
|
|
@@ -1228,6 +1206,12 @@ const variantSpaceAndDivide = (matcher) => {
|
|
|
1228
1206
|
};
|
|
1229
1207
|
}
|
|
1230
1208
|
};
|
|
1209
|
+
const variantStickyHover = [
|
|
1210
|
+
ruleUtils.variantMatcher("@hover", (input) => ({
|
|
1211
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (hover: hover) and (pointer: fine)`,
|
|
1212
|
+
selector: `${input.selector || ""}:hover`
|
|
1213
|
+
}))
|
|
1214
|
+
];
|
|
1231
1215
|
|
|
1232
1216
|
const placeholderModifier = (input, { theme }) => {
|
|
1233
1217
|
const m = input.match(/^(.*)\b(placeholder-)(.+)$/);
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { isString,
|
|
1
|
+
import { isString, definePreset } from '@unocss/core';
|
|
2
2
|
import { presetMini } from '@unocss/preset-mini';
|
|
3
3
|
export { colors, preflights } from '@unocss/preset-mini';
|
|
4
|
-
import { h, globalKeywords, makeGlobalStaticRules,
|
|
4
|
+
import { h, globalKeywords, makeGlobalStaticRules, positionMap, parseColor, colorResolver, resolveBreakpoints, colorableShadows, directionMap, directionSize, variantMatcher, variantParentMatcher, hasParseableColor } from '@unocss/preset-mini/utils';
|
|
5
5
|
import * as _ from '@unocss/preset-mini/rules';
|
|
6
6
|
import { varEmpty, borderStyles, transformBase, boxShadowsBase, ringBase } from '@unocss/preset-mini/rules';
|
|
7
7
|
import { theme as theme$1 } from '@unocss/preset-mini/theme';
|
|
8
|
-
import { colorToString, colorOpacityToString } from '@unocss/rule-utils';
|
|
8
|
+
import { colorToString, colorOpacityToString, variantMatcher as variantMatcher$1 } from '@unocss/rule-utils';
|
|
9
9
|
import { variants as variants$1 } from '@unocss/preset-mini/variants';
|
|
10
10
|
|
|
11
11
|
const animations = [
|
|
@@ -122,18 +122,7 @@ function bgGradientPositionResolver() {
|
|
|
122
122
|
};
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
|
-
const bgUrlRE = /^\[url\(.+\)\]$/;
|
|
126
|
-
const bgLengthRE = /^\[length:.+\]$/;
|
|
127
|
-
const bgPositionRE = /^\[position:.+\]$/;
|
|
128
125
|
const backgroundStyles = [
|
|
129
|
-
[/^bg-(.+)$/, ([, d]) => {
|
|
130
|
-
if (bgUrlRE.test(d))
|
|
131
|
-
return { "--un-url": h.bracket(d), "background-image": "var(--un-url)" };
|
|
132
|
-
if (bgLengthRE.test(d) && h.bracketOfLength(d) != null)
|
|
133
|
-
return { "background-size": h.bracketOfLength(d).split(" ").map((e) => h.fraction.auto.px.cssvar(e) ?? e).join(" ") };
|
|
134
|
-
if ((isSize(d) || bgPositionRE.test(d)) && h.bracketOfPosition(d) != null)
|
|
135
|
-
return { "background-position": h.bracketOfPosition(d).split(" ").map((e) => h.position.fraction.auto.px.cssvar(e) ?? e).join(" ") };
|
|
136
|
-
}],
|
|
137
126
|
// gradients
|
|
138
127
|
[/^bg-gradient-(.+)$/, ([, d]) => ({ "--un-gradient": h.bracket(d) }), {
|
|
139
128
|
autocomplete: ["bg-gradient", "bg-gradient-(from|to|via)", "bg-gradient-(from|to|via)-$colors", "bg-gradient-(from|to|via)-(op|opacity)", "bg-gradient-(from|to|via)-(op|opacity)-<percent>"]
|
|
@@ -925,7 +914,6 @@ const rules = [
|
|
|
925
914
|
textTransforms,
|
|
926
915
|
_.fontStyles,
|
|
927
916
|
fontVariantNumeric,
|
|
928
|
-
_.textColors,
|
|
929
917
|
_.textDecorations,
|
|
930
918
|
_.fontSmoothings,
|
|
931
919
|
_.tabSizes,
|
|
@@ -1176,16 +1164,6 @@ const variantColorsScheme = [
|
|
|
1176
1164
|
variantParentMatcher("@light", "@media (prefers-color-scheme: light)")
|
|
1177
1165
|
];
|
|
1178
1166
|
|
|
1179
|
-
const variantStickyHover = [
|
|
1180
|
-
variantMatcher("@hover", (input) => {
|
|
1181
|
-
warnOnce("The @hover variant is experimental and may not follow semver.");
|
|
1182
|
-
return {
|
|
1183
|
-
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (hover: hover) and (pointer: fine)`,
|
|
1184
|
-
selector: `${input.selector || ""}:hover`
|
|
1185
|
-
};
|
|
1186
|
-
})
|
|
1187
|
-
];
|
|
1188
|
-
|
|
1189
1167
|
const variantContrasts = [
|
|
1190
1168
|
variantParentMatcher("contrast-more", "@media (prefers-contrast: more)"),
|
|
1191
1169
|
variantParentMatcher("contrast-less", "@media (prefers-contrast: less)")
|
|
@@ -1212,6 +1190,12 @@ const variantSpaceAndDivide = (matcher) => {
|
|
|
1212
1190
|
};
|
|
1213
1191
|
}
|
|
1214
1192
|
};
|
|
1193
|
+
const variantStickyHover = [
|
|
1194
|
+
variantMatcher$1("@hover", (input) => ({
|
|
1195
|
+
parent: `${input.parent ? `${input.parent} $$ ` : ""}@media (hover: hover) and (pointer: fine)`,
|
|
1196
|
+
selector: `${input.selector || ""}:hover`
|
|
1197
|
+
}))
|
|
1198
|
+
];
|
|
1215
1199
|
|
|
1216
1200
|
const placeholderModifier = (input, { theme }) => {
|
|
1217
1201
|
const m = input.match(/^(.*)\b(placeholder-)(.+)$/);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-wind",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.58.1",
|
|
4
4
|
"description": "Tailwind / Windi CSS compact preset for UnoCSS",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"dist"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@unocss/core": "0.
|
|
39
|
-
"@unocss/preset-mini": "0.
|
|
40
|
-
"@unocss/rule-utils": "0.
|
|
38
|
+
"@unocss/core": "0.58.1",
|
|
39
|
+
"@unocss/preset-mini": "0.58.1",
|
|
40
|
+
"@unocss/rule-utils": "0.58.1"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"build": "unbuild",
|