@unocss/preset-wind 0.39.2 → 0.41.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/README.md +21 -0
- package/dist/index.cjs +6 -7
- package/dist/index.mjs +6 -7
- package/package.json +3 -3
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 © 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)"] }],
|
|
@@ -279,7 +278,7 @@ const container = [
|
|
|
279
278
|
(m, { variantHandlers }) => {
|
|
280
279
|
let width = "100%";
|
|
281
280
|
for (const v of variantHandlers) {
|
|
282
|
-
const query =
|
|
281
|
+
const query = v.handle?.({}, (x) => x)?.parent;
|
|
283
282
|
if (typeof query === "string") {
|
|
284
283
|
const match = query.match(queryMatcher)?.[1];
|
|
285
284
|
if (match)
|
|
@@ -1040,12 +1039,12 @@ const theme = {
|
|
|
1040
1039
|
};
|
|
1041
1040
|
|
|
1042
1041
|
const variantCombinators = [
|
|
1043
|
-
utils.variantMatcher("svg", (input) => `${input} svg`)
|
|
1042
|
+
utils.variantMatcher("svg", (input) => ({ selector: `${input.selector} svg` }))
|
|
1044
1043
|
];
|
|
1045
1044
|
|
|
1046
1045
|
const variantColorsScheme = [
|
|
1047
|
-
utils.variantMatcher(".dark", (input) => `.dark $$ ${input}`),
|
|
1048
|
-
utils.variantMatcher(".light", (input) => `.light $$ ${input}`),
|
|
1046
|
+
utils.variantMatcher(".dark", (input) => ({ prefix: `.dark $$ ${input.prefix}` })),
|
|
1047
|
+
utils.variantMatcher(".light", (input) => ({ prefix: `.light $$ ${input.prefix}` })),
|
|
1049
1048
|
utils.variantParentMatcher("@dark", "@media (prefers-color-scheme: dark)"),
|
|
1050
1049
|
utils.variantParentMatcher("@light", "@media (prefers-color-scheme: light)")
|
|
1051
1050
|
];
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { preflights } from '@unocss/preset-mini';
|
|
2
2
|
export { colors, preflights } from '@unocss/preset-mini';
|
|
3
|
-
import { toArray } from '@unocss/core';
|
|
4
3
|
import { handler, positionMap, 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';
|
|
@@ -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)"] }],
|
|
@@ -276,7 +275,7 @@ const container = [
|
|
|
276
275
|
(m, { variantHandlers }) => {
|
|
277
276
|
let width = "100%";
|
|
278
277
|
for (const v of variantHandlers) {
|
|
279
|
-
const query =
|
|
278
|
+
const query = v.handle?.({}, (x) => x)?.parent;
|
|
280
279
|
if (typeof query === "string") {
|
|
281
280
|
const match = query.match(queryMatcher)?.[1];
|
|
282
281
|
if (match)
|
|
@@ -1037,12 +1036,12 @@ const theme = {
|
|
|
1037
1036
|
};
|
|
1038
1037
|
|
|
1039
1038
|
const variantCombinators = [
|
|
1040
|
-
variantMatcher("svg", (input) => `${input} svg`)
|
|
1039
|
+
variantMatcher("svg", (input) => ({ selector: `${input.selector} svg` }))
|
|
1041
1040
|
];
|
|
1042
1041
|
|
|
1043
1042
|
const variantColorsScheme = [
|
|
1044
|
-
variantMatcher(".dark", (input) => `.dark $$ ${input}`),
|
|
1045
|
-
variantMatcher(".light", (input) => `.light $$ ${input}`),
|
|
1043
|
+
variantMatcher(".dark", (input) => ({ prefix: `.dark $$ ${input.prefix}` })),
|
|
1044
|
+
variantMatcher(".light", (input) => ({ prefix: `.light $$ ${input.prefix}` })),
|
|
1046
1045
|
variantParentMatcher("@dark", "@media (prefers-color-scheme: dark)"),
|
|
1047
1046
|
variantParentMatcher("@light", "@media (prefers-color-scheme: light)")
|
|
1048
1047
|
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-wind",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.41.0",
|
|
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.41.0",
|
|
39
|
+
"@unocss/preset-mini": "0.41.0"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "unbuild",
|