@weapp-tailwindcss/merge 2.1.5 → 2.2.0-next.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 +2 -3
- package/dist/index.d.cts +9 -9
- package/dist/index.d.mts +9 -9
- package/dist/index.mjs +1 -3
- package/dist/lite.cjs +21 -0
- package/dist/lite.d.cts +16 -0
- package/dist/lite.d.mts +16 -0
- package/dist/lite.mjs +14 -0
- package/dist/slim.cjs +982 -0
- package/dist/slim.d.cts +33 -0
- package/dist/slim.d.mts +33 -0
- package/dist/slim.mjs +973 -0
- package/package.json +29 -3
package/dist/slim.mjs
ADDED
|
@@ -0,0 +1,973 @@
|
|
|
1
|
+
import { createRpxLengthTransform, createRuntimeFactory, weappTwIgnore } from "@weapp-tailwindcss/runtime";
|
|
2
|
+
import { createTailwindMerge as createTailwindMerge$1, fromTheme, mergeConfigs, twJoin as twJoin$1, validators } from "tailwind-merge";
|
|
3
|
+
//#region src/slim-config.ts
|
|
4
|
+
const { isAny, isAnyNonArbitrary, isArbitraryLength, isArbitraryPosition, isArbitrarySize, isArbitraryValue, isArbitraryVariable, isArbitraryVariableLength, isArbitraryVariablePosition, isArbitraryVariableSize, isFraction, isInteger, isNumber, isTshirtSize } = validators;
|
|
5
|
+
/**
|
|
6
|
+
* 精简版 tailwind-merge 配置,仅包含小程序场景中高频使用的 Tailwind 类冲突分组。
|
|
7
|
+
*
|
|
8
|
+
* 包含类别:布局、Flexbox、Grid、对齐、间距、尺寸、排版、背景、边框、效果、变换、过渡、交互、定位
|
|
9
|
+
* 排除类别:SVG、表格、滚动捕捉、触摸操作、遮罩、透视、容器查询、列、分页、装饰断行、
|
|
10
|
+
* 滚动行为覆盖、屏幕阅读器、宽高比、容器、强制颜色调整、will-change、行截断、
|
|
11
|
+
* 字体变体数字、渐变、滤镜/背景滤镜、强调色、光标颜色、外观
|
|
12
|
+
*/
|
|
13
|
+
function getSlimConfig() {
|
|
14
|
+
const themeColor = fromTheme("color");
|
|
15
|
+
const themeFont = fromTheme("font");
|
|
16
|
+
const themeText = fromTheme("text");
|
|
17
|
+
const themeFontWeight = fromTheme("font-weight");
|
|
18
|
+
const themeTracking = fromTheme("tracking");
|
|
19
|
+
const themeLeading = fromTheme("leading");
|
|
20
|
+
const themeSpacing = fromTheme("spacing");
|
|
21
|
+
const themeRadius = fromTheme("radius");
|
|
22
|
+
const themeShadow = fromTheme("shadow");
|
|
23
|
+
const themeEase = fromTheme("ease");
|
|
24
|
+
const themeAnimate = fromTheme("animate");
|
|
25
|
+
const themeBreakpoint = fromTheme("breakpoint");
|
|
26
|
+
const themeContainer = fromTheme("container");
|
|
27
|
+
/** 无歧义间距值 */
|
|
28
|
+
const scaleUnambiguousSpacing = () => [
|
|
29
|
+
isArbitraryVariable,
|
|
30
|
+
isArbitraryValue,
|
|
31
|
+
themeSpacing
|
|
32
|
+
];
|
|
33
|
+
/** 定位值 */
|
|
34
|
+
const scaleInset = () => [
|
|
35
|
+
isFraction,
|
|
36
|
+
"full",
|
|
37
|
+
"auto",
|
|
38
|
+
...scaleUnambiguousSpacing()
|
|
39
|
+
];
|
|
40
|
+
/** 溢出值 */
|
|
41
|
+
const scaleOverflow = () => [
|
|
42
|
+
"auto",
|
|
43
|
+
"hidden",
|
|
44
|
+
"clip",
|
|
45
|
+
"visible",
|
|
46
|
+
"scroll"
|
|
47
|
+
];
|
|
48
|
+
/** Grid 模板列/行 */
|
|
49
|
+
const scaleGridTemplateColsRows = () => [
|
|
50
|
+
isInteger,
|
|
51
|
+
"none",
|
|
52
|
+
"subgrid",
|
|
53
|
+
isArbitraryVariable,
|
|
54
|
+
isArbitraryValue
|
|
55
|
+
];
|
|
56
|
+
/** Grid 列/行起止 */
|
|
57
|
+
const scaleGridColRowStartAndEnd = () => [
|
|
58
|
+
"auto",
|
|
59
|
+
{ span: [
|
|
60
|
+
"full",
|
|
61
|
+
isInteger,
|
|
62
|
+
isArbitraryVariable,
|
|
63
|
+
isArbitraryValue
|
|
64
|
+
] },
|
|
65
|
+
isInteger,
|
|
66
|
+
isArbitraryVariable,
|
|
67
|
+
isArbitraryValue
|
|
68
|
+
];
|
|
69
|
+
/** Grid 列/行起始或结束 */
|
|
70
|
+
const scaleGridColRowStartOrEnd = () => [
|
|
71
|
+
isInteger,
|
|
72
|
+
"auto",
|
|
73
|
+
isArbitraryVariable,
|
|
74
|
+
isArbitraryValue
|
|
75
|
+
];
|
|
76
|
+
/** Grid 自动列/行 */
|
|
77
|
+
const scaleGridAutoColsRows = () => [
|
|
78
|
+
"auto",
|
|
79
|
+
"min",
|
|
80
|
+
"max",
|
|
81
|
+
"fr",
|
|
82
|
+
isArbitraryVariable,
|
|
83
|
+
isArbitraryValue
|
|
84
|
+
];
|
|
85
|
+
/** 主轴对齐 */
|
|
86
|
+
const scaleAlignPrimaryAxis = () => [
|
|
87
|
+
"start",
|
|
88
|
+
"end",
|
|
89
|
+
"center",
|
|
90
|
+
"between",
|
|
91
|
+
"around",
|
|
92
|
+
"evenly",
|
|
93
|
+
"stretch",
|
|
94
|
+
"baseline",
|
|
95
|
+
"center-safe",
|
|
96
|
+
"end-safe"
|
|
97
|
+
];
|
|
98
|
+
/** 交叉轴对齐 */
|
|
99
|
+
const scaleAlignSecondaryAxis = () => [
|
|
100
|
+
"start",
|
|
101
|
+
"end",
|
|
102
|
+
"center",
|
|
103
|
+
"stretch",
|
|
104
|
+
"center-safe",
|
|
105
|
+
"end-safe"
|
|
106
|
+
];
|
|
107
|
+
/** 外边距值 */
|
|
108
|
+
const scaleMargin = () => ["auto", ...scaleUnambiguousSpacing()];
|
|
109
|
+
/** 尺寸值 */
|
|
110
|
+
const scaleSizing = () => [
|
|
111
|
+
isFraction,
|
|
112
|
+
"auto",
|
|
113
|
+
"full",
|
|
114
|
+
"dvw",
|
|
115
|
+
"dvh",
|
|
116
|
+
"lvw",
|
|
117
|
+
"lvh",
|
|
118
|
+
"svw",
|
|
119
|
+
"svh",
|
|
120
|
+
"min",
|
|
121
|
+
"max",
|
|
122
|
+
"fit",
|
|
123
|
+
...scaleUnambiguousSpacing()
|
|
124
|
+
];
|
|
125
|
+
/** 颜色值 */
|
|
126
|
+
const scaleColor = () => [
|
|
127
|
+
themeColor,
|
|
128
|
+
isArbitraryVariable,
|
|
129
|
+
isArbitraryValue
|
|
130
|
+
];
|
|
131
|
+
/** 圆角值 */
|
|
132
|
+
const scaleRadius = () => [
|
|
133
|
+
"",
|
|
134
|
+
"none",
|
|
135
|
+
"full",
|
|
136
|
+
themeRadius,
|
|
137
|
+
isArbitraryVariable,
|
|
138
|
+
isArbitraryValue
|
|
139
|
+
];
|
|
140
|
+
/** 边框宽度值 */
|
|
141
|
+
const scaleBorderWidth = () => [
|
|
142
|
+
"",
|
|
143
|
+
isNumber,
|
|
144
|
+
isArbitraryVariableLength,
|
|
145
|
+
isArbitraryLength
|
|
146
|
+
];
|
|
147
|
+
/** 线条样式 */
|
|
148
|
+
const scaleLineStyle = () => [
|
|
149
|
+
"solid",
|
|
150
|
+
"dashed",
|
|
151
|
+
"dotted",
|
|
152
|
+
"double"
|
|
153
|
+
];
|
|
154
|
+
/** 混合模式 */
|
|
155
|
+
const scaleBlendMode = () => [
|
|
156
|
+
"normal",
|
|
157
|
+
"multiply",
|
|
158
|
+
"screen",
|
|
159
|
+
"overlay",
|
|
160
|
+
"darken",
|
|
161
|
+
"lighten",
|
|
162
|
+
"color-dodge",
|
|
163
|
+
"color-burn",
|
|
164
|
+
"hard-light",
|
|
165
|
+
"soft-light",
|
|
166
|
+
"difference",
|
|
167
|
+
"exclusion",
|
|
168
|
+
"hue",
|
|
169
|
+
"saturation",
|
|
170
|
+
"color",
|
|
171
|
+
"luminosity"
|
|
172
|
+
];
|
|
173
|
+
/** 位置值 */
|
|
174
|
+
const scalePosition = () => [
|
|
175
|
+
"center",
|
|
176
|
+
"top",
|
|
177
|
+
"bottom",
|
|
178
|
+
"left",
|
|
179
|
+
"right",
|
|
180
|
+
"top-left",
|
|
181
|
+
"left-top",
|
|
182
|
+
"top-right",
|
|
183
|
+
"right-top",
|
|
184
|
+
"bottom-right",
|
|
185
|
+
"right-bottom",
|
|
186
|
+
"bottom-left",
|
|
187
|
+
"left-bottom"
|
|
188
|
+
];
|
|
189
|
+
/** 位置值(含 arbitrary) */
|
|
190
|
+
const scalePositionWithArbitrary = () => [
|
|
191
|
+
...scalePosition(),
|
|
192
|
+
isArbitraryVariable,
|
|
193
|
+
isArbitraryValue
|
|
194
|
+
];
|
|
195
|
+
/** 背景位置值 */
|
|
196
|
+
const scaleBgPosition = () => [
|
|
197
|
+
...scalePosition(),
|
|
198
|
+
isArbitraryVariablePosition,
|
|
199
|
+
isArbitraryPosition,
|
|
200
|
+
{ position: [isArbitraryVariable, isArbitraryValue] }
|
|
201
|
+
];
|
|
202
|
+
/** 背景重复值 */
|
|
203
|
+
const scaleBgRepeat = () => ["no-repeat", { repeat: [
|
|
204
|
+
"",
|
|
205
|
+
"x",
|
|
206
|
+
"y",
|
|
207
|
+
"space",
|
|
208
|
+
"round"
|
|
209
|
+
] }];
|
|
210
|
+
/** 背景尺寸值 */
|
|
211
|
+
const scaleBgSize = () => [
|
|
212
|
+
"auto",
|
|
213
|
+
"cover",
|
|
214
|
+
"contain",
|
|
215
|
+
isArbitraryVariableSize,
|
|
216
|
+
isArbitrarySize,
|
|
217
|
+
{ size: [isArbitraryVariable, isArbitraryValue] }
|
|
218
|
+
];
|
|
219
|
+
/** 旋转值 */
|
|
220
|
+
const scaleRotate = () => [
|
|
221
|
+
"none",
|
|
222
|
+
isNumber,
|
|
223
|
+
isArbitraryVariable,
|
|
224
|
+
isArbitraryValue
|
|
225
|
+
];
|
|
226
|
+
/** 缩放值 */
|
|
227
|
+
const scaleScale = () => [
|
|
228
|
+
"none",
|
|
229
|
+
isNumber,
|
|
230
|
+
isArbitraryVariable,
|
|
231
|
+
isArbitraryValue
|
|
232
|
+
];
|
|
233
|
+
/** 平移值 */
|
|
234
|
+
const scaleTranslate = () => [
|
|
235
|
+
isFraction,
|
|
236
|
+
"full",
|
|
237
|
+
...scaleUnambiguousSpacing()
|
|
238
|
+
];
|
|
239
|
+
return {
|
|
240
|
+
cacheSize: 500,
|
|
241
|
+
theme: {
|
|
242
|
+
"animate": [
|
|
243
|
+
"spin",
|
|
244
|
+
"ping",
|
|
245
|
+
"pulse",
|
|
246
|
+
"bounce"
|
|
247
|
+
],
|
|
248
|
+
"blur": [isTshirtSize],
|
|
249
|
+
"breakpoint": [isTshirtSize],
|
|
250
|
+
"color": [isAny],
|
|
251
|
+
"container": [isTshirtSize],
|
|
252
|
+
"drop-shadow": [isTshirtSize],
|
|
253
|
+
"ease": [
|
|
254
|
+
"in",
|
|
255
|
+
"out",
|
|
256
|
+
"in-out"
|
|
257
|
+
],
|
|
258
|
+
"font": [isAnyNonArbitrary],
|
|
259
|
+
"font-weight": [
|
|
260
|
+
"thin",
|
|
261
|
+
"extralight",
|
|
262
|
+
"light",
|
|
263
|
+
"normal",
|
|
264
|
+
"medium",
|
|
265
|
+
"semibold",
|
|
266
|
+
"bold",
|
|
267
|
+
"extrabold",
|
|
268
|
+
"black"
|
|
269
|
+
],
|
|
270
|
+
"inset-shadow": [isTshirtSize],
|
|
271
|
+
"leading": [
|
|
272
|
+
"none",
|
|
273
|
+
"tight",
|
|
274
|
+
"snug",
|
|
275
|
+
"normal",
|
|
276
|
+
"relaxed",
|
|
277
|
+
"loose"
|
|
278
|
+
],
|
|
279
|
+
"radius": [isTshirtSize],
|
|
280
|
+
"shadow": [isTshirtSize],
|
|
281
|
+
"spacing": ["px", isNumber],
|
|
282
|
+
"text": [isTshirtSize],
|
|
283
|
+
"text-shadow": [isTshirtSize],
|
|
284
|
+
"tracking": [
|
|
285
|
+
"tighter",
|
|
286
|
+
"tight",
|
|
287
|
+
"normal",
|
|
288
|
+
"wide",
|
|
289
|
+
"wider",
|
|
290
|
+
"widest"
|
|
291
|
+
]
|
|
292
|
+
},
|
|
293
|
+
classGroups: {
|
|
294
|
+
"box": [{ box: ["border", "content"] }],
|
|
295
|
+
"display": [
|
|
296
|
+
"block",
|
|
297
|
+
"inline-block",
|
|
298
|
+
"inline",
|
|
299
|
+
"flex",
|
|
300
|
+
"inline-flex",
|
|
301
|
+
"table",
|
|
302
|
+
"inline-table",
|
|
303
|
+
"table-caption",
|
|
304
|
+
"table-cell",
|
|
305
|
+
"table-column",
|
|
306
|
+
"table-column-group",
|
|
307
|
+
"table-footer-group",
|
|
308
|
+
"table-header-group",
|
|
309
|
+
"table-row-group",
|
|
310
|
+
"table-row",
|
|
311
|
+
"flow-root",
|
|
312
|
+
"grid",
|
|
313
|
+
"inline-grid",
|
|
314
|
+
"contents",
|
|
315
|
+
"list-item",
|
|
316
|
+
"hidden"
|
|
317
|
+
],
|
|
318
|
+
"float": [{ float: [
|
|
319
|
+
"right",
|
|
320
|
+
"left",
|
|
321
|
+
"none",
|
|
322
|
+
"start",
|
|
323
|
+
"end"
|
|
324
|
+
] }],
|
|
325
|
+
"clear": [{ clear: [
|
|
326
|
+
"left",
|
|
327
|
+
"right",
|
|
328
|
+
"both",
|
|
329
|
+
"none",
|
|
330
|
+
"start",
|
|
331
|
+
"end"
|
|
332
|
+
] }],
|
|
333
|
+
"isolation": ["isolate", "isolation-auto"],
|
|
334
|
+
"object-fit": [{ object: [
|
|
335
|
+
"contain",
|
|
336
|
+
"cover",
|
|
337
|
+
"fill",
|
|
338
|
+
"none",
|
|
339
|
+
"scale-down"
|
|
340
|
+
] }],
|
|
341
|
+
"object-position": [{ object: scalePositionWithArbitrary() }],
|
|
342
|
+
"overflow": [{ overflow: scaleOverflow() }],
|
|
343
|
+
"overflow-x": [{ "overflow-x": scaleOverflow() }],
|
|
344
|
+
"overflow-y": [{ "overflow-y": scaleOverflow() }],
|
|
345
|
+
"position": [
|
|
346
|
+
"static",
|
|
347
|
+
"fixed",
|
|
348
|
+
"absolute",
|
|
349
|
+
"relative",
|
|
350
|
+
"sticky"
|
|
351
|
+
],
|
|
352
|
+
"visibility": [
|
|
353
|
+
"visible",
|
|
354
|
+
"invisible",
|
|
355
|
+
"collapse"
|
|
356
|
+
],
|
|
357
|
+
"z": [{ z: [
|
|
358
|
+
isInteger,
|
|
359
|
+
"auto",
|
|
360
|
+
isArbitraryVariable,
|
|
361
|
+
isArbitraryValue
|
|
362
|
+
] }],
|
|
363
|
+
"inset": [{ inset: scaleInset() }],
|
|
364
|
+
"inset-x": [{ "inset-x": scaleInset() }],
|
|
365
|
+
"inset-y": [{ "inset-y": scaleInset() }],
|
|
366
|
+
"start": [{
|
|
367
|
+
"inset-s": scaleInset(),
|
|
368
|
+
"start": scaleInset()
|
|
369
|
+
}],
|
|
370
|
+
"end": [{
|
|
371
|
+
"inset-e": scaleInset(),
|
|
372
|
+
"end": scaleInset()
|
|
373
|
+
}],
|
|
374
|
+
"top": [{ top: scaleInset() }],
|
|
375
|
+
"right": [{ right: scaleInset() }],
|
|
376
|
+
"bottom": [{ bottom: scaleInset() }],
|
|
377
|
+
"left": [{ left: scaleInset() }],
|
|
378
|
+
"basis": [{ basis: [
|
|
379
|
+
isFraction,
|
|
380
|
+
"full",
|
|
381
|
+
"auto",
|
|
382
|
+
themeContainer,
|
|
383
|
+
...scaleUnambiguousSpacing()
|
|
384
|
+
] }],
|
|
385
|
+
"flex-direction": [{ flex: [
|
|
386
|
+
"row",
|
|
387
|
+
"row-reverse",
|
|
388
|
+
"col",
|
|
389
|
+
"col-reverse"
|
|
390
|
+
] }],
|
|
391
|
+
"flex-wrap": [{ flex: [
|
|
392
|
+
"nowrap",
|
|
393
|
+
"wrap",
|
|
394
|
+
"wrap-reverse"
|
|
395
|
+
] }],
|
|
396
|
+
"flex": [{ flex: [
|
|
397
|
+
isNumber,
|
|
398
|
+
isFraction,
|
|
399
|
+
"auto",
|
|
400
|
+
"initial",
|
|
401
|
+
"none",
|
|
402
|
+
isArbitraryValue
|
|
403
|
+
] }],
|
|
404
|
+
"grow": [{ grow: [
|
|
405
|
+
"",
|
|
406
|
+
isNumber,
|
|
407
|
+
isArbitraryVariable,
|
|
408
|
+
isArbitraryValue
|
|
409
|
+
] }],
|
|
410
|
+
"shrink": [{ shrink: [
|
|
411
|
+
"",
|
|
412
|
+
isNumber,
|
|
413
|
+
isArbitraryVariable,
|
|
414
|
+
isArbitraryValue
|
|
415
|
+
] }],
|
|
416
|
+
"order": [{ order: [
|
|
417
|
+
isInteger,
|
|
418
|
+
"first",
|
|
419
|
+
"last",
|
|
420
|
+
"none",
|
|
421
|
+
isArbitraryVariable,
|
|
422
|
+
isArbitraryValue
|
|
423
|
+
] }],
|
|
424
|
+
"grid-cols": [{ "grid-cols": scaleGridTemplateColsRows() }],
|
|
425
|
+
"col-start-end": [{ col: scaleGridColRowStartAndEnd() }],
|
|
426
|
+
"col-start": [{ "col-start": scaleGridColRowStartOrEnd() }],
|
|
427
|
+
"col-end": [{ "col-end": scaleGridColRowStartOrEnd() }],
|
|
428
|
+
"grid-rows": [{ "grid-rows": scaleGridTemplateColsRows() }],
|
|
429
|
+
"row-start-end": [{ row: scaleGridColRowStartAndEnd() }],
|
|
430
|
+
"row-start": [{ "row-start": scaleGridColRowStartOrEnd() }],
|
|
431
|
+
"row-end": [{ "row-end": scaleGridColRowStartOrEnd() }],
|
|
432
|
+
"grid-flow": [{ "grid-flow": [
|
|
433
|
+
"row",
|
|
434
|
+
"col",
|
|
435
|
+
"dense",
|
|
436
|
+
"row-dense",
|
|
437
|
+
"col-dense"
|
|
438
|
+
] }],
|
|
439
|
+
"auto-cols": [{ "auto-cols": scaleGridAutoColsRows() }],
|
|
440
|
+
"auto-rows": [{ "auto-rows": scaleGridAutoColsRows() }],
|
|
441
|
+
"gap": [{ gap: scaleUnambiguousSpacing() }],
|
|
442
|
+
"gap-x": [{ "gap-x": scaleUnambiguousSpacing() }],
|
|
443
|
+
"gap-y": [{ "gap-y": scaleUnambiguousSpacing() }],
|
|
444
|
+
"justify-content": [{ justify: [...scaleAlignPrimaryAxis(), "normal"] }],
|
|
445
|
+
"justify-items": [{ "justify-items": [...scaleAlignSecondaryAxis(), "normal"] }],
|
|
446
|
+
"justify-self": [{ "justify-self": ["auto", ...scaleAlignSecondaryAxis()] }],
|
|
447
|
+
"align-content": [{ content: ["normal", ...scaleAlignPrimaryAxis()] }],
|
|
448
|
+
"align-items": [{ items: [...scaleAlignSecondaryAxis(), { baseline: ["", "last"] }] }],
|
|
449
|
+
"align-self": [{ self: [
|
|
450
|
+
"auto",
|
|
451
|
+
...scaleAlignSecondaryAxis(),
|
|
452
|
+
{ baseline: ["", "last"] }
|
|
453
|
+
] }],
|
|
454
|
+
"place-content": [{ "place-content": scaleAlignPrimaryAxis() }],
|
|
455
|
+
"place-items": [{ "place-items": [...scaleAlignSecondaryAxis(), "baseline"] }],
|
|
456
|
+
"place-self": [{ "place-self": ["auto", ...scaleAlignSecondaryAxis()] }],
|
|
457
|
+
"p": [{ p: scaleUnambiguousSpacing() }],
|
|
458
|
+
"px": [{ px: scaleUnambiguousSpacing() }],
|
|
459
|
+
"py": [{ py: scaleUnambiguousSpacing() }],
|
|
460
|
+
"ps": [{ ps: scaleUnambiguousSpacing() }],
|
|
461
|
+
"pe": [{ pe: scaleUnambiguousSpacing() }],
|
|
462
|
+
"pt": [{ pt: scaleUnambiguousSpacing() }],
|
|
463
|
+
"pr": [{ pr: scaleUnambiguousSpacing() }],
|
|
464
|
+
"pb": [{ pb: scaleUnambiguousSpacing() }],
|
|
465
|
+
"pl": [{ pl: scaleUnambiguousSpacing() }],
|
|
466
|
+
"m": [{ m: scaleMargin() }],
|
|
467
|
+
"mx": [{ mx: scaleMargin() }],
|
|
468
|
+
"my": [{ my: scaleMargin() }],
|
|
469
|
+
"ms": [{ ms: scaleMargin() }],
|
|
470
|
+
"me": [{ me: scaleMargin() }],
|
|
471
|
+
"mt": [{ mt: scaleMargin() }],
|
|
472
|
+
"mr": [{ mr: scaleMargin() }],
|
|
473
|
+
"mb": [{ mb: scaleMargin() }],
|
|
474
|
+
"ml": [{ ml: scaleMargin() }],
|
|
475
|
+
"space-x": [{ "space-x": scaleUnambiguousSpacing() }],
|
|
476
|
+
"space-x-reverse": ["space-x-reverse"],
|
|
477
|
+
"space-y": [{ "space-y": scaleUnambiguousSpacing() }],
|
|
478
|
+
"space-y-reverse": ["space-y-reverse"],
|
|
479
|
+
"size": [{ size: scaleSizing() }],
|
|
480
|
+
"w": [{ w: [
|
|
481
|
+
themeContainer,
|
|
482
|
+
"screen",
|
|
483
|
+
...scaleSizing()
|
|
484
|
+
] }],
|
|
485
|
+
"min-w": [{ "min-w": [
|
|
486
|
+
themeContainer,
|
|
487
|
+
"screen",
|
|
488
|
+
"none",
|
|
489
|
+
...scaleSizing()
|
|
490
|
+
] }],
|
|
491
|
+
"max-w": [{ "max-w": [
|
|
492
|
+
themeContainer,
|
|
493
|
+
"screen",
|
|
494
|
+
"none",
|
|
495
|
+
"prose",
|
|
496
|
+
{ screen: [themeBreakpoint] },
|
|
497
|
+
...scaleSizing()
|
|
498
|
+
] }],
|
|
499
|
+
"h": [{ h: [
|
|
500
|
+
"screen",
|
|
501
|
+
"lh",
|
|
502
|
+
...scaleSizing()
|
|
503
|
+
] }],
|
|
504
|
+
"min-h": [{ "min-h": [
|
|
505
|
+
"screen",
|
|
506
|
+
"lh",
|
|
507
|
+
"none",
|
|
508
|
+
...scaleSizing()
|
|
509
|
+
] }],
|
|
510
|
+
"max-h": [{ "max-h": [
|
|
511
|
+
"screen",
|
|
512
|
+
"lh",
|
|
513
|
+
...scaleSizing()
|
|
514
|
+
] }],
|
|
515
|
+
"font-size": [{ text: [
|
|
516
|
+
"base",
|
|
517
|
+
themeText,
|
|
518
|
+
isArbitraryVariableLength,
|
|
519
|
+
isArbitraryLength
|
|
520
|
+
] }],
|
|
521
|
+
"font-style": ["italic", "not-italic"],
|
|
522
|
+
"font-weight": [{ font: [
|
|
523
|
+
themeFontWeight,
|
|
524
|
+
isArbitraryVariable,
|
|
525
|
+
isArbitraryValue
|
|
526
|
+
] }],
|
|
527
|
+
"font-family": [{ font: [
|
|
528
|
+
isArbitraryVariable,
|
|
529
|
+
isArbitraryValue,
|
|
530
|
+
themeFont
|
|
531
|
+
] }],
|
|
532
|
+
"tracking": [{ tracking: [
|
|
533
|
+
themeTracking,
|
|
534
|
+
isArbitraryVariable,
|
|
535
|
+
isArbitraryValue
|
|
536
|
+
] }],
|
|
537
|
+
"leading": [{ leading: [themeLeading, ...scaleUnambiguousSpacing()] }],
|
|
538
|
+
"text-alignment": [{ text: [
|
|
539
|
+
"left",
|
|
540
|
+
"center",
|
|
541
|
+
"right",
|
|
542
|
+
"justify",
|
|
543
|
+
"start",
|
|
544
|
+
"end"
|
|
545
|
+
] }],
|
|
546
|
+
"text-color": [{ text: scaleColor() }],
|
|
547
|
+
"text-decoration": [
|
|
548
|
+
"underline",
|
|
549
|
+
"overline",
|
|
550
|
+
"line-through",
|
|
551
|
+
"no-underline"
|
|
552
|
+
],
|
|
553
|
+
"text-decoration-color": [{ decoration: scaleColor() }],
|
|
554
|
+
"text-decoration-style": [{ decoration: [...scaleLineStyle(), "wavy"] }],
|
|
555
|
+
"text-decoration-thickness": [{ decoration: [
|
|
556
|
+
isNumber,
|
|
557
|
+
"from-font",
|
|
558
|
+
"auto",
|
|
559
|
+
isArbitraryVariable,
|
|
560
|
+
isArbitraryLength
|
|
561
|
+
] }],
|
|
562
|
+
"text-transform": [
|
|
563
|
+
"uppercase",
|
|
564
|
+
"lowercase",
|
|
565
|
+
"capitalize",
|
|
566
|
+
"normal-case"
|
|
567
|
+
],
|
|
568
|
+
"text-overflow": [
|
|
569
|
+
"truncate",
|
|
570
|
+
"text-ellipsis",
|
|
571
|
+
"text-clip"
|
|
572
|
+
],
|
|
573
|
+
"text-wrap": [{ text: [
|
|
574
|
+
"wrap",
|
|
575
|
+
"nowrap",
|
|
576
|
+
"balance",
|
|
577
|
+
"pretty"
|
|
578
|
+
] }],
|
|
579
|
+
"indent": [{ indent: scaleUnambiguousSpacing() }],
|
|
580
|
+
"whitespace": [{ whitespace: [
|
|
581
|
+
"normal",
|
|
582
|
+
"nowrap",
|
|
583
|
+
"pre",
|
|
584
|
+
"pre-line",
|
|
585
|
+
"pre-wrap",
|
|
586
|
+
"break-spaces"
|
|
587
|
+
] }],
|
|
588
|
+
"break": [{ break: [
|
|
589
|
+
"normal",
|
|
590
|
+
"words",
|
|
591
|
+
"all",
|
|
592
|
+
"keep"
|
|
593
|
+
] }],
|
|
594
|
+
"hyphens": [{ hyphens: [
|
|
595
|
+
"none",
|
|
596
|
+
"manual",
|
|
597
|
+
"auto"
|
|
598
|
+
] }],
|
|
599
|
+
"content": [{ content: [
|
|
600
|
+
"none",
|
|
601
|
+
isArbitraryVariable,
|
|
602
|
+
isArbitraryValue
|
|
603
|
+
] }],
|
|
604
|
+
"bg-attachment": [{ bg: [
|
|
605
|
+
"fixed",
|
|
606
|
+
"local",
|
|
607
|
+
"scroll"
|
|
608
|
+
] }],
|
|
609
|
+
"bg-clip": [{ "bg-clip": [
|
|
610
|
+
"border",
|
|
611
|
+
"padding",
|
|
612
|
+
"content",
|
|
613
|
+
"text"
|
|
614
|
+
] }],
|
|
615
|
+
"bg-origin": [{ "bg-origin": [
|
|
616
|
+
"border",
|
|
617
|
+
"padding",
|
|
618
|
+
"content"
|
|
619
|
+
] }],
|
|
620
|
+
"bg-position": [{ bg: scaleBgPosition() }],
|
|
621
|
+
"bg-repeat": [{ bg: scaleBgRepeat() }],
|
|
622
|
+
"bg-size": [{ bg: scaleBgSize() }],
|
|
623
|
+
"bg-image": [{ bg: [
|
|
624
|
+
"none",
|
|
625
|
+
{
|
|
626
|
+
linear: [
|
|
627
|
+
{ to: [
|
|
628
|
+
"t",
|
|
629
|
+
"tr",
|
|
630
|
+
"r",
|
|
631
|
+
"br",
|
|
632
|
+
"b",
|
|
633
|
+
"bl",
|
|
634
|
+
"l",
|
|
635
|
+
"tl"
|
|
636
|
+
] },
|
|
637
|
+
isInteger,
|
|
638
|
+
isArbitraryVariable,
|
|
639
|
+
isArbitraryValue
|
|
640
|
+
],
|
|
641
|
+
radial: [
|
|
642
|
+
"",
|
|
643
|
+
isArbitraryVariable,
|
|
644
|
+
isArbitraryValue
|
|
645
|
+
],
|
|
646
|
+
conic: [
|
|
647
|
+
isInteger,
|
|
648
|
+
isArbitraryVariable,
|
|
649
|
+
isArbitraryValue
|
|
650
|
+
]
|
|
651
|
+
},
|
|
652
|
+
isArbitraryVariable,
|
|
653
|
+
isArbitraryValue
|
|
654
|
+
] }],
|
|
655
|
+
"bg-color": [{ bg: scaleColor() }],
|
|
656
|
+
"rounded": [{ rounded: scaleRadius() }],
|
|
657
|
+
"rounded-s": [{ "rounded-s": scaleRadius() }],
|
|
658
|
+
"rounded-e": [{ "rounded-e": scaleRadius() }],
|
|
659
|
+
"rounded-t": [{ "rounded-t": scaleRadius() }],
|
|
660
|
+
"rounded-r": [{ "rounded-r": scaleRadius() }],
|
|
661
|
+
"rounded-b": [{ "rounded-b": scaleRadius() }],
|
|
662
|
+
"rounded-l": [{ "rounded-l": scaleRadius() }],
|
|
663
|
+
"rounded-ss": [{ "rounded-ss": scaleRadius() }],
|
|
664
|
+
"rounded-se": [{ "rounded-se": scaleRadius() }],
|
|
665
|
+
"rounded-ee": [{ "rounded-ee": scaleRadius() }],
|
|
666
|
+
"rounded-es": [{ "rounded-es": scaleRadius() }],
|
|
667
|
+
"rounded-tl": [{ "rounded-tl": scaleRadius() }],
|
|
668
|
+
"rounded-tr": [{ "rounded-tr": scaleRadius() }],
|
|
669
|
+
"rounded-br": [{ "rounded-br": scaleRadius() }],
|
|
670
|
+
"rounded-bl": [{ "rounded-bl": scaleRadius() }],
|
|
671
|
+
"border-w": [{ border: scaleBorderWidth() }],
|
|
672
|
+
"border-w-x": [{ "border-x": scaleBorderWidth() }],
|
|
673
|
+
"border-w-y": [{ "border-y": scaleBorderWidth() }],
|
|
674
|
+
"border-w-s": [{ "border-s": scaleBorderWidth() }],
|
|
675
|
+
"border-w-e": [{ "border-e": scaleBorderWidth() }],
|
|
676
|
+
"border-w-t": [{ "border-t": scaleBorderWidth() }],
|
|
677
|
+
"border-w-r": [{ "border-r": scaleBorderWidth() }],
|
|
678
|
+
"border-w-b": [{ "border-b": scaleBorderWidth() }],
|
|
679
|
+
"border-w-l": [{ "border-l": scaleBorderWidth() }],
|
|
680
|
+
"border-style": [{ border: [
|
|
681
|
+
...scaleLineStyle(),
|
|
682
|
+
"hidden",
|
|
683
|
+
"none"
|
|
684
|
+
] }],
|
|
685
|
+
"border-color": [{ border: scaleColor() }],
|
|
686
|
+
"border-color-x": [{ "border-x": scaleColor() }],
|
|
687
|
+
"border-color-y": [{ "border-y": scaleColor() }],
|
|
688
|
+
"border-color-s": [{ "border-s": scaleColor() }],
|
|
689
|
+
"border-color-e": [{ "border-e": scaleColor() }],
|
|
690
|
+
"border-color-t": [{ "border-t": scaleColor() }],
|
|
691
|
+
"border-color-r": [{ "border-r": scaleColor() }],
|
|
692
|
+
"border-color-b": [{ "border-b": scaleColor() }],
|
|
693
|
+
"border-color-l": [{ "border-l": scaleColor() }],
|
|
694
|
+
"outline-style": [{ outline: [
|
|
695
|
+
...scaleLineStyle(),
|
|
696
|
+
"none",
|
|
697
|
+
"hidden"
|
|
698
|
+
] }],
|
|
699
|
+
"outline-w": [{ outline: [
|
|
700
|
+
"",
|
|
701
|
+
isNumber,
|
|
702
|
+
isArbitraryVariableLength,
|
|
703
|
+
isArbitraryLength
|
|
704
|
+
] }],
|
|
705
|
+
"outline-color": [{ outline: scaleColor() }],
|
|
706
|
+
"outline-offset": [{ "outline-offset": [
|
|
707
|
+
isNumber,
|
|
708
|
+
isArbitraryVariable,
|
|
709
|
+
isArbitraryValue
|
|
710
|
+
] }],
|
|
711
|
+
"ring-w": [{ ring: scaleBorderWidth() }],
|
|
712
|
+
"ring-color": [{ ring: scaleColor() }],
|
|
713
|
+
"ring-offset-w": [{ "ring-offset": [isNumber, isArbitraryLength] }],
|
|
714
|
+
"ring-offset-color": [{ "ring-offset": scaleColor() }],
|
|
715
|
+
"opacity": [{ opacity: [
|
|
716
|
+
isNumber,
|
|
717
|
+
isArbitraryVariable,
|
|
718
|
+
isArbitraryValue
|
|
719
|
+
] }],
|
|
720
|
+
"shadow": [{ shadow: [
|
|
721
|
+
"",
|
|
722
|
+
"none",
|
|
723
|
+
themeShadow,
|
|
724
|
+
isArbitraryVariable,
|
|
725
|
+
isArbitraryValue
|
|
726
|
+
] }],
|
|
727
|
+
"shadow-color": [{ shadow: scaleColor() }],
|
|
728
|
+
"mix-blend": [{ "mix-blend": [
|
|
729
|
+
...scaleBlendMode(),
|
|
730
|
+
"plus-darker",
|
|
731
|
+
"plus-lighter"
|
|
732
|
+
] }],
|
|
733
|
+
"bg-blend": [{ "bg-blend": scaleBlendMode() }],
|
|
734
|
+
"translate": [{ translate: scaleTranslate() }],
|
|
735
|
+
"translate-x": [{ "translate-x": scaleTranslate() }],
|
|
736
|
+
"translate-y": [{ "translate-y": scaleTranslate() }],
|
|
737
|
+
"translate-none": ["translate-none"],
|
|
738
|
+
"scale": [{ scale: scaleScale() }],
|
|
739
|
+
"scale-x": [{ "scale-x": scaleScale() }],
|
|
740
|
+
"scale-y": [{ "scale-y": scaleScale() }],
|
|
741
|
+
"rotate": [{ rotate: scaleRotate() }],
|
|
742
|
+
"transition": [{ transition: [
|
|
743
|
+
"",
|
|
744
|
+
"all",
|
|
745
|
+
"colors",
|
|
746
|
+
"opacity",
|
|
747
|
+
"shadow",
|
|
748
|
+
"transform",
|
|
749
|
+
"none",
|
|
750
|
+
isArbitraryVariable,
|
|
751
|
+
isArbitraryValue
|
|
752
|
+
] }],
|
|
753
|
+
"duration": [{ duration: [
|
|
754
|
+
isNumber,
|
|
755
|
+
"initial",
|
|
756
|
+
isArbitraryVariable,
|
|
757
|
+
isArbitraryValue
|
|
758
|
+
] }],
|
|
759
|
+
"ease": [{ ease: [
|
|
760
|
+
"linear",
|
|
761
|
+
"initial",
|
|
762
|
+
themeEase,
|
|
763
|
+
isArbitraryVariable,
|
|
764
|
+
isArbitraryValue
|
|
765
|
+
] }],
|
|
766
|
+
"delay": [{ delay: [
|
|
767
|
+
isNumber,
|
|
768
|
+
isArbitraryVariable,
|
|
769
|
+
isArbitraryValue
|
|
770
|
+
] }],
|
|
771
|
+
"animate": [{ animate: [
|
|
772
|
+
"none",
|
|
773
|
+
themeAnimate,
|
|
774
|
+
isArbitraryVariable,
|
|
775
|
+
isArbitraryValue
|
|
776
|
+
] }],
|
|
777
|
+
"cursor": [{ cursor: [
|
|
778
|
+
"auto",
|
|
779
|
+
"default",
|
|
780
|
+
"pointer",
|
|
781
|
+
"wait",
|
|
782
|
+
"text",
|
|
783
|
+
"move",
|
|
784
|
+
"help",
|
|
785
|
+
"not-allowed",
|
|
786
|
+
"none",
|
|
787
|
+
"context-menu",
|
|
788
|
+
"progress",
|
|
789
|
+
"cell",
|
|
790
|
+
"crosshair",
|
|
791
|
+
"vertical-text",
|
|
792
|
+
"alias",
|
|
793
|
+
"copy",
|
|
794
|
+
"no-drop",
|
|
795
|
+
"grab",
|
|
796
|
+
"grabbing",
|
|
797
|
+
"all-scroll",
|
|
798
|
+
"col-resize",
|
|
799
|
+
"row-resize",
|
|
800
|
+
"n-resize",
|
|
801
|
+
"e-resize",
|
|
802
|
+
"s-resize",
|
|
803
|
+
"w-resize",
|
|
804
|
+
"ne-resize",
|
|
805
|
+
"nw-resize",
|
|
806
|
+
"se-resize",
|
|
807
|
+
"sw-resize",
|
|
808
|
+
"ew-resize",
|
|
809
|
+
"ns-resize",
|
|
810
|
+
"nesw-resize",
|
|
811
|
+
"nwse-resize",
|
|
812
|
+
"zoom-in",
|
|
813
|
+
"zoom-out",
|
|
814
|
+
isArbitraryVariable,
|
|
815
|
+
isArbitraryValue
|
|
816
|
+
] }],
|
|
817
|
+
"pointer-events": [{ "pointer-events": ["auto", "none"] }],
|
|
818
|
+
"resize": [{ resize: [
|
|
819
|
+
"none",
|
|
820
|
+
"",
|
|
821
|
+
"y",
|
|
822
|
+
"x"
|
|
823
|
+
] }],
|
|
824
|
+
"select": [{ select: [
|
|
825
|
+
"none",
|
|
826
|
+
"text",
|
|
827
|
+
"all",
|
|
828
|
+
"auto"
|
|
829
|
+
] }]
|
|
830
|
+
},
|
|
831
|
+
conflictingClassGroups: {
|
|
832
|
+
"overflow": ["overflow-x", "overflow-y"],
|
|
833
|
+
"inset": [
|
|
834
|
+
"inset-x",
|
|
835
|
+
"inset-y",
|
|
836
|
+
"start",
|
|
837
|
+
"end",
|
|
838
|
+
"top",
|
|
839
|
+
"right",
|
|
840
|
+
"bottom",
|
|
841
|
+
"left"
|
|
842
|
+
],
|
|
843
|
+
"inset-x": ["right", "left"],
|
|
844
|
+
"inset-y": ["top", "bottom"],
|
|
845
|
+
"flex": [
|
|
846
|
+
"basis",
|
|
847
|
+
"grow",
|
|
848
|
+
"shrink"
|
|
849
|
+
],
|
|
850
|
+
"gap": ["gap-x", "gap-y"],
|
|
851
|
+
"p": [
|
|
852
|
+
"px",
|
|
853
|
+
"py",
|
|
854
|
+
"ps",
|
|
855
|
+
"pe",
|
|
856
|
+
"pt",
|
|
857
|
+
"pr",
|
|
858
|
+
"pb",
|
|
859
|
+
"pl"
|
|
860
|
+
],
|
|
861
|
+
"px": ["pr", "pl"],
|
|
862
|
+
"py": ["pt", "pb"],
|
|
863
|
+
"m": [
|
|
864
|
+
"mx",
|
|
865
|
+
"my",
|
|
866
|
+
"ms",
|
|
867
|
+
"me",
|
|
868
|
+
"mt",
|
|
869
|
+
"mr",
|
|
870
|
+
"mb",
|
|
871
|
+
"ml"
|
|
872
|
+
],
|
|
873
|
+
"mx": ["mr", "ml"],
|
|
874
|
+
"my": ["mt", "mb"],
|
|
875
|
+
"size": ["w", "h"],
|
|
876
|
+
"font-size": ["leading"],
|
|
877
|
+
"rounded": [
|
|
878
|
+
"rounded-s",
|
|
879
|
+
"rounded-e",
|
|
880
|
+
"rounded-t",
|
|
881
|
+
"rounded-r",
|
|
882
|
+
"rounded-b",
|
|
883
|
+
"rounded-l",
|
|
884
|
+
"rounded-ss",
|
|
885
|
+
"rounded-se",
|
|
886
|
+
"rounded-ee",
|
|
887
|
+
"rounded-es",
|
|
888
|
+
"rounded-tl",
|
|
889
|
+
"rounded-tr",
|
|
890
|
+
"rounded-br",
|
|
891
|
+
"rounded-bl"
|
|
892
|
+
],
|
|
893
|
+
"rounded-s": ["rounded-ss", "rounded-es"],
|
|
894
|
+
"rounded-e": ["rounded-se", "rounded-ee"],
|
|
895
|
+
"rounded-t": ["rounded-tl", "rounded-tr"],
|
|
896
|
+
"rounded-r": ["rounded-tr", "rounded-br"],
|
|
897
|
+
"rounded-b": ["rounded-br", "rounded-bl"],
|
|
898
|
+
"rounded-l": ["rounded-tl", "rounded-bl"],
|
|
899
|
+
"border-w": [
|
|
900
|
+
"border-w-x",
|
|
901
|
+
"border-w-y",
|
|
902
|
+
"border-w-s",
|
|
903
|
+
"border-w-e",
|
|
904
|
+
"border-w-t",
|
|
905
|
+
"border-w-r",
|
|
906
|
+
"border-w-b",
|
|
907
|
+
"border-w-l"
|
|
908
|
+
],
|
|
909
|
+
"border-w-x": ["border-w-r", "border-w-l"],
|
|
910
|
+
"border-w-y": ["border-w-t", "border-w-b"],
|
|
911
|
+
"border-color": [
|
|
912
|
+
"border-color-x",
|
|
913
|
+
"border-color-y",
|
|
914
|
+
"border-color-s",
|
|
915
|
+
"border-color-e",
|
|
916
|
+
"border-color-t",
|
|
917
|
+
"border-color-r",
|
|
918
|
+
"border-color-b",
|
|
919
|
+
"border-color-l"
|
|
920
|
+
],
|
|
921
|
+
"border-color-x": ["border-color-r", "border-color-l"],
|
|
922
|
+
"border-color-y": ["border-color-t", "border-color-b"],
|
|
923
|
+
"translate": [
|
|
924
|
+
"translate-x",
|
|
925
|
+
"translate-y",
|
|
926
|
+
"translate-none"
|
|
927
|
+
],
|
|
928
|
+
"translate-none": [
|
|
929
|
+
"translate",
|
|
930
|
+
"translate-x",
|
|
931
|
+
"translate-y",
|
|
932
|
+
"translate-z"
|
|
933
|
+
]
|
|
934
|
+
},
|
|
935
|
+
conflictingClassGroupModifiers: { "font-size": ["leading"] },
|
|
936
|
+
orderSensitiveModifiers: [
|
|
937
|
+
"*",
|
|
938
|
+
"**",
|
|
939
|
+
"after",
|
|
940
|
+
"backdrop",
|
|
941
|
+
"before",
|
|
942
|
+
"details-content",
|
|
943
|
+
"file",
|
|
944
|
+
"first-letter",
|
|
945
|
+
"first-line",
|
|
946
|
+
"marker",
|
|
947
|
+
"placeholder",
|
|
948
|
+
"selection"
|
|
949
|
+
]
|
|
950
|
+
};
|
|
951
|
+
}
|
|
952
|
+
//#endregion
|
|
953
|
+
//#region src/slim.ts
|
|
954
|
+
const rpxTransform = createRpxLengthTransform();
|
|
955
|
+
/**
|
|
956
|
+
* 基于 Slim_Config 的 `extendTailwindMerge`。
|
|
957
|
+
*
|
|
958
|
+
* 与上游 `extendTailwindMerge` 行为一致,但使用 `getSlimConfig` 替代 `getDefaultConfig` 作为基础配置。
|
|
959
|
+
*/
|
|
960
|
+
function _extendTailwindMerge(configExtension, ...createConfig) {
|
|
961
|
+
return typeof configExtension === "function" ? createTailwindMerge$1(getSlimConfig, configExtension, ...createConfig) : createTailwindMerge$1(() => mergeConfigs(getSlimConfig(), configExtension), ...createConfig);
|
|
962
|
+
}
|
|
963
|
+
const create = createRuntimeFactory({
|
|
964
|
+
createTailwindMerge: createTailwindMerge$1,
|
|
965
|
+
extendTailwindMerge: _extendTailwindMerge,
|
|
966
|
+
twJoin: twJoin$1,
|
|
967
|
+
twMerge: createTailwindMerge$1(getSlimConfig),
|
|
968
|
+
version: 3,
|
|
969
|
+
...rpxTransform
|
|
970
|
+
});
|
|
971
|
+
const { version: tailwindMergeVersion, twMerge, twJoin, extendTailwindMerge, createTailwindMerge } = create();
|
|
972
|
+
//#endregion
|
|
973
|
+
export { create, createTailwindMerge, extendTailwindMerge, getSlimConfig, mergeConfigs, tailwindMergeVersion, twJoin, twMerge, weappTwIgnore };
|