@unocss/preset-wind 0.55.1 → 0.55.3
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 +51 -6
- package/dist/index.d.cts +19 -0
- package/dist/index.d.mts +19 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +46 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -3,25 +3,25 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const presetMini = require('@unocss/preset-mini');
|
|
6
|
-
const utils = require('@unocss/preset-mini/utils');
|
|
7
6
|
const core = require('@unocss/core');
|
|
7
|
+
const utils = require('@unocss/preset-mini/utils');
|
|
8
8
|
const _ = require('@unocss/preset-mini/rules');
|
|
9
9
|
const theme$1 = require('@unocss/preset-mini/theme');
|
|
10
10
|
const variants$1 = require('@unocss/preset-mini/variants');
|
|
11
11
|
|
|
12
|
-
function
|
|
13
|
-
if (e && e
|
|
12
|
+
function _interopNamespaceCompat(e) {
|
|
13
|
+
if (e && typeof e === 'object' && 'default' in e) return e;
|
|
14
14
|
const n = Object.create(null);
|
|
15
15
|
if (e) {
|
|
16
16
|
for (const k in e) {
|
|
17
17
|
n[k] = e[k];
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
n
|
|
20
|
+
n.default = e;
|
|
21
21
|
return n;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
const ___namespace = /*#__PURE__*/
|
|
24
|
+
const ___namespace = /*#__PURE__*/_interopNamespaceCompat(_);
|
|
25
25
|
|
|
26
26
|
const animations = [
|
|
27
27
|
[/^(?:animate-)?keyframes-(.+)$/, ([, name], { theme }) => {
|
|
@@ -51,9 +51,11 @@ const animations = [
|
|
|
51
51
|
return { animation: utils.h.bracket.cssvar(name) };
|
|
52
52
|
}, { autocomplete: "animate-$animation.keyframes" }],
|
|
53
53
|
[/^animate-name-(.+)/, ([, d]) => ({ "animation-name": utils.h.bracket.cssvar(d) ?? d })],
|
|
54
|
+
// timings
|
|
54
55
|
[/^animate-duration-(.+)$/, ([, d], { theme }) => ({ "animation-duration": theme.duration?.[d || "DEFAULT"] ?? utils.h.bracket.cssvar.time(d) }), { autocomplete: ["animate-duration", "animate-duration-$duration"] }],
|
|
55
56
|
[/^animate-delay-(.+)$/, ([, d], { theme }) => ({ "animation-delay": theme.duration?.[d || "DEFAULT"] ?? utils.h.bracket.cssvar.time(d) }), { autocomplete: ["animate-delay", "animate-delay-$duration"] }],
|
|
56
57
|
[/^animate-ease(?:-(.+))?$/, ([, d], { theme }) => ({ "animation-timing-function": theme.easing?.[d || "DEFAULT"] ?? utils.h.bracket.cssvar(d) }), { autocomplete: ["animate-ease", "animate-ease-$easing"] }],
|
|
58
|
+
// fill mode
|
|
57
59
|
[
|
|
58
60
|
/^animate-(fill-mode-|fill-|mode-)?(.+)$/,
|
|
59
61
|
([, t, d]) => ["none", "forwards", "backwards", "both", ...[t ? utils.globalKeywords : []]].includes(d) ? { "animation-fill-mode": d } : void 0,
|
|
@@ -65,6 +67,7 @@ const animations = [
|
|
|
65
67
|
]
|
|
66
68
|
}
|
|
67
69
|
],
|
|
70
|
+
// direction
|
|
68
71
|
[
|
|
69
72
|
/^animate-(direction-)?(.+)$/,
|
|
70
73
|
([, t, d]) => ["normal", "reverse", "alternate", "alternate-reverse", ...[t ? utils.globalKeywords : []]].includes(d) ? { "animation-direction": d } : void 0,
|
|
@@ -76,6 +79,7 @@ const animations = [
|
|
|
76
79
|
]
|
|
77
80
|
}
|
|
78
81
|
],
|
|
82
|
+
// others
|
|
79
83
|
[/^animate-(?:iteration-count-|iteration-|count-)(.+)$/, ([, d]) => ({ "animation-iteration-count": utils.h.bracket.cssvar(d) ?? d.replace(/\-/g, ",") }), { autocomplete: ["animate-(iteration|count|iteration-count)", "animate-(iteration|count|iteration-count)-<num>"] }],
|
|
80
84
|
[
|
|
81
85
|
/^animate-(play-state-|play-|state-)?(.+)$/,
|
|
@@ -157,6 +161,7 @@ const backgroundStyles = [
|
|
|
157
161
|
if (bgPositionRE.test(d) && utils.h.bracketOfPosition(d) != null)
|
|
158
162
|
return { "background-position": utils.h.bracketOfPosition(d).split(" ").map((e) => utils.h.position.fraction.auto.px.cssvar(e) ?? e).join(" ") };
|
|
159
163
|
}],
|
|
164
|
+
// gradients
|
|
160
165
|
[/^bg-gradient-(.+)$/, ([, d]) => ({ "--un-gradient": utils.h.bracket(d) }), {
|
|
161
166
|
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>"]
|
|
162
167
|
}],
|
|
@@ -166,9 +171,11 @@ const backgroundStyles = [
|
|
|
166
171
|
[/^(?:bg-gradient-)?(to)-(.+)$/, bgGradientColorResolver()],
|
|
167
172
|
[/^(?:bg-gradient-)?(from|via|to)-op(?:acity)?-?(.+)$/, ([, position, opacity]) => ({ [`--un-${position}-opacity`]: utils.h.bracket.percent(opacity) })],
|
|
168
173
|
[/^(from|via|to)-([\d\.]+)%$/, bgGradientPositionResolver()],
|
|
174
|
+
// images
|
|
169
175
|
[/^bg-gradient-((?:repeating-)?(?:linear|radial|conic))$/, ([, s]) => ({
|
|
170
176
|
"background-image": `${s}-gradient(var(--un-gradient, var(--un-gradient-stops, rgba(255, 255, 255, 0))))`
|
|
171
177
|
}), { autocomplete: ["bg-gradient-repeating", "bg-gradient-(linear|radial|conic)", "bg-gradient-repeating-(linear|radial|conic)"] }],
|
|
178
|
+
// ignore any center position
|
|
172
179
|
[/^bg-gradient-to-([rltb]{1,2})$/, ([, d]) => {
|
|
173
180
|
if (d in utils.positionMap) {
|
|
174
181
|
return {
|
|
@@ -191,12 +198,15 @@ const backgroundStyles = [
|
|
|
191
198
|
["box-decoration-slice", { "box-decoration-break": "slice" }],
|
|
192
199
|
["box-decoration-clone", { "box-decoration-break": "clone" }],
|
|
193
200
|
...utils.makeGlobalStaticRules("box-decoration", "box-decoration-break"),
|
|
201
|
+
// size
|
|
194
202
|
["bg-auto", { "background-size": "auto" }],
|
|
195
203
|
["bg-cover", { "background-size": "cover" }],
|
|
196
204
|
["bg-contain", { "background-size": "contain" }],
|
|
205
|
+
// attachments
|
|
197
206
|
["bg-fixed", { "background-attachment": "fixed" }],
|
|
198
207
|
["bg-local", { "background-attachment": "local" }],
|
|
199
208
|
["bg-scroll", { "background-attachment": "scroll" }],
|
|
209
|
+
// clips
|
|
200
210
|
["bg-clip-border", { "-webkit-background-clip": "border-box", "background-clip": "border-box" }],
|
|
201
211
|
["bg-clip-content", { "-webkit-background-clip": "content-box", "background-clip": "content-box" }],
|
|
202
212
|
["bg-clip-padding", { "-webkit-background-clip": "padding-box", "background-clip": "padding-box" }],
|
|
@@ -205,7 +215,10 @@ const backgroundStyles = [
|
|
|
205
215
|
"-webkit-background-clip": keyword,
|
|
206
216
|
"background-clip": keyword
|
|
207
217
|
}]),
|
|
218
|
+
// positions
|
|
219
|
+
// skip 1 & 2 letters shortcut
|
|
208
220
|
[/^bg-([-\w]{3,})$/, ([, s]) => ({ "background-position": utils.positionMap[s] })],
|
|
221
|
+
// repeats
|
|
209
222
|
["bg-repeat", { "background-repeat": "repeat" }],
|
|
210
223
|
["bg-no-repeat", { "background-repeat": "no-repeat" }],
|
|
211
224
|
["bg-repeat-x", { "background-repeat": "repeat-x" }],
|
|
@@ -213,6 +226,7 @@ const backgroundStyles = [
|
|
|
213
226
|
["bg-repeat-round", { "background-repeat": "round" }],
|
|
214
227
|
["bg-repeat-space", { "background-repeat": "space" }],
|
|
215
228
|
...utils.makeGlobalStaticRules("bg-repeat", "background-repeat"),
|
|
229
|
+
// origins
|
|
216
230
|
["bg-origin-border", { "background-origin": "border-box" }],
|
|
217
231
|
["bg-origin-padding", { "background-origin": "padding-box" }],
|
|
218
232
|
["bg-origin-content", { "background-origin": "content-box" }],
|
|
@@ -234,6 +248,7 @@ const listStyles = {
|
|
|
234
248
|
"upper-latin": "upper-latin"
|
|
235
249
|
};
|
|
236
250
|
const listStyle = [
|
|
251
|
+
// base
|
|
237
252
|
[/^list-(.+?)(?:-(outside|inside))?$/, ([, alias, position]) => {
|
|
238
253
|
const style = listStyles[alias];
|
|
239
254
|
if (style) {
|
|
@@ -246,9 +261,11 @@ const listStyle = [
|
|
|
246
261
|
return { "list-style-type": style };
|
|
247
262
|
}
|
|
248
263
|
}, { autocomplete: [`list-(${Object.keys(listStyles).join("|")})`, `list-(${Object.keys(listStyles).join("|")})-(outside|inside)`] }],
|
|
264
|
+
// styles
|
|
249
265
|
["list-outside", { "list-style-position": "outside" }],
|
|
250
266
|
["list-inside", { "list-style-position": "inside" }],
|
|
251
267
|
["list-none", { "list-style-type": "none" }],
|
|
268
|
+
// image
|
|
252
269
|
[/^list-image-(.+)$/, ([, d]) => {
|
|
253
270
|
if (/^\[url\(.+\)\]$/.test(d))
|
|
254
271
|
return { "list-style-image": utils.h.bracket(d) };
|
|
@@ -297,6 +314,7 @@ const scrollBehaviors = [
|
|
|
297
314
|
|
|
298
315
|
const columns = [
|
|
299
316
|
[/^columns-(.+)$/, ([, v]) => ({ columns: utils.h.bracket.global.number.auto.numberWithUnit(v) }), { autocomplete: "columns-<num>" }],
|
|
317
|
+
// break before
|
|
300
318
|
["break-before-auto", { "break-before": "auto" }],
|
|
301
319
|
["break-before-avoid", { "break-before": "avoid" }],
|
|
302
320
|
["break-before-all", { "break-before": "all" }],
|
|
@@ -306,11 +324,13 @@ const columns = [
|
|
|
306
324
|
["break-before-right", { "break-before": "right" }],
|
|
307
325
|
["break-before-column", { "break-before": "column" }],
|
|
308
326
|
...utils.makeGlobalStaticRules("break-before"),
|
|
327
|
+
// break inside
|
|
309
328
|
["break-inside-auto", { "break-inside": "auto" }],
|
|
310
329
|
["break-inside-avoid", { "break-inside": "avoid" }],
|
|
311
330
|
["break-inside-avoid-page", { "break-inside": "avoid-page" }],
|
|
312
331
|
["break-inside-avoid-column", { "break-inside": "avoid-column" }],
|
|
313
332
|
...utils.makeGlobalStaticRules("break-inside"),
|
|
333
|
+
// break after
|
|
314
334
|
["break-after-auto", { "break-after": "auto" }],
|
|
315
335
|
["break-after-avoid", { "break-after": "avoid" }],
|
|
316
336
|
["break-after-all", { "break-after": "all" }],
|
|
@@ -454,9 +474,11 @@ function dropShadowResolver([, s], { theme }) {
|
|
|
454
474
|
}
|
|
455
475
|
}
|
|
456
476
|
const filters = [
|
|
477
|
+
// filters
|
|
457
478
|
[/^(?:(backdrop-)|filter-)?blur(?:-(.+))?$/, toFilter("blur", (s, theme) => theme.blur?.[s || "DEFAULT"] || utils.h.bracket.cssvar.px(s)), { autocomplete: ["(backdrop|filter)-blur-$blur", "blur-$blur", "filter-blur"] }],
|
|
458
479
|
[/^(?:(backdrop-)|filter-)?brightness-(.+)$/, toFilter("brightness", (s) => utils.h.bracket.cssvar.percent(s)), { autocomplete: ["(backdrop|filter)-brightness-<percent>", "brightness-<percent>"] }],
|
|
459
480
|
[/^(?:(backdrop-)|filter-)?contrast-(.+)$/, toFilter("contrast", (s) => utils.h.bracket.cssvar.percent(s)), { autocomplete: ["(backdrop|filter)-contrast-<percent>", "contrast-<percent>"] }],
|
|
481
|
+
// drop-shadow only on filter
|
|
460
482
|
[/^(?:filter-)?drop-shadow(?:-(.+))?$/, dropShadowResolver, {
|
|
461
483
|
autocomplete: [
|
|
462
484
|
"filter-drop",
|
|
@@ -479,14 +501,17 @@ const filters = [
|
|
|
479
501
|
[/^(?:(backdrop-)|filter-)?grayscale(?:-(.+))?$/, toFilter("grayscale", percentWithDefault), { autocomplete: ["(backdrop|filter)-grayscale", "(backdrop|filter)-grayscale-<percent>", "grayscale-<percent>"] }],
|
|
480
502
|
[/^(?:(backdrop-)|filter-)?hue-rotate-(.+)$/, toFilter("hue-rotate", (s) => utils.h.bracket.cssvar.degree(s))],
|
|
481
503
|
[/^(?:(backdrop-)|filter-)?invert(?:-(.+))?$/, toFilter("invert", percentWithDefault), { autocomplete: ["(backdrop|filter)-invert", "(backdrop|filter)-invert-<percent>", "invert-<percent>"] }],
|
|
504
|
+
// opacity only on backdrop-filter
|
|
482
505
|
[/^(backdrop-)op(?:acity)-(.+)$/, toFilter("opacity", (s) => utils.h.bracket.cssvar.percent(s)), { autocomplete: ["backdrop-(op|opacity)", "backdrop-(op|opacity)-<percent>"] }],
|
|
483
506
|
[/^(?:(backdrop-)|filter-)?saturate-(.+)$/, toFilter("saturate", (s) => utils.h.bracket.cssvar.percent(s)), { autocomplete: ["(backdrop|filter)-saturate", "(backdrop|filter)-saturate-<percent>", "saturate-<percent>"] }],
|
|
484
507
|
[/^(?:(backdrop-)|filter-)?sepia(?:-(.+))?$/, toFilter("sepia", percentWithDefault), { autocomplete: ["(backdrop|filter)-sepia", "(backdrop|filter)-sepia-<percent>", "sepia-<percent>"] }],
|
|
508
|
+
// base
|
|
485
509
|
["filter", { filter: filterProperty }],
|
|
486
510
|
["backdrop-filter", {
|
|
487
511
|
"-webkit-backdrop-filter": backdropFilterProperty,
|
|
488
512
|
"backdrop-filter": backdropFilterProperty
|
|
489
513
|
}],
|
|
514
|
+
// nones
|
|
490
515
|
["filter-none", { filter: "none" }],
|
|
491
516
|
["backdrop-filter-none", {
|
|
492
517
|
"-webkit-backdrop-filter": "none",
|
|
@@ -525,6 +550,7 @@ function handlerSpace([, d, s], { theme }) {
|
|
|
525
550
|
}
|
|
526
551
|
|
|
527
552
|
const textTransforms = [
|
|
553
|
+
// tailwind compat
|
|
528
554
|
["uppercase", { "text-transform": "uppercase" }],
|
|
529
555
|
["lowercase", { "text-transform": "lowercase" }],
|
|
530
556
|
["capitalize", { "text-transform": "capitalize" }],
|
|
@@ -584,11 +610,13 @@ const isolations = [
|
|
|
584
610
|
["isolation-auto", { isolation: "auto" }]
|
|
585
611
|
];
|
|
586
612
|
const objectPositions = [
|
|
613
|
+
// object fit
|
|
587
614
|
["object-cover", { "object-fit": "cover" }],
|
|
588
615
|
["object-contain", { "object-fit": "contain" }],
|
|
589
616
|
["object-fill", { "object-fit": "fill" }],
|
|
590
617
|
["object-scale-down", { "object-fit": "scale-down" }],
|
|
591
618
|
["object-none", { "object-fit": "none" }],
|
|
619
|
+
// object position
|
|
592
620
|
[/^object-(.+)$/, ([, d]) => {
|
|
593
621
|
if (utils.positionMap[d])
|
|
594
622
|
return { "object-position": utils.positionMap[d] };
|
|
@@ -642,6 +670,7 @@ const borderSpacingBase = {
|
|
|
642
670
|
};
|
|
643
671
|
const borderSpacingProperty = "var(--un-border-spacing-x) var(--un-border-spacing-y)";
|
|
644
672
|
const tables = [
|
|
673
|
+
// displays
|
|
645
674
|
["inline-table", { display: "inline-table" }],
|
|
646
675
|
["table", { display: "table" }],
|
|
647
676
|
["table-caption", { display: "table-caption" }],
|
|
@@ -652,6 +681,7 @@ const tables = [
|
|
|
652
681
|
["table-header-group", { display: "table-header-group" }],
|
|
653
682
|
["table-row", { display: "table-row" }],
|
|
654
683
|
["table-row-group", { display: "table-row-group" }],
|
|
684
|
+
// layouts
|
|
655
685
|
["border-collapse", { "border-collapse": "collapse" }],
|
|
656
686
|
["border-separate", { "border-collapse": "separate" }],
|
|
657
687
|
[/^border-spacing-(.+)$/, ([, s], { theme }) => {
|
|
@@ -705,14 +735,17 @@ const cssVariables = [
|
|
|
705
735
|
];
|
|
706
736
|
|
|
707
737
|
const divides = [
|
|
738
|
+
// divides
|
|
708
739
|
[/^divide-?([xy])$/, handlerDivide, { autocomplete: ["divide-(x|y|block|inline)", "divide-(x|y|block|inline)-reverse", "divide-(x|y|block|inline)-$lineWidth"] }],
|
|
709
740
|
[/^divide-?([xy])-?(-?.+)$/, handlerDivide],
|
|
710
741
|
[/^divide-?([xy])-reverse$/, ([, d]) => ({ [`--un-divide-${d}-reverse`]: 1 })],
|
|
711
742
|
[/^divide-(block|inline)$/, handlerDivide],
|
|
712
743
|
[/^divide-(block|inline)-(-?.+)$/, handlerDivide],
|
|
713
744
|
[/^divide-(block|inline)-reverse$/, ([, d]) => ({ [`--un-divide-${d}-reverse`]: 1 })],
|
|
745
|
+
// color & opacity
|
|
714
746
|
[/^divide-(.+)$/, utils.colorResolver("border-color", "divide"), { autocomplete: "divide-$colors" }],
|
|
715
747
|
[/^divide-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-divide-opacity": utils.h.bracket.percent(opacity) }), { autocomplete: ["divide-(op|opacity)", "divide-(op|opacity)-<percent>"] }],
|
|
748
|
+
// styles
|
|
716
749
|
..._.borderStyles.map((style) => [`divide-${style}`, { "border-style": style }])
|
|
717
750
|
];
|
|
718
751
|
function handlerDivide([, d, s], { theme }) {
|
|
@@ -805,6 +838,7 @@ const scrollSnapTypeBase = {
|
|
|
805
838
|
"--un-scroll-snap-strictness": "proximity"
|
|
806
839
|
};
|
|
807
840
|
const scrolls = [
|
|
841
|
+
// snap type
|
|
808
842
|
[/^snap-(x|y)$/, ([, d]) => ({
|
|
809
843
|
"scroll-snap-type": `${d} var(--un-scroll-snap-strictness)`
|
|
810
844
|
}), { autocomplete: "snap-(x|y|both)" }],
|
|
@@ -814,12 +848,15 @@ const scrolls = [
|
|
|
814
848
|
["snap-mandatory", { "--un-scroll-snap-strictness": "mandatory" }],
|
|
815
849
|
["snap-proximity", { "--un-scroll-snap-strictness": "proximity" }],
|
|
816
850
|
["snap-none", { "scroll-snap-type": "none" }],
|
|
851
|
+
// snap align
|
|
817
852
|
["snap-start", { "scroll-snap-align": "start" }],
|
|
818
853
|
["snap-end", { "scroll-snap-align": "end" }],
|
|
819
854
|
["snap-center", { "scroll-snap-align": "center" }],
|
|
820
855
|
["snap-align-none", { "scroll-snap-align": "none" }],
|
|
856
|
+
// snap stop
|
|
821
857
|
["snap-normal", { "scroll-snap-stop": "normal" }],
|
|
822
858
|
["snap-always", { "scroll-snap-stop": "always" }],
|
|
859
|
+
// scroll margin
|
|
823
860
|
[/^scroll-ma?()-?(-?.+)$/, utils.directionSize("scroll-margin"), {
|
|
824
861
|
autocomplete: [
|
|
825
862
|
"scroll-(m|p|ma|pa|block|inline)",
|
|
@@ -832,6 +869,7 @@ const scrolls = [
|
|
|
832
869
|
[/^scroll-m-?([rltb])-?(-?.+)$/, utils.directionSize("scroll-margin")],
|
|
833
870
|
[/^scroll-m-(block|inline)-(-?.+)$/, utils.directionSize("scroll-margin")],
|
|
834
871
|
[/^scroll-m-?([bi][se])-?(-?.+)$/, utils.directionSize("scroll-margin")],
|
|
872
|
+
// scroll padding
|
|
835
873
|
[/^scroll-pa?()-?(-?.+)$/, utils.directionSize("scroll-padding")],
|
|
836
874
|
[/^scroll-p-?([xy])-?(-?.+)$/, utils.directionSize("scroll-padding")],
|
|
837
875
|
[/^scroll-p-?([rltb])-?(-?.+)$/, utils.directionSize("scroll-padding")],
|
|
@@ -840,6 +878,8 @@ const scrolls = [
|
|
|
840
878
|
];
|
|
841
879
|
|
|
842
880
|
const placeholders = [
|
|
881
|
+
// The prefix `$ ` is intentional. This rule is not to be matched directly from user-generated token.
|
|
882
|
+
// See variants/placeholder.
|
|
843
883
|
[/^\$ placeholder-(.+)$/, utils.colorResolver("color", "placeholder"), { autocomplete: "placeholder-$colors" }],
|
|
844
884
|
[/^\$ placeholder-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-placeholder-opacity": utils.h.bracket.percent(opacity) }), { autocomplete: ["placeholder-(op|opacity)", "placeholder-(op|opacity)-<percent>"] }]
|
|
845
885
|
];
|
|
@@ -931,6 +971,7 @@ const rules = [
|
|
|
931
971
|
___namespace.contents,
|
|
932
972
|
placeholders,
|
|
933
973
|
___namespace.containerParent,
|
|
974
|
+
// should be the last
|
|
934
975
|
___namespace.questionMark
|
|
935
976
|
].flat(1);
|
|
936
977
|
|
|
@@ -1198,6 +1239,10 @@ const placeholderModifier = (input, { theme }) => {
|
|
|
1198
1239
|
const [, pre = "", p, body] = m;
|
|
1199
1240
|
if (utils.hasParseableColor(body, theme) || hasOpacityValue(body)) {
|
|
1200
1241
|
return {
|
|
1242
|
+
// Append `placeholder-$ ` (with space!) to the rule to be matched.
|
|
1243
|
+
// The `placeholder-` is added for placeholder variant processing, and
|
|
1244
|
+
// the `$ ` is added for rule matching after `placeholder-` is removed by the variant.
|
|
1245
|
+
// See rules/placeholder.
|
|
1201
1246
|
matcher: `${pre}placeholder-$ ${p}${body}`
|
|
1202
1247
|
};
|
|
1203
1248
|
}
|
|
@@ -1237,7 +1282,7 @@ function presetWind(options = {}) {
|
|
|
1237
1282
|
|
|
1238
1283
|
exports.colors = presetMini.colors;
|
|
1239
1284
|
exports.preflights = presetMini.preflights;
|
|
1240
|
-
exports
|
|
1285
|
+
exports.default = presetWind;
|
|
1241
1286
|
exports.presetWind = presetWind;
|
|
1242
1287
|
exports.rules = rules;
|
|
1243
1288
|
exports.shortcuts = shortcuts;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as _unocss_core from '@unocss/core';
|
|
2
|
+
import { Rule, Variant, Preset } from '@unocss/core';
|
|
3
|
+
import * as _unocss_preset_mini from '@unocss/preset-mini';
|
|
4
|
+
import { Theme, PresetMiniOptions } from '@unocss/preset-mini';
|
|
5
|
+
export { Theme, colors, preflights } from '@unocss/preset-mini';
|
|
6
|
+
|
|
7
|
+
declare const rules: Rule[];
|
|
8
|
+
|
|
9
|
+
declare const shortcuts: _unocss_core.Shortcut<_unocss_preset_mini.Theme>[];
|
|
10
|
+
|
|
11
|
+
declare const theme: Theme;
|
|
12
|
+
|
|
13
|
+
declare function variants(options: PresetWindOptions): Variant<Theme>[];
|
|
14
|
+
|
|
15
|
+
interface PresetWindOptions extends PresetMiniOptions {
|
|
16
|
+
}
|
|
17
|
+
declare function presetWind(options?: PresetWindOptions): Preset<Theme>;
|
|
18
|
+
|
|
19
|
+
export { type PresetWindOptions, presetWind as default, presetWind, rules, shortcuts, theme, variants };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as _unocss_core from '@unocss/core';
|
|
2
|
+
import { Rule, Variant, Preset } from '@unocss/core';
|
|
3
|
+
import * as _unocss_preset_mini from '@unocss/preset-mini';
|
|
4
|
+
import { Theme, PresetMiniOptions } from '@unocss/preset-mini';
|
|
5
|
+
export { Theme, colors, preflights } from '@unocss/preset-mini';
|
|
6
|
+
|
|
7
|
+
declare const rules: Rule[];
|
|
8
|
+
|
|
9
|
+
declare const shortcuts: _unocss_core.Shortcut<_unocss_preset_mini.Theme>[];
|
|
10
|
+
|
|
11
|
+
declare const theme: Theme;
|
|
12
|
+
|
|
13
|
+
declare function variants(options: PresetWindOptions): Variant<Theme>[];
|
|
14
|
+
|
|
15
|
+
interface PresetWindOptions extends PresetMiniOptions {
|
|
16
|
+
}
|
|
17
|
+
declare function presetWind(options?: PresetWindOptions): Preset<Theme>;
|
|
18
|
+
|
|
19
|
+
export { type PresetWindOptions, presetWind as default, presetWind, rules, shortcuts, theme, variants };
|
package/dist/index.d.ts
CHANGED
|
@@ -16,4 +16,4 @@ interface PresetWindOptions extends PresetMiniOptions {
|
|
|
16
16
|
}
|
|
17
17
|
declare function presetWind(options?: PresetWindOptions): Preset<Theme>;
|
|
18
18
|
|
|
19
|
-
export { PresetWindOptions, presetWind as default, presetWind, rules, shortcuts, theme, variants };
|
|
19
|
+
export { type PresetWindOptions, presetWind as default, presetWind, rules, shortcuts, theme, variants };
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { presetMini } from '@unocss/preset-mini';
|
|
2
2
|
export { colors, preflights } from '@unocss/preset-mini';
|
|
3
|
-
import { h, globalKeywords, makeGlobalStaticRules, positionMap, parseColor, colorToString, colorOpacityToString, colorResolver, resolveBreakpoints, colorableShadows, directionMap, directionSize, variantMatcher, variantParentMatcher, hasParseableColor } from '@unocss/preset-mini/utils';
|
|
4
3
|
import { isString, warnOnce } from '@unocss/core';
|
|
4
|
+
import { h, globalKeywords, makeGlobalStaticRules, positionMap, parseColor, colorToString, colorOpacityToString, 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';
|
|
@@ -35,9 +35,11 @@ const animations = [
|
|
|
35
35
|
return { animation: h.bracket.cssvar(name) };
|
|
36
36
|
}, { autocomplete: "animate-$animation.keyframes" }],
|
|
37
37
|
[/^animate-name-(.+)/, ([, d]) => ({ "animation-name": h.bracket.cssvar(d) ?? d })],
|
|
38
|
+
// timings
|
|
38
39
|
[/^animate-duration-(.+)$/, ([, d], { theme }) => ({ "animation-duration": theme.duration?.[d || "DEFAULT"] ?? h.bracket.cssvar.time(d) }), { autocomplete: ["animate-duration", "animate-duration-$duration"] }],
|
|
39
40
|
[/^animate-delay-(.+)$/, ([, d], { theme }) => ({ "animation-delay": theme.duration?.[d || "DEFAULT"] ?? h.bracket.cssvar.time(d) }), { autocomplete: ["animate-delay", "animate-delay-$duration"] }],
|
|
40
41
|
[/^animate-ease(?:-(.+))?$/, ([, d], { theme }) => ({ "animation-timing-function": theme.easing?.[d || "DEFAULT"] ?? h.bracket.cssvar(d) }), { autocomplete: ["animate-ease", "animate-ease-$easing"] }],
|
|
42
|
+
// fill mode
|
|
41
43
|
[
|
|
42
44
|
/^animate-(fill-mode-|fill-|mode-)?(.+)$/,
|
|
43
45
|
([, t, d]) => ["none", "forwards", "backwards", "both", ...[t ? globalKeywords : []]].includes(d) ? { "animation-fill-mode": d } : void 0,
|
|
@@ -49,6 +51,7 @@ const animations = [
|
|
|
49
51
|
]
|
|
50
52
|
}
|
|
51
53
|
],
|
|
54
|
+
// direction
|
|
52
55
|
[
|
|
53
56
|
/^animate-(direction-)?(.+)$/,
|
|
54
57
|
([, t, d]) => ["normal", "reverse", "alternate", "alternate-reverse", ...[t ? globalKeywords : []]].includes(d) ? { "animation-direction": d } : void 0,
|
|
@@ -60,6 +63,7 @@ const animations = [
|
|
|
60
63
|
]
|
|
61
64
|
}
|
|
62
65
|
],
|
|
66
|
+
// others
|
|
63
67
|
[/^animate-(?:iteration-count-|iteration-|count-)(.+)$/, ([, d]) => ({ "animation-iteration-count": h.bracket.cssvar(d) ?? d.replace(/\-/g, ",") }), { autocomplete: ["animate-(iteration|count|iteration-count)", "animate-(iteration|count|iteration-count)-<num>"] }],
|
|
64
68
|
[
|
|
65
69
|
/^animate-(play-state-|play-|state-)?(.+)$/,
|
|
@@ -141,6 +145,7 @@ const backgroundStyles = [
|
|
|
141
145
|
if (bgPositionRE.test(d) && h.bracketOfPosition(d) != null)
|
|
142
146
|
return { "background-position": h.bracketOfPosition(d).split(" ").map((e) => h.position.fraction.auto.px.cssvar(e) ?? e).join(" ") };
|
|
143
147
|
}],
|
|
148
|
+
// gradients
|
|
144
149
|
[/^bg-gradient-(.+)$/, ([, d]) => ({ "--un-gradient": h.bracket(d) }), {
|
|
145
150
|
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>"]
|
|
146
151
|
}],
|
|
@@ -150,9 +155,11 @@ const backgroundStyles = [
|
|
|
150
155
|
[/^(?:bg-gradient-)?(to)-(.+)$/, bgGradientColorResolver()],
|
|
151
156
|
[/^(?:bg-gradient-)?(from|via|to)-op(?:acity)?-?(.+)$/, ([, position, opacity]) => ({ [`--un-${position}-opacity`]: h.bracket.percent(opacity) })],
|
|
152
157
|
[/^(from|via|to)-([\d\.]+)%$/, bgGradientPositionResolver()],
|
|
158
|
+
// images
|
|
153
159
|
[/^bg-gradient-((?:repeating-)?(?:linear|radial|conic))$/, ([, s]) => ({
|
|
154
160
|
"background-image": `${s}-gradient(var(--un-gradient, var(--un-gradient-stops, rgba(255, 255, 255, 0))))`
|
|
155
161
|
}), { autocomplete: ["bg-gradient-repeating", "bg-gradient-(linear|radial|conic)", "bg-gradient-repeating-(linear|radial|conic)"] }],
|
|
162
|
+
// ignore any center position
|
|
156
163
|
[/^bg-gradient-to-([rltb]{1,2})$/, ([, d]) => {
|
|
157
164
|
if (d in positionMap) {
|
|
158
165
|
return {
|
|
@@ -175,12 +182,15 @@ const backgroundStyles = [
|
|
|
175
182
|
["box-decoration-slice", { "box-decoration-break": "slice" }],
|
|
176
183
|
["box-decoration-clone", { "box-decoration-break": "clone" }],
|
|
177
184
|
...makeGlobalStaticRules("box-decoration", "box-decoration-break"),
|
|
185
|
+
// size
|
|
178
186
|
["bg-auto", { "background-size": "auto" }],
|
|
179
187
|
["bg-cover", { "background-size": "cover" }],
|
|
180
188
|
["bg-contain", { "background-size": "contain" }],
|
|
189
|
+
// attachments
|
|
181
190
|
["bg-fixed", { "background-attachment": "fixed" }],
|
|
182
191
|
["bg-local", { "background-attachment": "local" }],
|
|
183
192
|
["bg-scroll", { "background-attachment": "scroll" }],
|
|
193
|
+
// clips
|
|
184
194
|
["bg-clip-border", { "-webkit-background-clip": "border-box", "background-clip": "border-box" }],
|
|
185
195
|
["bg-clip-content", { "-webkit-background-clip": "content-box", "background-clip": "content-box" }],
|
|
186
196
|
["bg-clip-padding", { "-webkit-background-clip": "padding-box", "background-clip": "padding-box" }],
|
|
@@ -189,7 +199,10 @@ const backgroundStyles = [
|
|
|
189
199
|
"-webkit-background-clip": keyword,
|
|
190
200
|
"background-clip": keyword
|
|
191
201
|
}]),
|
|
202
|
+
// positions
|
|
203
|
+
// skip 1 & 2 letters shortcut
|
|
192
204
|
[/^bg-([-\w]{3,})$/, ([, s]) => ({ "background-position": positionMap[s] })],
|
|
205
|
+
// repeats
|
|
193
206
|
["bg-repeat", { "background-repeat": "repeat" }],
|
|
194
207
|
["bg-no-repeat", { "background-repeat": "no-repeat" }],
|
|
195
208
|
["bg-repeat-x", { "background-repeat": "repeat-x" }],
|
|
@@ -197,6 +210,7 @@ const backgroundStyles = [
|
|
|
197
210
|
["bg-repeat-round", { "background-repeat": "round" }],
|
|
198
211
|
["bg-repeat-space", { "background-repeat": "space" }],
|
|
199
212
|
...makeGlobalStaticRules("bg-repeat", "background-repeat"),
|
|
213
|
+
// origins
|
|
200
214
|
["bg-origin-border", { "background-origin": "border-box" }],
|
|
201
215
|
["bg-origin-padding", { "background-origin": "padding-box" }],
|
|
202
216
|
["bg-origin-content", { "background-origin": "content-box" }],
|
|
@@ -218,6 +232,7 @@ const listStyles = {
|
|
|
218
232
|
"upper-latin": "upper-latin"
|
|
219
233
|
};
|
|
220
234
|
const listStyle = [
|
|
235
|
+
// base
|
|
221
236
|
[/^list-(.+?)(?:-(outside|inside))?$/, ([, alias, position]) => {
|
|
222
237
|
const style = listStyles[alias];
|
|
223
238
|
if (style) {
|
|
@@ -230,9 +245,11 @@ const listStyle = [
|
|
|
230
245
|
return { "list-style-type": style };
|
|
231
246
|
}
|
|
232
247
|
}, { autocomplete: [`list-(${Object.keys(listStyles).join("|")})`, `list-(${Object.keys(listStyles).join("|")})-(outside|inside)`] }],
|
|
248
|
+
// styles
|
|
233
249
|
["list-outside", { "list-style-position": "outside" }],
|
|
234
250
|
["list-inside", { "list-style-position": "inside" }],
|
|
235
251
|
["list-none", { "list-style-type": "none" }],
|
|
252
|
+
// image
|
|
236
253
|
[/^list-image-(.+)$/, ([, d]) => {
|
|
237
254
|
if (/^\[url\(.+\)\]$/.test(d))
|
|
238
255
|
return { "list-style-image": h.bracket(d) };
|
|
@@ -281,6 +298,7 @@ const scrollBehaviors = [
|
|
|
281
298
|
|
|
282
299
|
const columns = [
|
|
283
300
|
[/^columns-(.+)$/, ([, v]) => ({ columns: h.bracket.global.number.auto.numberWithUnit(v) }), { autocomplete: "columns-<num>" }],
|
|
301
|
+
// break before
|
|
284
302
|
["break-before-auto", { "break-before": "auto" }],
|
|
285
303
|
["break-before-avoid", { "break-before": "avoid" }],
|
|
286
304
|
["break-before-all", { "break-before": "all" }],
|
|
@@ -290,11 +308,13 @@ const columns = [
|
|
|
290
308
|
["break-before-right", { "break-before": "right" }],
|
|
291
309
|
["break-before-column", { "break-before": "column" }],
|
|
292
310
|
...makeGlobalStaticRules("break-before"),
|
|
311
|
+
// break inside
|
|
293
312
|
["break-inside-auto", { "break-inside": "auto" }],
|
|
294
313
|
["break-inside-avoid", { "break-inside": "avoid" }],
|
|
295
314
|
["break-inside-avoid-page", { "break-inside": "avoid-page" }],
|
|
296
315
|
["break-inside-avoid-column", { "break-inside": "avoid-column" }],
|
|
297
316
|
...makeGlobalStaticRules("break-inside"),
|
|
317
|
+
// break after
|
|
298
318
|
["break-after-auto", { "break-after": "auto" }],
|
|
299
319
|
["break-after-avoid", { "break-after": "avoid" }],
|
|
300
320
|
["break-after-all", { "break-after": "all" }],
|
|
@@ -438,9 +458,11 @@ function dropShadowResolver([, s], { theme }) {
|
|
|
438
458
|
}
|
|
439
459
|
}
|
|
440
460
|
const filters = [
|
|
461
|
+
// filters
|
|
441
462
|
[/^(?:(backdrop-)|filter-)?blur(?:-(.+))?$/, toFilter("blur", (s, theme) => theme.blur?.[s || "DEFAULT"] || h.bracket.cssvar.px(s)), { autocomplete: ["(backdrop|filter)-blur-$blur", "blur-$blur", "filter-blur"] }],
|
|
442
463
|
[/^(?:(backdrop-)|filter-)?brightness-(.+)$/, toFilter("brightness", (s) => h.bracket.cssvar.percent(s)), { autocomplete: ["(backdrop|filter)-brightness-<percent>", "brightness-<percent>"] }],
|
|
443
464
|
[/^(?:(backdrop-)|filter-)?contrast-(.+)$/, toFilter("contrast", (s) => h.bracket.cssvar.percent(s)), { autocomplete: ["(backdrop|filter)-contrast-<percent>", "contrast-<percent>"] }],
|
|
465
|
+
// drop-shadow only on filter
|
|
444
466
|
[/^(?:filter-)?drop-shadow(?:-(.+))?$/, dropShadowResolver, {
|
|
445
467
|
autocomplete: [
|
|
446
468
|
"filter-drop",
|
|
@@ -463,14 +485,17 @@ const filters = [
|
|
|
463
485
|
[/^(?:(backdrop-)|filter-)?grayscale(?:-(.+))?$/, toFilter("grayscale", percentWithDefault), { autocomplete: ["(backdrop|filter)-grayscale", "(backdrop|filter)-grayscale-<percent>", "grayscale-<percent>"] }],
|
|
464
486
|
[/^(?:(backdrop-)|filter-)?hue-rotate-(.+)$/, toFilter("hue-rotate", (s) => h.bracket.cssvar.degree(s))],
|
|
465
487
|
[/^(?:(backdrop-)|filter-)?invert(?:-(.+))?$/, toFilter("invert", percentWithDefault), { autocomplete: ["(backdrop|filter)-invert", "(backdrop|filter)-invert-<percent>", "invert-<percent>"] }],
|
|
488
|
+
// opacity only on backdrop-filter
|
|
466
489
|
[/^(backdrop-)op(?:acity)-(.+)$/, toFilter("opacity", (s) => h.bracket.cssvar.percent(s)), { autocomplete: ["backdrop-(op|opacity)", "backdrop-(op|opacity)-<percent>"] }],
|
|
467
490
|
[/^(?:(backdrop-)|filter-)?saturate-(.+)$/, toFilter("saturate", (s) => h.bracket.cssvar.percent(s)), { autocomplete: ["(backdrop|filter)-saturate", "(backdrop|filter)-saturate-<percent>", "saturate-<percent>"] }],
|
|
468
491
|
[/^(?:(backdrop-)|filter-)?sepia(?:-(.+))?$/, toFilter("sepia", percentWithDefault), { autocomplete: ["(backdrop|filter)-sepia", "(backdrop|filter)-sepia-<percent>", "sepia-<percent>"] }],
|
|
492
|
+
// base
|
|
469
493
|
["filter", { filter: filterProperty }],
|
|
470
494
|
["backdrop-filter", {
|
|
471
495
|
"-webkit-backdrop-filter": backdropFilterProperty,
|
|
472
496
|
"backdrop-filter": backdropFilterProperty
|
|
473
497
|
}],
|
|
498
|
+
// nones
|
|
474
499
|
["filter-none", { filter: "none" }],
|
|
475
500
|
["backdrop-filter-none", {
|
|
476
501
|
"-webkit-backdrop-filter": "none",
|
|
@@ -509,6 +534,7 @@ function handlerSpace([, d, s], { theme }) {
|
|
|
509
534
|
}
|
|
510
535
|
|
|
511
536
|
const textTransforms = [
|
|
537
|
+
// tailwind compat
|
|
512
538
|
["uppercase", { "text-transform": "uppercase" }],
|
|
513
539
|
["lowercase", { "text-transform": "lowercase" }],
|
|
514
540
|
["capitalize", { "text-transform": "capitalize" }],
|
|
@@ -568,11 +594,13 @@ const isolations = [
|
|
|
568
594
|
["isolation-auto", { isolation: "auto" }]
|
|
569
595
|
];
|
|
570
596
|
const objectPositions = [
|
|
597
|
+
// object fit
|
|
571
598
|
["object-cover", { "object-fit": "cover" }],
|
|
572
599
|
["object-contain", { "object-fit": "contain" }],
|
|
573
600
|
["object-fill", { "object-fit": "fill" }],
|
|
574
601
|
["object-scale-down", { "object-fit": "scale-down" }],
|
|
575
602
|
["object-none", { "object-fit": "none" }],
|
|
603
|
+
// object position
|
|
576
604
|
[/^object-(.+)$/, ([, d]) => {
|
|
577
605
|
if (positionMap[d])
|
|
578
606
|
return { "object-position": positionMap[d] };
|
|
@@ -626,6 +654,7 @@ const borderSpacingBase = {
|
|
|
626
654
|
};
|
|
627
655
|
const borderSpacingProperty = "var(--un-border-spacing-x) var(--un-border-spacing-y)";
|
|
628
656
|
const tables = [
|
|
657
|
+
// displays
|
|
629
658
|
["inline-table", { display: "inline-table" }],
|
|
630
659
|
["table", { display: "table" }],
|
|
631
660
|
["table-caption", { display: "table-caption" }],
|
|
@@ -636,6 +665,7 @@ const tables = [
|
|
|
636
665
|
["table-header-group", { display: "table-header-group" }],
|
|
637
666
|
["table-row", { display: "table-row" }],
|
|
638
667
|
["table-row-group", { display: "table-row-group" }],
|
|
668
|
+
// layouts
|
|
639
669
|
["border-collapse", { "border-collapse": "collapse" }],
|
|
640
670
|
["border-separate", { "border-collapse": "separate" }],
|
|
641
671
|
[/^border-spacing-(.+)$/, ([, s], { theme }) => {
|
|
@@ -689,14 +719,17 @@ const cssVariables = [
|
|
|
689
719
|
];
|
|
690
720
|
|
|
691
721
|
const divides = [
|
|
722
|
+
// divides
|
|
692
723
|
[/^divide-?([xy])$/, handlerDivide, { autocomplete: ["divide-(x|y|block|inline)", "divide-(x|y|block|inline)-reverse", "divide-(x|y|block|inline)-$lineWidth"] }],
|
|
693
724
|
[/^divide-?([xy])-?(-?.+)$/, handlerDivide],
|
|
694
725
|
[/^divide-?([xy])-reverse$/, ([, d]) => ({ [`--un-divide-${d}-reverse`]: 1 })],
|
|
695
726
|
[/^divide-(block|inline)$/, handlerDivide],
|
|
696
727
|
[/^divide-(block|inline)-(-?.+)$/, handlerDivide],
|
|
697
728
|
[/^divide-(block|inline)-reverse$/, ([, d]) => ({ [`--un-divide-${d}-reverse`]: 1 })],
|
|
729
|
+
// color & opacity
|
|
698
730
|
[/^divide-(.+)$/, colorResolver("border-color", "divide"), { autocomplete: "divide-$colors" }],
|
|
699
731
|
[/^divide-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-divide-opacity": h.bracket.percent(opacity) }), { autocomplete: ["divide-(op|opacity)", "divide-(op|opacity)-<percent>"] }],
|
|
732
|
+
// styles
|
|
700
733
|
...borderStyles.map((style) => [`divide-${style}`, { "border-style": style }])
|
|
701
734
|
];
|
|
702
735
|
function handlerDivide([, d, s], { theme }) {
|
|
@@ -789,6 +822,7 @@ const scrollSnapTypeBase = {
|
|
|
789
822
|
"--un-scroll-snap-strictness": "proximity"
|
|
790
823
|
};
|
|
791
824
|
const scrolls = [
|
|
825
|
+
// snap type
|
|
792
826
|
[/^snap-(x|y)$/, ([, d]) => ({
|
|
793
827
|
"scroll-snap-type": `${d} var(--un-scroll-snap-strictness)`
|
|
794
828
|
}), { autocomplete: "snap-(x|y|both)" }],
|
|
@@ -798,12 +832,15 @@ const scrolls = [
|
|
|
798
832
|
["snap-mandatory", { "--un-scroll-snap-strictness": "mandatory" }],
|
|
799
833
|
["snap-proximity", { "--un-scroll-snap-strictness": "proximity" }],
|
|
800
834
|
["snap-none", { "scroll-snap-type": "none" }],
|
|
835
|
+
// snap align
|
|
801
836
|
["snap-start", { "scroll-snap-align": "start" }],
|
|
802
837
|
["snap-end", { "scroll-snap-align": "end" }],
|
|
803
838
|
["snap-center", { "scroll-snap-align": "center" }],
|
|
804
839
|
["snap-align-none", { "scroll-snap-align": "none" }],
|
|
840
|
+
// snap stop
|
|
805
841
|
["snap-normal", { "scroll-snap-stop": "normal" }],
|
|
806
842
|
["snap-always", { "scroll-snap-stop": "always" }],
|
|
843
|
+
// scroll margin
|
|
807
844
|
[/^scroll-ma?()-?(-?.+)$/, directionSize("scroll-margin"), {
|
|
808
845
|
autocomplete: [
|
|
809
846
|
"scroll-(m|p|ma|pa|block|inline)",
|
|
@@ -816,6 +853,7 @@ const scrolls = [
|
|
|
816
853
|
[/^scroll-m-?([rltb])-?(-?.+)$/, directionSize("scroll-margin")],
|
|
817
854
|
[/^scroll-m-(block|inline)-(-?.+)$/, directionSize("scroll-margin")],
|
|
818
855
|
[/^scroll-m-?([bi][se])-?(-?.+)$/, directionSize("scroll-margin")],
|
|
856
|
+
// scroll padding
|
|
819
857
|
[/^scroll-pa?()-?(-?.+)$/, directionSize("scroll-padding")],
|
|
820
858
|
[/^scroll-p-?([xy])-?(-?.+)$/, directionSize("scroll-padding")],
|
|
821
859
|
[/^scroll-p-?([rltb])-?(-?.+)$/, directionSize("scroll-padding")],
|
|
@@ -824,6 +862,8 @@ const scrolls = [
|
|
|
824
862
|
];
|
|
825
863
|
|
|
826
864
|
const placeholders = [
|
|
865
|
+
// The prefix `$ ` is intentional. This rule is not to be matched directly from user-generated token.
|
|
866
|
+
// See variants/placeholder.
|
|
827
867
|
[/^\$ placeholder-(.+)$/, colorResolver("color", "placeholder"), { autocomplete: "placeholder-$colors" }],
|
|
828
868
|
[/^\$ placeholder-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-placeholder-opacity": h.bracket.percent(opacity) }), { autocomplete: ["placeholder-(op|opacity)", "placeholder-(op|opacity)-<percent>"] }]
|
|
829
869
|
];
|
|
@@ -915,6 +955,7 @@ const rules = [
|
|
|
915
955
|
_.contents,
|
|
916
956
|
placeholders,
|
|
917
957
|
_.containerParent,
|
|
958
|
+
// should be the last
|
|
918
959
|
_.questionMark
|
|
919
960
|
].flat(1);
|
|
920
961
|
|
|
@@ -1182,6 +1223,10 @@ const placeholderModifier = (input, { theme }) => {
|
|
|
1182
1223
|
const [, pre = "", p, body] = m;
|
|
1183
1224
|
if (hasParseableColor(body, theme) || hasOpacityValue(body)) {
|
|
1184
1225
|
return {
|
|
1226
|
+
// Append `placeholder-$ ` (with space!) to the rule to be matched.
|
|
1227
|
+
// The `placeholder-` is added for placeholder variant processing, and
|
|
1228
|
+
// the `$ ` is added for rule matching after `placeholder-` is removed by the variant.
|
|
1229
|
+
// See rules/placeholder.
|
|
1185
1230
|
matcher: `${pre}placeholder-$ ${p}${body}`
|
|
1186
1231
|
};
|
|
1187
1232
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-wind",
|
|
3
|
-
"version": "0.55.
|
|
3
|
+
"version": "0.55.3",
|
|
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.55.
|
|
39
|
-
"@unocss/preset-mini": "0.55.
|
|
38
|
+
"@unocss/core": "0.55.3",
|
|
39
|
+
"@unocss/preset-mini": "0.55.3"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "unbuild",
|