@unocss/preset-wind 0.50.8 → 0.51.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 +8 -21
- package/dist/index.mjs +10 -23
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -92,8 +92,8 @@ function bgGradientColorValue(mode, cssColor, color, alpha) {
|
|
|
92
92
|
}
|
|
93
93
|
return utils.colorToString(color, alpha);
|
|
94
94
|
}
|
|
95
|
-
function bgGradientColorResolver(
|
|
96
|
-
return ([, body], { theme }) => {
|
|
95
|
+
function bgGradientColorResolver() {
|
|
96
|
+
return ([, mode, body], { theme }) => {
|
|
97
97
|
const data = utils.parseColor(body, theme);
|
|
98
98
|
if (!data)
|
|
99
99
|
return;
|
|
@@ -146,12 +146,8 @@ const backgroundStyles = [
|
|
|
146
146
|
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>"]
|
|
147
147
|
}],
|
|
148
148
|
[/^(?:bg-gradient-)?stops-(\[.+\])$/, ([, s]) => ({ "--un-gradient-stops": utils.handler.bracket(s) })],
|
|
149
|
-
[/^(?:bg-gradient-)?from-(.+)$/, bgGradientColorResolver(
|
|
150
|
-
[/^(?:bg-gradient-)?via-(.+)$/,
|
|
151
|
-
[/^(?:bg-gradient-)?to-(.+)$/, bgGradientColorResolver("to")],
|
|
152
|
-
[/^(?:bg-gradient-)?from-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-from-opacity": utils.handler.bracket.percent(opacity) })],
|
|
153
|
-
[/^(?:bg-gradient-)?via-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-via-opacity": utils.handler.bracket.percent(opacity) })],
|
|
154
|
-
[/^(?:bg-gradient-)?to-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-to-opacity": utils.handler.bracket.percent(opacity) })],
|
|
149
|
+
[/^(?:bg-gradient-)?(from|via|to)-(.+)$/, bgGradientColorResolver()],
|
|
150
|
+
[/^(?:bg-gradient-)?(from|via|to)-op(?:acity)?-?(.+)$/, ([, position, opacity]) => ({ [`--un-${position}-opacity`]: utils.handler.bracket.percent(opacity) })],
|
|
155
151
|
[/^(from|via|to)-([\d\.]+)%$/, bgGradientPositionResolver()],
|
|
156
152
|
[/^bg-gradient-((?:repeating-)?(?:linear|radial|conic))$/, ([, s]) => ({
|
|
157
153
|
"background-image": `${s}-gradient(var(--un-gradient, var(--un-gradient-stops, rgba(255, 255, 255, 0))))`
|
|
@@ -707,12 +703,10 @@ function handlerDivide([, d, s], { theme }) {
|
|
|
707
703
|
const value = item.endsWith("right") || item.endsWith("bottom") ? `calc(${v} * var(--un-divide-${d}-reverse))` : `calc(${v} * calc(1 - var(--un-divide-${d}-reverse)))`;
|
|
708
704
|
return [key, value];
|
|
709
705
|
});
|
|
710
|
-
|
|
711
|
-
if (results && borderStyle) {
|
|
706
|
+
if (results) {
|
|
712
707
|
return [
|
|
713
708
|
[`--un-divide-${d}-reverse`, 0],
|
|
714
|
-
...results
|
|
715
|
-
...borderStyle
|
|
709
|
+
...results
|
|
716
710
|
];
|
|
717
711
|
}
|
|
718
712
|
}
|
|
@@ -1206,20 +1200,13 @@ function variants(options) {
|
|
|
1206
1200
|
}
|
|
1207
1201
|
|
|
1208
1202
|
function presetWind(options = {}) {
|
|
1209
|
-
options.dark = options.dark ?? "class";
|
|
1210
|
-
options.attributifyPseudo = options.attributifyPseudo ?? false;
|
|
1211
|
-
options.preflight = options.preflight ?? true;
|
|
1212
|
-
options.variablePrefix = options.variablePrefix ?? "un-";
|
|
1213
1203
|
return {
|
|
1204
|
+
...presetMini.presetMini(options),
|
|
1214
1205
|
name: "@unocss/preset-wind",
|
|
1215
1206
|
theme,
|
|
1216
1207
|
rules,
|
|
1217
1208
|
shortcuts,
|
|
1218
|
-
variants: variants(options)
|
|
1219
|
-
options,
|
|
1220
|
-
postprocess: presetMini.VarPrefixPostprocessor(options.variablePrefix),
|
|
1221
|
-
preflights: options.preflight ? presetMini.normalizePreflights(presetMini.preflights, options.variablePrefix) : [],
|
|
1222
|
-
prefix: options.prefix
|
|
1209
|
+
variants: variants(options)
|
|
1223
1210
|
};
|
|
1224
1211
|
}
|
|
1225
1212
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { presetMini } from '@unocss/preset-mini';
|
|
2
2
|
export { colors, preflights } from '@unocss/preset-mini';
|
|
3
3
|
import { handler, globalKeywords, makeGlobalStaticRules, positionMap, parseColor, colorToString, colorOpacityToString, colorResolver, resolveBreakpoints, colorableShadows, directionMap, directionSize, variantMatcher, variantParentMatcher, hasParseableColor } from '@unocss/preset-mini/utils';
|
|
4
4
|
import { isString, warnOnce } from '@unocss/core';
|
|
5
|
-
import { varEmpty, borderStyles,
|
|
5
|
+
import { varEmpty, borderStyles, cssVariables as cssVariables$1, cssProperty, contains, 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, contentVisibility, contents, containerParent, questionMark, transformBase, boxShadowsBase, ringBase } from '@unocss/preset-mini/rules';
|
|
6
6
|
import { theme as theme$1 } from '@unocss/preset-mini/theme';
|
|
7
7
|
import { variants as variants$1 } from '@unocss/preset-mini/variants';
|
|
8
8
|
|
|
@@ -89,8 +89,8 @@ function bgGradientColorValue(mode, cssColor, color, alpha) {
|
|
|
89
89
|
}
|
|
90
90
|
return colorToString(color, alpha);
|
|
91
91
|
}
|
|
92
|
-
function bgGradientColorResolver(
|
|
93
|
-
return ([, body], { theme }) => {
|
|
92
|
+
function bgGradientColorResolver() {
|
|
93
|
+
return ([, mode, body], { theme }) => {
|
|
94
94
|
const data = parseColor(body, theme);
|
|
95
95
|
if (!data)
|
|
96
96
|
return;
|
|
@@ -143,12 +143,8 @@ const backgroundStyles = [
|
|
|
143
143
|
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>"]
|
|
144
144
|
}],
|
|
145
145
|
[/^(?:bg-gradient-)?stops-(\[.+\])$/, ([, s]) => ({ "--un-gradient-stops": handler.bracket(s) })],
|
|
146
|
-
[/^(?:bg-gradient-)?from-(.+)$/, bgGradientColorResolver(
|
|
147
|
-
[/^(?:bg-gradient-)?via-(.+)$/,
|
|
148
|
-
[/^(?:bg-gradient-)?to-(.+)$/, bgGradientColorResolver("to")],
|
|
149
|
-
[/^(?:bg-gradient-)?from-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-from-opacity": handler.bracket.percent(opacity) })],
|
|
150
|
-
[/^(?:bg-gradient-)?via-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-via-opacity": handler.bracket.percent(opacity) })],
|
|
151
|
-
[/^(?:bg-gradient-)?to-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-to-opacity": handler.bracket.percent(opacity) })],
|
|
146
|
+
[/^(?:bg-gradient-)?(from|via|to)-(.+)$/, bgGradientColorResolver()],
|
|
147
|
+
[/^(?:bg-gradient-)?(from|via|to)-op(?:acity)?-?(.+)$/, ([, position, opacity]) => ({ [`--un-${position}-opacity`]: handler.bracket.percent(opacity) })],
|
|
152
148
|
[/^(from|via|to)-([\d\.]+)%$/, bgGradientPositionResolver()],
|
|
153
149
|
[/^bg-gradient-((?:repeating-)?(?:linear|radial|conic))$/, ([, s]) => ({
|
|
154
150
|
"background-image": `${s}-gradient(var(--un-gradient, var(--un-gradient-stops, rgba(255, 255, 255, 0))))`
|
|
@@ -704,12 +700,10 @@ function handlerDivide([, d, s], { theme }) {
|
|
|
704
700
|
const value = item.endsWith("right") || item.endsWith("bottom") ? `calc(${v} * var(--un-divide-${d}-reverse))` : `calc(${v} * calc(1 - var(--un-divide-${d}-reverse)))`;
|
|
705
701
|
return [key, value];
|
|
706
702
|
});
|
|
707
|
-
|
|
708
|
-
if (results && borderStyle) {
|
|
703
|
+
if (results) {
|
|
709
704
|
return [
|
|
710
705
|
[`--un-divide-${d}-reverse`, 0],
|
|
711
|
-
...results
|
|
712
|
-
...borderStyle
|
|
706
|
+
...results
|
|
713
707
|
];
|
|
714
708
|
}
|
|
715
709
|
}
|
|
@@ -1203,20 +1197,13 @@ function variants(options) {
|
|
|
1203
1197
|
}
|
|
1204
1198
|
|
|
1205
1199
|
function presetWind(options = {}) {
|
|
1206
|
-
options.dark = options.dark ?? "class";
|
|
1207
|
-
options.attributifyPseudo = options.attributifyPseudo ?? false;
|
|
1208
|
-
options.preflight = options.preflight ?? true;
|
|
1209
|
-
options.variablePrefix = options.variablePrefix ?? "un-";
|
|
1210
1200
|
return {
|
|
1201
|
+
...presetMini(options),
|
|
1211
1202
|
name: "@unocss/preset-wind",
|
|
1212
1203
|
theme,
|
|
1213
1204
|
rules,
|
|
1214
1205
|
shortcuts,
|
|
1215
|
-
variants: variants(options)
|
|
1216
|
-
options,
|
|
1217
|
-
postprocess: VarPrefixPostprocessor(options.variablePrefix),
|
|
1218
|
-
preflights: options.preflight ? normalizePreflights(preflights, options.variablePrefix) : [],
|
|
1219
|
-
prefix: options.prefix
|
|
1206
|
+
variants: variants(options)
|
|
1220
1207
|
};
|
|
1221
1208
|
}
|
|
1222
1209
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-wind",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.51.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
|
-
"@unocss/preset-mini": "0.
|
|
38
|
+
"@unocss/core": "0.51.1",
|
|
39
|
+
"@unocss/preset-mini": "0.51.1"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "unbuild",
|