@unocss/preset-mini 0.44.4 → 0.45.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.
@@ -1,774 +1,297 @@
1
1
  'use strict';
2
2
 
3
3
  const colors = require('./colors2.cjs');
4
- const core = require('@unocss/core');
5
- const transform = require('./transform.cjs');
4
+ const decoration = require('./decoration.cjs');
5
+ require('./colors.cjs');
6
+ require('@unocss/core');
6
7
 
7
- const verticalAlignAlias = {
8
- "mid": "middle",
9
- "base": "baseline",
10
- "btm": "bottom",
11
- "baseline": "baseline",
12
- "top": "top",
13
- "middle": "middle",
14
- "bottom": "bottom",
15
- "text-top": "text-top",
16
- "text-bottom": "text-bottom",
17
- "sub": "sub",
18
- "super": "super",
19
- ...Object.fromEntries(colors.globalKeywords.map((x) => [x, x]))
8
+ const fontFamily = {
9
+ sans: [
10
+ "ui-sans-serif",
11
+ "system-ui",
12
+ "-apple-system",
13
+ "BlinkMacSystemFont",
14
+ '"Segoe UI"',
15
+ "Roboto",
16
+ '"Helvetica Neue"',
17
+ "Arial",
18
+ '"Noto Sans"',
19
+ "sans-serif",
20
+ '"Apple Color Emoji"',
21
+ '"Segoe UI Emoji"',
22
+ '"Segoe UI Symbol"',
23
+ '"Noto Color Emoji"'
24
+ ].join(","),
25
+ serif: [
26
+ "ui-serif",
27
+ "Georgia",
28
+ "Cambria",
29
+ '"Times New Roman"',
30
+ "Times",
31
+ "serif"
32
+ ].join(","),
33
+ mono: [
34
+ "ui-monospace",
35
+ "SFMono-Regular",
36
+ "Menlo",
37
+ "Monaco",
38
+ "Consolas",
39
+ '"Liberation Mono"',
40
+ '"Courier New"',
41
+ "monospace"
42
+ ].join(",")
20
43
  };
21
- const verticalAligns = [
22
- [/^(?:vertical|align|v)-([-\w]+)$/, ([, v]) => ({ "vertical-align": verticalAlignAlias[v] }), { autocomplete: `(vertical|align|v)-(${Object.keys(verticalAlignAlias).join("|")})` }]
23
- ];
24
- const textAligns = ["center", "left", "right", "justify", "start", "end", ...colors.globalKeywords].map((v) => [`text-${v}`, { "text-align": v }]);
25
-
26
- const outline = [
27
- [/^outline-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "outline-width": theme.lineWidth?.[d] ?? colors.handler.bracket.cssvar.global.px(d) }), { autocomplete: "outline-(width|size)-<num>" }],
28
- [/^outline-(?:color-)?(.+)$/, colors.colorResolver("outline-color", "outline-color"), { autocomplete: "outline-$colors" }],
29
- [/^outline-offset-(.+)$/, ([, d], { theme }) => ({ "outline-offset": theme.lineWidth?.[d] ?? colors.handler.bracket.cssvar.global.px(d) }), { autocomplete: "outline-(offset)-<num>" }],
30
- ["outline", { "outline-style": "solid" }],
31
- ...["auto", "dashed", "dotted", "double", "hidden", "solid", "groove", "ridge", "inset", "outset", ...colors.globalKeywords].map((v) => [`outline-${v}`, { "outline-style": v }]),
32
- ["outline-none", { "outline": "2px solid transparent", "outline-offset": "2px" }]
33
- ];
34
- const appearance = [
35
- ["appearance-none", {
36
- "appearance": "none",
37
- "-webkit-appearance": "none"
38
- }]
39
- ];
40
- const willChangeProperty = (prop) => {
41
- return colors.handler.properties.auto.global(prop) ?? {
42
- contents: "contents",
43
- scroll: "scroll-position"
44
- }[prop];
44
+ const fontSize = {
45
+ "xs": ["0.75rem", "1rem"],
46
+ "sm": ["0.875rem", "1.25rem"],
47
+ "base": ["1rem", "1.5rem"],
48
+ "lg": ["1.125rem", "1.75rem"],
49
+ "xl": ["1.25rem", "1.75rem"],
50
+ "2xl": ["1.5rem", "2rem"],
51
+ "3xl": ["1.875rem", "2.25rem"],
52
+ "4xl": ["2.25rem", "2.5rem"],
53
+ "5xl": ["3rem", "1"],
54
+ "6xl": ["3.75rem", "1"],
55
+ "7xl": ["4.5rem", "1"],
56
+ "8xl": ["6rem", "1"],
57
+ "9xl": ["8rem", "1"]
45
58
  };
46
- const willChange = [
47
- [/^will-change-(.+)/, ([, p]) => ({ "will-change": willChangeProperty(p) })]
48
- ];
49
-
50
- const borderStyles = ["solid", "dashed", "dotted", "double", "hidden", "none", "groove", "ridge", "inset", "outset", ...colors.globalKeywords];
51
- const borders = [
52
- [/^(?:border|b)()(?:-(.+))?$/, handlerBorder, { autocomplete: "(border|b)-<directions>" }],
53
- [/^(?:border|b)-([xy])(?:-(.+))?$/, handlerBorder],
54
- [/^(?:border|b)-([rltbse])(?:-(.+))?$/, handlerBorder],
55
- [/^(?:border|b)-(block|inline)(?:-(.+))?$/, handlerBorder],
56
- [/^(?:border|b)-([bi][se])(?:-(.+))?$/, handlerBorder],
57
- [/^(?:border|b)-()(?:width|size)-(.+)$/, handlerBorderSize, { autocomplete: ["(border|b)-<num>", "(border|b)-<directions>-<num>"] }],
58
- [/^(?:border|b)-([xy])-(?:width|size)-(.+)$/, handlerBorderSize],
59
- [/^(?:border|b)-([rltbse])-(?:width|size)-(.+)$/, handlerBorderSize],
60
- [/^(?:border|b)-(block|inline)-(?:width|size)-(.+)$/, handlerBorderSize],
61
- [/^(?:border|b)-([bi][se])-(?:width|size)-(.+)$/, handlerBorderSize],
62
- [/^(?:border|b)-()(?:color-)?(.+)$/, handlerBorderColor, { autocomplete: ["(border|b)-$colors", "(border|b)-<directions>-$colors"] }],
63
- [/^(?:border|b)-([xy])-(?:color-)?(.+)$/, handlerBorderColor],
64
- [/^(?:border|b)-([rltbse])-(?:color-)?(.+)$/, handlerBorderColor],
65
- [/^(?:border|b)-(block|inline)-(?:color-)?(.+)$/, handlerBorderColor],
66
- [/^(?:border|b)-([bi][se])-(?:color-)?(.+)$/, handlerBorderColor],
67
- [/^(?:border|b)-()op(?:acity)?-?(.+)$/, handlerBorderOpacity, { autocomplete: "(border|b)-(op|opacity)-<percent>" }],
68
- [/^(?:border|b)-([xy])-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
69
- [/^(?:border|b)-([rltbse])-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
70
- [/^(?:border|b)-(block|inline)-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
71
- [/^(?:border|b)-([bi][se])-op(?:acity)?-?(.+)$/, handlerBorderOpacity],
72
- [/^(?:border-|b-)?(?:rounded|rd)()(?:-(.+))?$/, handlerRounded, { autocomplete: ["(border|b)-(rounded|rd)", "(border|b)-(rounded|rd)-<num>", "(rounded|rd)", "(rounded|rd)-<num>"] }],
73
- [/^(?:border-|b-)?(?:rounded|rd)-([rltb])(?:-(.+))?$/, handlerRounded],
74
- [/^(?:border-|b-)?(?:rounded|rd)-([rltb]{2})(?:-(.+))?$/, handlerRounded],
75
- [/^(?:border-|b-)?(?:rounded|rd)-([bi][se])(?:-(.+))?$/, handlerRounded],
76
- [/^(?:border-|b-)?(?:rounded|rd)-([bi][se]-[bi][se])(?:-(.+))?$/, handlerRounded],
77
- [/^(?:border|b)-(?:style-)?()(.+)$/, handlerBorderStyle, { autocomplete: ["(border|b)-style", `(border|b)-(${borderStyles.join("|")})`, "(border|b)-<directions>-style", `(border|b)-<directions>-(${borderStyles.join("|")})`, `(border|b)-<directions>-style-(${borderStyles.join("|")})`, `(border|b)-style-(${borderStyles.join("|")})`] }],
78
- [/^(?:border|b)-([xy])-(?:style-)?(.+)$/, handlerBorderStyle],
79
- [/^(?:border|b)-([rltbse])-(?:style-)?(.+)$/, handlerBorderStyle],
80
- [/^(?:border|b)-(block|inline)-(?:style-)?(.+)$/, handlerBorderStyle],
81
- [/^(?:border|b)-([bi][se])-(?:style-)?(.+)$/, handlerBorderStyle]
82
- ];
83
- const borderColorResolver = (direction) => ([, body], theme) => {
84
- const data = colors.parseColor(body, theme);
85
- if (!data)
86
- return;
87
- const { alpha, color, cssColor } = data;
88
- if (cssColor) {
89
- if (alpha != null) {
90
- return {
91
- [`border${direction}-color`]: colors.colorToString(cssColor, alpha)
92
- };
93
- }
94
- if (direction === "") {
95
- return {
96
- "--un-border-opacity": colors.colorOpacityToString(cssColor),
97
- "border-color": colors.colorToString(cssColor, "var(--un-border-opacity)")
98
- };
99
- } else {
100
- return {
101
- "--un-border-opacity": colors.colorOpacityToString(cssColor),
102
- [`--un-border${direction}-opacity`]: "var(--un-border-opacity)",
103
- [`border${direction}-color`]: colors.colorToString(cssColor, `var(--un-border${direction}-opacity)`)
104
- };
105
- }
106
- } else if (color) {
107
- return {
108
- [`border${direction}-color`]: colors.colorToString(color, alpha)
109
- };
110
- }
59
+ const textIndent = {
60
+ "DEFAULT": "1.5rem",
61
+ "xs": "0.5rem",
62
+ "sm": "1rem",
63
+ "md": "1.5rem",
64
+ "lg": "2rem",
65
+ "xl": "2.5rem",
66
+ "2xl": "3rem",
67
+ "3xl": "4rem"
111
68
  };
112
- function handlerBorder(m, ctx) {
113
- const borderSizes = handlerBorderSize(m, ctx);
114
- const borderStyle = handlerBorderStyle(["", m[1], "solid"]);
115
- if (borderSizes && borderStyle) {
116
- return [
117
- ...borderSizes,
118
- ...borderStyle
119
- ];
120
- }
121
- }
122
- function handlerBorderSize([, a = "", b], { theme }) {
123
- const v = theme.lineWidth?.[b || "DEFAULT"] ?? colors.handler.bracket.cssvar.global.px(b || "1");
124
- if (a in colors.directionMap && v != null)
125
- return colors.directionMap[a].map((i) => [`border${i}-width`, v]);
126
- }
127
- function handlerBorderColor([, a = "", c], { theme }) {
128
- if (a in colors.directionMap && colors.hasParseableColor(c, theme)) {
129
- return Object.assign({}, ...colors.directionMap[a].map((i) => borderColorResolver(i)(["", c], theme)));
130
- }
131
- }
132
- function handlerBorderOpacity([, a = "", opacity]) {
133
- const v = colors.handler.bracket.percent(opacity);
134
- if (a in colors.directionMap && v != null)
135
- return colors.directionMap[a].map((i) => [`--un-border${i}-opacity`, v]);
136
- }
137
- function handlerRounded([, a = "", s], { theme }) {
138
- const v = theme.borderRadius?.[s || "DEFAULT"] || colors.handler.bracket.cssvar.global.fraction.rem(s || "1");
139
- if (a in colors.cornerMap && v != null)
140
- return colors.cornerMap[a].map((i) => [`border${i}-radius`, v]);
141
- }
142
- function handlerBorderStyle([, a = "", s]) {
143
- if (borderStyles.includes(s) && a in colors.directionMap)
144
- return colors.directionMap[a].map((i) => [`border${i}-style`, s]);
145
- }
146
-
147
- const opacity = [
148
- [/^op(?:acity)?-?(.+)$/, ([, d]) => ({ opacity: colors.handler.bracket.percent.cssvar(d) })]
149
- ];
150
- const textColors = [
151
- [/^(?:color|c)-(.+)$/, colors.colorResolver("color", "text"), { autocomplete: "(text|color|c)-$colors" }],
152
- [/^text-(.+)$/, colors.colorResolver("color", "text", (css) => !css.color?.toString().match(colors.numberWithUnitRE)), { autocomplete: "(text|color|c)-$colors" }],
153
- [/^(?:text|color|c)-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-text-opacity": colors.handler.bracket.percent(opacity2) }), { autocomplete: "(text|color|c)-(op|opacity)-<percent>" }]
154
- ];
155
- const bgColors = [
156
- [/^bg-(.+)$/, colors.colorResolver("background-color", "bg"), { autocomplete: "bg-$colors" }],
157
- [/^bg-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-bg-opacity": colors.handler.bracket.percent(opacity2) }), { autocomplete: "bg-(op|opacity)-<percent>" }]
158
- ];
159
-
160
- const transitionPropertyGroup = {
161
- all: "all",
162
- colors: ["color", "background-color", "border-color", "text-decoration-color", "fill", "stroke"].join(","),
163
- none: "none",
164
- opacity: "opacity",
165
- shadow: "box-shadow",
166
- transform: "transform"
69
+ const textStrokeWidth = {
70
+ DEFAULT: "1.5rem",
71
+ none: "0",
72
+ sm: "thin",
73
+ md: "medium",
74
+ lg: "thick"
167
75
  };
168
- const transitionProperty = (prop) => {
169
- return colors.handler.properties(prop) ?? transitionPropertyGroup[prop];
76
+ const textShadow = {
77
+ DEFAULT: ["0 0 1px rgba(0,0,0,0.2)", "0 0 1px rgba(1,0,5,0.1)"],
78
+ none: "0 0 rgba(0,0,0,0)",
79
+ sm: "1px 1px 3px rgba(36,37,47,0.25)",
80
+ md: ["0 1px 2px rgba(30,29,39,0.19)", "1px 2px 4px rgba(54,64,147,0.18)"],
81
+ lg: ["3px 3px 6px rgba(0,0,0,0.26)", "0 0 5px rgba(15,3,86,0.22)"],
82
+ xl: ["1px 1px 3px rgba(0,0,0,0.29)", "2px 4px 7px rgba(73,64,125,0.35)"]
170
83
  };
171
- const transitions = [
172
- [/^transition(?:-([a-z-]+(?:,[a-z-]+)*))?(?:-(\d+))?$/, ([, prop, d], { theme }) => {
173
- const p = prop != null ? transitionProperty(prop) : [transitionPropertyGroup.colors, "opacity", "box-shadow", "transform", "filter", "backdrop-filter"].join(",");
174
- if (p) {
175
- const duration = theme.duration?.[d || "DEFAULT"] ?? colors.handler.time(d || "150");
176
- return {
177
- "transition-property": p,
178
- "transition-timing-function": "cubic-bezier(0.4, 0, 0.2, 1)",
179
- "transition-duration": duration
180
- };
181
- }
182
- }, { autocomplete: `transition-(${Object.keys(transitionPropertyGroup).join("|")})` }],
183
- [
184
- /^(?:transition-)?duration-(.+)$/,
185
- ([, d], { theme }) => ({ "transition-duration": theme.duration?.[d || "DEFAULT"] ?? colors.handler.bracket.cssvar.time(d) }),
186
- { autocomplete: ["transition-duration-$duration", "duration-$duration"] }
187
- ],
188
- [
189
- /^(?:transition-)?delay-(.+)$/,
190
- ([, d], { theme }) => ({ "transition-delay": theme.duration?.[d || "DEFAULT"] ?? colors.handler.bracket.cssvar.time(d) }),
191
- { autocomplete: ["transition-delay-$duration", "delay-$duration"] }
192
- ],
193
- [
194
- /^(?:transition-)?ease(?:-(.+))?$/,
195
- ([, d], { theme }) => ({ "transition-timing-function": theme.easing?.[d || "DEFAULT"] ?? colors.handler.bracket.cssvar(d) }),
196
- { autocomplete: ["transition-ease-(linear|in|out|in-out|DEFAULT)", "ease-(linear|in|out|in-out|DEFAULT)"] }
197
- ],
198
- [
199
- /^(?:transition-)?property-(.+)$/,
200
- ([, v]) => ({ "transition-property": colors.handler.bracket.global(v) || transitionProperty(v) }),
201
- { autocomplete: [`transition-property-(${[...colors.globalKeywords, ...Object.keys(transitionPropertyGroup)].join("|")})`] }
202
- ],
203
- ["transition-none", { transition: "none" }],
204
- ...colors.makeGlobalStaticRules("transition")
205
- ];
206
-
207
- const flex = [
208
- ["flex", { display: "flex" }],
209
- ["inline-flex", { display: "inline-flex" }],
210
- ["flex-inline", { display: "inline-flex" }],
211
- [/^flex-(.*)$/, ([, d]) => ({ flex: colors.handler.bracket(d) != null ? colors.handler.bracket(d).split(" ").map((e) => colors.handler.cssvar.fraction(e) ?? e).join(" ") : colors.handler.cssvar.fraction(d) })],
212
- ["flex-1", { flex: "1 1 0%" }],
213
- ["flex-auto", { flex: "1 1 auto" }],
214
- ["flex-initial", { flex: "0 1 auto" }],
215
- ["flex-none", { flex: "none" }],
216
- [/^(?:flex-)?shrink(?:-(.*))?$/, ([, d = ""]) => ({ "flex-shrink": colors.handler.bracket.cssvar.number(d) ?? 1 }), { autocomplete: ["flex-shrink-<num>", "shrink-<num>"] }],
217
- [/^(?:flex-)?grow(?:-(.*))?$/, ([, d = ""]) => ({ "flex-grow": colors.handler.bracket.cssvar.number(d) ?? 1 }), { autocomplete: ["flex-grow-<num>", "grow-<num>"] }],
218
- [/^(?:flex-)?basis-(.+)$/, ([, d], { theme }) => ({ "flex-basis": theme.spacing?.[d] ?? colors.handler.bracket.cssvar.auto.fraction.rem(d) }), { autocomplete: ["flex-basis-$spacing", "basis-$spacing"] }],
219
- ["flex-row", { "flex-direction": "row" }],
220
- ["flex-row-reverse", { "flex-direction": "row-reverse" }],
221
- ["flex-col", { "flex-direction": "column" }],
222
- ["flex-col-reverse", { "flex-direction": "column-reverse" }],
223
- ["flex-wrap", { "flex-wrap": "wrap" }],
224
- ["flex-wrap-reverse", { "flex-wrap": "wrap-reverse" }],
225
- ["flex-nowrap", { "flex-wrap": "nowrap" }]
226
- ];
227
-
228
- const weightMap = {
229
- thin: "100",
230
- extralight: "200",
231
- light: "300",
232
- normal: "400",
233
- medium: "500",
234
- semibold: "600",
235
- bold: "700",
236
- extrabold: "800",
237
- black: "900"
84
+ const lineHeight = {
85
+ none: "1",
86
+ tight: "1.25",
87
+ snug: "1.375",
88
+ normal: "1.5",
89
+ relaxed: "1.625",
90
+ loose: "2"
238
91
  };
239
- const fonts = [
240
- [
241
- /^font-(.+)$/,
242
- ([, d], { theme }) => ({ "font-family": theme.fontFamily?.[d] || colors.handler.bracket.cssvar.global(d) }),
243
- { autocomplete: "font-$fontFamily" }
244
- ],
245
- [
246
- /^text-(.+)$/,
247
- ([, s = "base"], { theme }) => {
248
- const themed = core.toArray(theme.fontSize?.[s]);
249
- if (themed?.[0]) {
250
- const [size, height = "1"] = themed;
251
- return {
252
- "font-size": size,
253
- "line-height": height
254
- };
255
- }
256
- return { "font-size": colors.handler.bracketOfLength.rem(s) };
257
- },
258
- { autocomplete: "text-$fontSize" }
259
- ],
260
- [/^text-size-(.+)$/, ([, s], { theme }) => {
261
- const themed = core.toArray(theme.fontSize?.[s]);
262
- const size = themed?.[0] ?? colors.handler.bracket.cssvar.global.rem(s);
263
- if (size != null)
264
- return { "font-size": size };
265
- }, { autocomplete: "text-size-$fontSize" }],
266
- [
267
- /^(?:font|fw)-?([^-]+)$/,
268
- ([, s]) => ({ "font-weight": weightMap[s] || colors.handler.global.number(s) }),
269
- { autocomplete: `(font|fw)-(100|200|300|400|500|600|700|800|900|${Object.keys(weightMap).join("|")})` }
270
- ],
271
- [
272
- /^(?:font-)?(?:leading|lh)-(.+)$/,
273
- ([, s], { theme }) => ({ "line-height": theme.lineHeight?.[s] || colors.handler.bracket.cssvar.global.rem(s) }),
274
- { autocomplete: "(leading|lh)-$lineHeight" }
275
- ],
276
- ["font-synthesis-weight", { "font-synthesis": "weight" }],
277
- ["font-synthesis-style", { "font-synthesis": "style" }],
278
- ["font-synthesis-small-caps", { "font-synthesis": "small-caps" }],
279
- ["font-synthesis-none", { "font-synthesis": "none" }],
280
- [/^font-synthesis-(.+)$/, ([, s]) => ({ "font-synthesis": colors.handler.bracket.cssvar.global(s) })],
281
- [
282
- /^(?:font-)?tracking-(.+)$/,
283
- ([, s], { theme }) => ({ "letter-spacing": theme.letterSpacing?.[s] || colors.handler.bracket.cssvar.global.rem(s) }),
284
- { autocomplete: "tracking-$letterSpacing" }
285
- ],
286
- [
287
- /^(?:font-)?word-spacing-(.+)$/,
288
- ([, s], { theme }) => ({ "word-spacing": theme.wordSpacing?.[s] || colors.handler.bracket.cssvar.global.rem(s) }),
289
- { autocomplete: "word-spacing-$wordSpacing" }
290
- ]
291
- ];
292
- const tabSizes = [
293
- [/^tab(?:-(.+))?$/, ([, s]) => {
294
- const v = colors.handler.bracket.cssvar.global.number(s || "4");
295
- if (v != null) {
296
- return {
297
- "-moz-tab-size": v,
298
- "-o-tab-size": v,
299
- "tab-size": v
300
- };
301
- }
302
- }]
303
- ];
304
- const textIndents = [
305
- [/^indent(?:-(.+))?$/, ([, s], { theme }) => ({ "text-indent": theme.textIndent?.[s || "DEFAULT"] || colors.handler.bracket.cssvar.global.fraction.rem(s) }), { autocomplete: "indent-$textIndent" }]
306
- ];
307
- const textStrokes = [
308
- [/^text-stroke(?:-(.+))?$/, ([, s], { theme }) => ({ "-webkit-text-stroke-width": theme.textStrokeWidth?.[s || "DEFAULT"] || colors.handler.bracket.cssvar.px(s) }), { autocomplete: "text-stroke-$textStrokeWidth" }],
309
- [/^text-stroke-(.+)$/, colors.colorResolver("-webkit-text-stroke-color", "text-stroke"), { autocomplete: "text-stroke-$colors" }],
310
- [/^text-stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-stroke-opacity": colors.handler.bracket.percent(opacity) }), { autocomplete: "text-stroke-(op|opacity)-<percent>" }]
311
- ];
312
- const textShadows = [
313
- [/^text-shadow(?:-(.+))?$/, ([, s], { theme }) => {
314
- const v = theme.textShadow?.[s || "DEFAULT"];
315
- if (v != null) {
316
- return {
317
- "--un-text-shadow": colors.colorableShadows(v, "--un-text-shadow-color").join(","),
318
- "text-shadow": "var(--un-text-shadow)"
319
- };
320
- }
321
- return { "text-shadow": colors.handler.bracket.cssvar.global(s) };
322
- }, { autocomplete: "text-shadow-$textShadow" }],
323
- [/^text-shadow-color-(.+)$/, colors.colorResolver("--un-text-shadow-color", "text-shadow"), { autocomplete: "text-shadow-color-$colors" }],
324
- [/^text-shadow-color-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-shadow-opacity": colors.handler.bracket.percent(opacity) }), { autocomplete: "text-shadow-color-(op|opacity)-<percent>" }]
325
- ];
92
+ const letterSpacing = {
93
+ tighter: "-0.05em",
94
+ tight: "-0.025em",
95
+ normal: "0em",
96
+ wide: "0.025em",
97
+ wider: "0.05em",
98
+ widest: "0.1em"
99
+ };
100
+ const wordSpacing = letterSpacing;
326
101
 
327
- const directions = {
328
- "": "",
329
- "x": "column-",
330
- "y": "row-"
102
+ const breakpoints = {
103
+ "sm": "640px",
104
+ "md": "768px",
105
+ "lg": "1024px",
106
+ "xl": "1280px",
107
+ "2xl": "1536px"
331
108
  };
332
- const handleGap = ([, d = "", s], { theme }) => {
333
- const v = theme.spacing?.[s] ?? colors.handler.bracket.cssvar.global.rem(s);
334
- if (v != null) {
335
- return {
336
- [`grid-${directions[d]}gap`]: v,
337
- [`${directions[d]}gap`]: v
338
- };
339
- }
109
+ const verticalBreakpoints = { ...breakpoints };
110
+ const lineWidth = {
111
+ DEFAULT: "1px",
112
+ none: "0px"
340
113
  };
341
- const gaps = [
342
- [/^(?:flex-|grid-)?gap-?()(.+)$/, handleGap, { autocomplete: ["gap-$spacing", "gap-<num>"] }],
343
- [/^(?:flex-|grid-)?gap-([xy])-?(.+)$/, handleGap, { autocomplete: ["gap-(x|y)-$spacing", "gap-(x|y)-<num>"] }]
344
- ];
345
-
346
- const rowCol = (s) => s.replace("col", "column");
347
- const rowColTheme = (s) => s[0] === "r" ? "Row" : "Column";
348
- const autoDirection = (c, theme, prop) => {
349
- const v = theme[`gridAuto${rowColTheme(c)}`]?.[prop];
350
- if (v != null)
351
- return v;
352
- switch (prop) {
353
- case "min":
354
- return "min-content";
355
- case "max":
356
- return "max-content";
357
- case "fr":
358
- return "minmax(0,1fr)";
359
- }
360
- return colors.handler.bracket.cssvar.auto.rem(prop);
114
+ const spacing = {
115
+ "DEFAULT": "1rem",
116
+ "none": "0rem",
117
+ "xs": "0.75rem",
118
+ "sm": "0.875rem",
119
+ "lg": "1.125rem",
120
+ "xl": "1.25rem",
121
+ "2xl": "1.5rem",
122
+ "3xl": "1.875rem",
123
+ "4xl": "2.25rem",
124
+ "5xl": "3rem",
125
+ "6xl": "3.75rem",
126
+ "7xl": "4.5rem",
127
+ "8xl": "6rem",
128
+ "9xl": "8rem"
361
129
  };
362
- const grids = [
363
- ["grid", { display: "grid" }],
364
- ["inline-grid", { display: "inline-grid" }],
365
- [/^(?:grid-)?(row|col)-(.+)$/, ([, c, v], { theme }) => ({
366
- [`grid-${rowCol(c)}`]: theme[`grid${rowColTheme(c)}`]?.[v] ?? colors.handler.bracket.cssvar.auto(v)
367
- })],
368
- [/^(?:grid-)?(row|col)-span-(.+)$/, ([, c, s]) => {
369
- if (s === "full")
370
- return { [`grid-${rowCol(c)}`]: "1/-1" };
371
- const v = colors.handler.bracket.number(s);
372
- if (v != null)
373
- return { [`grid-${rowCol(c)}`]: `span ${v}/span ${v}` };
374
- }, { autocomplete: ["grid-(row|col)-span-<num>", "(row|col)-span-<num>"] }],
375
- [/^(?:grid-)?(row|col)-start-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-start`]: colors.handler.bracket.cssvar(v) ?? v })],
376
- [/^(?:grid-)?(row|col)-end-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-end`]: colors.handler.bracket.cssvar(v) ?? v }), { autocomplete: ["grid-(row|col)-(start|end)-<num>"] }],
377
- [/^(?:grid-)?auto-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({ [`grid-auto-${rowCol(c)}`]: autoDirection(c, theme, v) }), { autocomplete: ["grid-auto-(rows|cols)-<num>"] }],
378
- [/^(?:grid-auto-flow|auto-flow|grid-flow)-(.+)$/, ([, v]) => ({ "grid-auto-flow": colors.handler.bracket.cssvar(v) })],
379
- [/^(?:grid-auto-flow|auto-flow|grid-flow)-(row|col|dense|row-dense|col-dense)$/, ([, v]) => ({ "grid-auto-flow": rowCol(v).replace("-", " ") }), { autocomplete: ["(grid-auto-flow|auto-flow|grid-flow)-(row|col|dense|row-dense|col-dense)"] }],
380
- [/^grid-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({
381
- [`grid-template-${rowCol(c)}`]: theme[`gridTemplate${rowColTheme(c)}`]?.[v] ?? colors.handler.bracket.cssvar(v)
382
- })],
383
- [/^grid-(rows|cols)-minmax-([\w.-]+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(auto-fill,minmax(${d},1fr))` })],
384
- [/^grid-(rows|cols)-(\d+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(${d},minmax(0,1fr))` }), { autocomplete: ["grid-(rows|cols)-<num>", "grid-(rows|cols)-none"] }],
385
- ["grid-rows-none", { "grid-template-rows": "none" }],
386
- ["grid-cols-none", { "grid-template-columns": "none" }]
387
- ];
388
-
389
- const overflowValues = [
390
- "auto",
391
- "hidden",
392
- "clip",
393
- "visible",
394
- "scroll",
395
- ...colors.globalKeywords
396
- ];
397
- const overflows = [
398
- [/^(?:overflow|of)-(.+)$/, ([, v]) => overflowValues.includes(v) ? { overflow: v } : void 0, { autocomplete: [`(overflow|of)-(${overflowValues.join("|")})`, `(overflow|of)-(x|y)-(${overflowValues.join("|")})`] }],
399
- [/^(?:overflow|of)-([xy])-(.+)$/, ([, d, v]) => overflowValues.includes(v) ? { [`overflow-${d}`]: v } : void 0]
400
- ];
401
-
402
- const positions = [
403
- [/^(?:position-|pos-)?(relative|absolute|fixed|sticky)$/, ([, v]) => ({ position: v })],
404
- [/^(?:position-|pos-)([-\w]+)$/, ([, v]) => colors.globalKeywords.includes(v) ? { position: v } : void 0],
405
- [/^(?:position-|pos-)?(static)$/, ([, v]) => ({ position: v })]
406
- ];
407
- const justifies = [
408
- ["justify-start", { "justify-content": "flex-start" }],
409
- ["justify-end", { "justify-content": "flex-end" }],
410
- ["justify-center", { "justify-content": "center" }],
411
- ["justify-between", { "justify-content": "space-between" }],
412
- ["justify-around", { "justify-content": "space-around" }],
413
- ["justify-evenly", { "justify-content": "space-evenly" }],
414
- ...colors.makeGlobalStaticRules("justify", "justify-content"),
415
- ["justify-items-start", { "justify-items": "start" }],
416
- ["justify-items-end", { "justify-items": "end" }],
417
- ["justify-items-center", { "justify-items": "center" }],
418
- ["justify-items-stretch", { "justify-items": "stretch" }],
419
- ...colors.makeGlobalStaticRules("justify-items"),
420
- ["justify-self-auto", { "justify-self": "auto" }],
421
- ["justify-self-start", { "justify-self": "start" }],
422
- ["justify-self-end", { "justify-self": "end" }],
423
- ["justify-self-center", { "justify-self": "center" }],
424
- ["justify-self-stretch", { "justify-self": "stretch" }],
425
- ...colors.makeGlobalStaticRules("justify-self")
426
- ];
427
- const orders = [
428
- [/^order-(.+)$/, ([, v]) => ({ order: colors.handler.bracket.cssvar.number(v) })],
429
- ["order-first", { order: "-9999" }],
430
- ["order-last", { order: "9999" }],
431
- ["order-none", { order: "0" }]
432
- ];
433
- const alignments = [
434
- ["content-center", { "align-content": "center" }],
435
- ["content-start", { "align-content": "flex-start" }],
436
- ["content-end", { "align-content": "flex-end" }],
437
- ["content-between", { "align-content": "space-between" }],
438
- ["content-around", { "align-content": "space-around" }],
439
- ["content-evenly", { "align-content": "space-evenly" }],
440
- ...colors.makeGlobalStaticRules("content", "align-content"),
441
- ["items-start", { "align-items": "flex-start" }],
442
- ["items-end", { "align-items": "flex-end" }],
443
- ["items-center", { "align-items": "center" }],
444
- ["items-baseline", { "align-items": "baseline" }],
445
- ["items-stretch", { "align-items": "stretch" }],
446
- ...colors.makeGlobalStaticRules("items", "align-items"),
447
- ["self-auto", { "align-self": "auto" }],
448
- ["self-start", { "align-self": "flex-start" }],
449
- ["self-end", { "align-self": "flex-end" }],
450
- ["self-center", { "align-self": "center" }],
451
- ["self-stretch", { "align-self": "stretch" }],
452
- ["self-baseline", { "align-self": "baseline" }],
453
- ...colors.makeGlobalStaticRules("self", "align-self")
454
- ];
455
- const placements = [
456
- ["place-content-center", { "place-content": "center" }],
457
- ["place-content-start", { "place-content": "start" }],
458
- ["place-content-end", { "place-content": "end" }],
459
- ["place-content-between", { "place-content": "space-between" }],
460
- ["place-content-around", { "place-content": "space-around" }],
461
- ["place-content-evenly", { "place-content": "space-evenly" }],
462
- ["place-content-stretch", { "place-content": "stretch" }],
463
- ...colors.makeGlobalStaticRules("place-content"),
464
- ["place-items-start", { "place-items": "start" }],
465
- ["place-items-end", { "place-items": "end" }],
466
- ["place-items-center", { "place-items": "center" }],
467
- ["place-items-stretch", { "place-items": "stretch" }],
468
- ...colors.makeGlobalStaticRules("place-items"),
469
- ["place-self-auto", { "place-self": "auto" }],
470
- ["place-self-start", { "place-self": "start" }],
471
- ["place-self-end", { "place-self": "end" }],
472
- ["place-self-center", { "place-self": "center" }],
473
- ["place-self-stretch", { "place-self": "stretch" }],
474
- ...colors.makeGlobalStaticRules("place-self")
475
- ];
476
- function handleInsetValue(v, { theme }) {
477
- return theme.spacing?.[v] ?? colors.handler.bracket.cssvar.global.auto.fraction.rem(v);
478
- }
479
- function handleInsetValues([, d, v], ctx) {
480
- const r = handleInsetValue(v, ctx);
481
- if (r != null && d in colors.insetMap)
482
- return colors.insetMap[d].map((i) => [i.slice(1), r]);
483
- }
484
- const insets = [
485
- [
486
- /^(?:position-|pos-)?inset-(.+)$/,
487
- ([, v], ctx) => ({ inset: handleInsetValue(v, ctx) }),
488
- {
489
- autocomplete: [
490
- "(position|pos)-inset-<directions>-$spacing",
491
- "(position|pos)-inset-(block|inline)-$spacing",
492
- "(position|pos)-inset-(bs|be|is|ie)-$spacing",
493
- "(position|pos)-(top|left|right|bottom)-$spacing"
494
- ]
495
- }
496
- ],
497
- [/^(?:position-|pos-)?inset-([xy])-(.+)$/, handleInsetValues],
498
- [/^(?:position-|pos-)?inset-([rltbse])-(.+)$/, handleInsetValues],
499
- [/^(?:position-|pos-)?inset-(block|inline)-(.+)$/, handleInsetValues],
500
- [/^(?:position-|pos-)?inset-([bi][se])-(.+)$/, handleInsetValues],
501
- [/^(?:position-|pos-)?(top|left|right|bottom)-(.+)$/, ([, d, v], ctx) => ({ [d]: handleInsetValue(v, ctx) })]
502
- ];
503
- const floats = [
504
- ["float-left", { float: "left" }],
505
- ["float-right", { float: "right" }],
506
- ["float-none", { float: "none" }],
507
- ...colors.makeGlobalStaticRules("float"),
508
- ["clear-left", { clear: "left" }],
509
- ["clear-right", { clear: "right" }],
510
- ["clear-both", { clear: "both" }],
511
- ["clear-none", { clear: "none" }],
512
- ...colors.makeGlobalStaticRules("clear")
513
- ];
514
- const zIndexes = [
515
- [/^z([\d.]+)$/, ([, v]) => ({ "z-index": colors.handler.number(v) })],
516
- [/^z-(.+)$/, ([, v]) => ({ "z-index": colors.handler.bracket.cssvar.global.auto.number(v) }), { autocomplete: "z-<num>" }]
517
- ];
518
- const boxSizing = [
519
- ["box-border", { "box-sizing": "border-box" }],
520
- ["box-content", { "box-sizing": "content-box" }],
521
- ...colors.makeGlobalStaticRules("box", "box-sizing")
522
- ];
523
-
524
- const sizeMapping = {
525
- h: "height",
526
- w: "width",
527
- inline: "inline-size",
528
- block: "block-size"
130
+ const duration = {
131
+ DEFAULT: "150ms",
132
+ none: "0ms",
133
+ 75: "75ms",
134
+ 100: "100ms",
135
+ 150: "150ms",
136
+ 200: "200ms",
137
+ 300: "300ms",
138
+ 500: "500ms",
139
+ 700: "700ms",
140
+ 1e3: "1000ms"
529
141
  };
530
- function getPropName(minmax, hw) {
531
- return `${minmax || ""}${sizeMapping[hw]}`;
532
- }
533
- function getSizeValue(minmax, hw, theme, prop) {
534
- const str = getPropName(minmax, hw).replace(/-(\w)/g, (_, p) => p.toUpperCase());
535
- const v = theme[str]?.[prop];
536
- if (v != null)
537
- return v;
538
- switch (prop) {
539
- case "fit":
540
- case "max":
541
- case "min":
542
- return `${prop}-content`;
543
- }
544
- return colors.handler.bracket.cssvar.global.auto.fraction.rem(prop);
545
- }
546
- const sizes = [
547
- [/^(min-|max-)?([wh])-?(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: getSizeValue(m, w, theme, s) })],
548
- [/^(min-|max-)?(block|inline)-(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: getSizeValue(m, w, theme, s) }), {
549
- autocomplete: [
550
- "(w|h)-$width|height|maxWidth|maxHeight|minWidth|minHeight|inlineSize|blockSize|maxInlineSize|maxBlockSize|minInlineSize|minBlockSize",
551
- "(block|inline)-$width|height|maxWidth|maxHeight|minWidth|minHeight|inlineSize|blockSize|maxInlineSize|maxBlockSize|minInlineSize|minBlockSize",
552
- "(max|min)-(w|h|block|inline)",
553
- "(max|min)-(w|h|block|inline)-$width|height|maxWidth|maxHeight|minWidth|minHeight|inlineSize|blockSize|maxInlineSize|maxBlockSize|minInlineSize|minBlockSize"
554
- ]
555
- }],
556
- [/^(min-|max-)?(h)-screen-(.+)$/, ([, m, w, s], context) => ({ [getPropName(m, w)]: colors.resolveVerticalBreakpoints(context)?.[s] })],
557
- [/^(min-|max-)?(w)-screen-(.+)$/, ([, m, w, s], context) => ({ [getPropName(m, w)]: colors.resolveBreakpoints(context)?.[s] }), {
558
- autocomplete: [
559
- "(w|h)-screen",
560
- "(min|max)-(w|h)-screen",
561
- "h-screen-$verticalBreakpoints",
562
- "(min|max)-h-screen-$verticalBreakpoints",
563
- "w-screen-$breakpoints",
564
- "(min|max)-w-screen-$breakpoints"
565
- ]
566
- }]
567
- ];
568
- function getAspectRatio(prop) {
569
- if (/^\d+\/\d+$/.test(prop))
570
- return prop;
571
- switch (prop) {
572
- case "square":
573
- return "1/1";
574
- case "video":
575
- return "16/9";
576
- }
577
- return colors.handler.bracket.cssvar.global.auto.number(prop);
578
- }
579
- const aspectRatio = [
580
- [/^aspect-(?:ratio-)?(.+)$/, ([, d]) => ({ "aspect-ratio": getAspectRatio(d) }), { autocomplete: ["aspect-(square|video|ratio)", "aspect-ratio-(square|video)"] }]
581
- ];
582
-
583
- const paddings = [
584
- [/^pa?()-?(-?.+)$/, colors.directionSize("padding"), { autocomplete: ["(m|p)<num>", "(m|p)-<num>"] }],
585
- [/^p-?xy()()$/, colors.directionSize("padding"), { autocomplete: "(m|p)-(xy)" }],
586
- [/^p-?([xy])(?:-?(-?.+))?$/, colors.directionSize("padding")],
587
- [/^p-?([rltbse])(?:-?(-?.+))?$/, colors.directionSize("padding"), { autocomplete: "(m|p)<directions>-<num>" }],
588
- [/^p-(block|inline)(?:-(-?.+))?$/, colors.directionSize("padding"), { autocomplete: "(m|p)-(block|inline)-<num>" }],
589
- [/^p-?([bi][se])(?:-?(-?.+))?$/, colors.directionSize("padding"), { autocomplete: "(m|p)-(bs|be|is|ie)-<num>" }]
590
- ];
591
- const margins = [
592
- [/^ma?()-?(-?.+)$/, colors.directionSize("margin")],
593
- [/^m-?xy()()$/, colors.directionSize("margin")],
594
- [/^m-?([xy])(?:-?(-?.+))?$/, colors.directionSize("margin")],
595
- [/^m-?([rltbse])(?:-?(-?.+))?$/, colors.directionSize("margin")],
596
- [/^m-(block|inline)(?:-(-?.+))?$/, colors.directionSize("margin")],
597
- [/^m-?([bi][se])(?:-?(-?.+))?$/, colors.directionSize("margin")]
598
- ];
599
-
600
- const variablesAbbrMap = {
601
- backface: "backface-visibility",
602
- break: "word-break",
603
- case: "text-transform",
604
- content: "align-content",
605
- fw: "font-weight",
606
- items: "align-items",
607
- justify: "justify-content",
608
- select: "user-select",
609
- self: "align-self",
610
- vertical: "vertical-align",
611
- visible: "visibility",
612
- whitespace: "white-space",
613
- ws: "white-space"
142
+ const borderRadius = {
143
+ "DEFAULT": "0.25rem",
144
+ "none": "0rem",
145
+ "sm": "0.125rem",
146
+ "md": "0.375rem",
147
+ "lg": "0.5rem",
148
+ "xl": "0.75rem",
149
+ "2xl": "1rem",
150
+ "3xl": "1.5rem",
151
+ "full": "9999px"
152
+ };
153
+ const boxShadow = {
154
+ "DEFAULT": ["var(--un-shadow-inset) 0 1px 3px 0 rgba(0,0,0,0.1)", "var(--un-shadow-inset) 0 1px 2px -1px rgba(0,0,0,0.1)"],
155
+ "none": "0 0 rgba(0,0,0,0)",
156
+ "sm": "var(--un-shadow-inset) 0 1px 2px 0 rgba(0,0,0,0.05)",
157
+ "md": ["var(--un-shadow-inset) 0 4px 6px -1px rgba(0,0,0,0.1)", "var(--un-shadow-inset) 0 2px 4px -2px rgba(0,0,0,0.1)"],
158
+ "lg": ["var(--un-shadow-inset) 0 10px 15px -3px rgba(0,0,0,0.1)", "var(--un-shadow-inset) 0 4px 6px -4px rgba(0,0,0,0.1)"],
159
+ "xl": ["var(--un-shadow-inset) 0 20px 25px -5px rgba(0,0,0,0.1)", "var(--un-shadow-inset) 0 8px 10px -6px rgba(0,0,0,0.1)"],
160
+ "2xl": "var(--un-shadow-inset) 0 25px 50px -12px rgba(0,0,0,0.25)",
161
+ "inner": "inset 0 2px 4px 0 rgba(0,0,0,0.05)"
162
+ };
163
+ const easing = {
164
+ "DEFAULT": "cubic-bezier(0.4, 0, 0.2, 1)",
165
+ "linear": "linear",
166
+ "in": "cubic-bezier(0.4, 0, 1, 1)",
167
+ "out": "cubic-bezier(0, 0, 0.2, 1)",
168
+ "in-out": "cubic-bezier(0.4, 0, 0.2, 1)"
169
+ };
170
+ const ringWidth = {
171
+ DEFAULT: "1px",
172
+ none: "0px"
614
173
  };
615
- const cssVariables = [
616
- [/^(.+?)-(\$.+)$/, ([, name, varname]) => {
617
- const prop = variablesAbbrMap[name];
618
- if (prop)
619
- return { [prop]: colors.handler.cssvar(varname) };
620
- }]
621
- ];
622
- const cssProperty = [
623
- [/^\[([\w_-]+):([^'"]+)\]$/, ([, prop, value]) => ({ [prop]: colors.handler.bracket(`[${value}]`) })]
624
- ];
625
174
 
626
- const questionMark = [
627
- [
628
- /^(where|\?)$/,
629
- (_, { constructCSS, generator }) => {
630
- if (generator.userConfig.envMode === "dev")
631
- return `@keyframes __un_qm{0%{box-shadow:inset 4px 4px #ff1e90, inset -4px -4px #ff1e90}100%{box-shadow:inset 8px 8px #3399ff, inset -8px -8px #3399ff}}
632
- ${constructCSS({ animation: "__un_qm 0.5s ease-in-out alternate infinite" })}`;
633
- }
634
- ]
635
- ];
175
+ const blur = {
176
+ "DEFAULT": "8px",
177
+ "0": "0",
178
+ "sm": "4px",
179
+ "md": "12px",
180
+ "lg": "16px",
181
+ "xl": "24px",
182
+ "2xl": "40px",
183
+ "3xl": "64px"
184
+ };
185
+ const dropShadow = {
186
+ "DEFAULT": ["0 1px 2px rgba(0,0,0,0.1)", "0 1px 1px rgba(0,0,0,0.06)"],
187
+ "sm": "0 1px 1px rgba(0,0,0,0.05)",
188
+ "md": ["0 4px 3px rgba(0,0,0,0.07)", "0 2px 2px rgba(0,0,0,0.06)"],
189
+ "lg": ["0 10px 8px rgba(0,0,0,0.04)", "0 4px 3px rgba(0,0,0,0.1)"],
190
+ "xl": ["0 20px 13px rgba(0,0,0,0.03)", "0 8px 5px rgba(0,0,0,0.08)"],
191
+ "2xl": "0 25px 25px rgba(0,0,0,0.15)",
192
+ "none": "0 0 rgba(0,0,0,0)"
193
+ };
636
194
 
637
- const decorationStyles = ["solid", "double", "dotted", "dashed", "wavy", ...colors.globalKeywords];
638
- const textDecorations = [
639
- [/^(?:decoration-)?(underline|overline|line-through)$/, ([, s]) => ({ "text-decoration-line": s }), { autocomplete: "decoration-(underline|overline|line-through)" }],
640
- [/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s], { theme }) => ({ "text-decoration-thickness": theme.lineWidth?.[s] ?? colors.handler.bracket.cssvar.global.px(s) }), { autocomplete: "(underline|decoration)-<num>" }],
641
- [/^(?:underline|decoration)-(auto|from-font)$/, ([, s]) => ({ "text-decoration-thickness": s }), { autocomplete: "(underline|decoration)-(auto|from-font)" }],
642
- [/^(?:underline|decoration)-(.+)$/, (match, ctx) => {
643
- const result = colors.colorResolver("text-decoration-color", "line")(match, ctx);
644
- if (result) {
645
- return {
646
- "-webkit-text-decoration-color": result["text-decoration-color"],
647
- ...result
648
- };
649
- }
650
- }, { autocomplete: "(underline|decoration)-$colors" }],
651
- [/^(?:underline|decoration)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-line-opacity": colors.handler.bracket.percent(opacity) }), { autocomplete: "(underline|decoration)-(op|opacity)-<percent>" }],
652
- [/^(?:underline|decoration)-offset-(.+)$/, ([, s], { theme }) => ({ "text-underline-offset": theme.lineWidth?.[s] ?? colors.handler.auto.bracket.cssvar.global.px(s) }), { autocomplete: "(underline|decoration)-(offset)-<num>" }],
653
- ...decorationStyles.map((v) => [`underline-${v}`, { "text-decoration-style": v }]),
654
- ...decorationStyles.map((v) => [`decoration-${v}`, { "text-decoration-style": v }]),
655
- ["no-underline", { "text-decoration": "none" }],
656
- ["decoration-none", { "text-decoration": "none" }]
657
- ];
195
+ const baseSize = {
196
+ "xs": "20rem",
197
+ "sm": "24rem",
198
+ "md": "28rem",
199
+ "lg": "32rem",
200
+ "xl": "36rem",
201
+ "2xl": "42rem",
202
+ "3xl": "48rem",
203
+ "4xl": "56rem",
204
+ "5xl": "64rem",
205
+ "6xl": "72rem",
206
+ "7xl": "80rem",
207
+ "prose": "65ch"
208
+ };
209
+ const width = {
210
+ auto: "auto",
211
+ ...baseSize,
212
+ screen: "100vw"
213
+ };
214
+ const maxWidth = {
215
+ none: "none",
216
+ ...baseSize,
217
+ screen: "100vw"
218
+ };
219
+ const height = {
220
+ auto: "auto",
221
+ ...baseSize,
222
+ screen: "100vh"
223
+ };
224
+ const maxHeight = {
225
+ none: "none",
226
+ ...baseSize,
227
+ screen: "100vh"
228
+ };
658
229
 
659
- const svgUtilities = [
660
- [/^fill-(.+)$/, colors.colorResolver("fill", "fill"), { autocomplete: "fill-$colors" }],
661
- [/^fill-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-fill-opacity": colors.handler.bracket.percent(opacity) }), { autocomplete: "fill-(op|opacity)-<percent>" }],
662
- ["fill-none", { fill: "none" }],
663
- [/^stroke-(?:width-|size-)?(.+)$/, ([, s], { theme }) => ({ "stroke-width": theme.lineWidth?.[s] ?? colors.handler.bracket.cssvar.fraction.px.number(s) }), { autocomplete: ["stroke-width-$lineWidth", "stroke-size-$lineWidth"] }],
664
- [/^stroke-dash-(.+)$/, ([, s]) => ({ "stroke-dasharray": colors.handler.bracket.cssvar.number(s) }), { autocomplete: "stroke-dash-<num>" }],
665
- [/^stroke-offset-(.+)$/, ([, s], { theme }) => ({ "stroke-dashoffset": theme.lineWidth?.[s] ?? colors.handler.bracket.cssvar.px.numberWithUnit(s) }), { autocomplete: "stroke-offset-$lineWidth" }],
666
- [/^stroke-(.+)$/, colors.colorResolver("stroke", "stroke"), { autocomplete: "stroke-$colors" }],
667
- [/^stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-stroke-opacity": colors.handler.bracket.percent(opacity) }), { autocomplete: "stroke-(op|opacity)-<percent>" }],
668
- ["stroke-cap-square", { "stroke-linecap": "square" }],
669
- ["stroke-cap-round", { "stroke-linecap": "round" }],
670
- ["stroke-cap-auto", { "stroke-linecap": "butt" }],
671
- ["stroke-join-arcs", { "stroke-linejoin": "arcs" }],
672
- ["stroke-join-bevel", { "stroke-linejoin": "bevel" }],
673
- ["stroke-join-clip", { "stroke-linejoin": "miter-clip" }],
674
- ["stroke-join-round", { "stroke-linejoin": "round" }],
675
- ["stroke-join-auto", { "stroke-linejoin": "miter" }],
676
- ["stroke-none", { stroke: "none" }]
677
- ];
230
+ const preflightBase = {
231
+ ...decoration.transformBase,
232
+ ...decoration.boxShadowsBase,
233
+ ...decoration.ringBase
234
+ };
678
235
 
679
- const rules = [
680
- cssVariables,
681
- cssProperty,
682
- paddings,
683
- margins,
684
- transform.displays,
685
- opacity,
686
- bgColors,
687
- svgUtilities,
688
- borders,
689
- transform.contents,
690
- fonts,
691
- tabSizes,
692
- textIndents,
693
- transform.textOverflows,
694
- textDecorations,
695
- textStrokes,
696
- textShadows,
697
- transform.textTransforms,
698
- textAligns,
699
- textColors,
700
- transform.fontStyles,
701
- transform.fontSmoothings,
702
- transform.boxShadows,
703
- transform.rings,
704
- flex,
705
- grids,
706
- gaps,
707
- positions,
708
- sizes,
709
- aspectRatio,
710
- transform.cursors,
711
- transform.appearances,
712
- transform.pointerEvents,
713
- transform.resizes,
714
- verticalAligns,
715
- transform.userSelects,
716
- transform.whitespaces,
717
- transform.breaks,
718
- overflows,
719
- outline,
720
- appearance,
721
- orders,
722
- justifies,
723
- alignments,
724
- placements,
725
- insets,
726
- floats,
727
- zIndexes,
728
- boxSizing,
729
- transitions,
730
- transform.transforms,
731
- willChange,
732
- questionMark
733
- ].flat(1);
236
+ const theme = {
237
+ width,
238
+ height,
239
+ maxWidth,
240
+ maxHeight,
241
+ minWidth: maxWidth,
242
+ minHeight: maxHeight,
243
+ inlineSize: width,
244
+ blockSize: height,
245
+ maxInlineSize: maxWidth,
246
+ maxBlockSize: maxHeight,
247
+ minInlineSize: maxWidth,
248
+ minBlockSize: maxHeight,
249
+ colors: colors.colors,
250
+ fontFamily,
251
+ fontSize,
252
+ breakpoints,
253
+ verticalBreakpoints,
254
+ borderRadius,
255
+ lineHeight,
256
+ letterSpacing,
257
+ wordSpacing,
258
+ boxShadow,
259
+ textIndent,
260
+ textShadow,
261
+ textStrokeWidth,
262
+ blur,
263
+ dropShadow,
264
+ easing,
265
+ lineWidth,
266
+ spacing,
267
+ duration,
268
+ ringWidth,
269
+ preflightBase
270
+ };
734
271
 
735
- exports.alignments = alignments;
736
- exports.appearance = appearance;
737
- exports.aspectRatio = aspectRatio;
738
- exports.bgColors = bgColors;
739
- exports.borderStyles = borderStyles;
740
- exports.borders = borders;
741
- exports.boxSizing = boxSizing;
742
- exports.cssProperty = cssProperty;
743
- exports.cssVariables = cssVariables;
744
- exports.flex = flex;
745
- exports.floats = floats;
746
- exports.fonts = fonts;
747
- exports.gaps = gaps;
748
- exports.grids = grids;
749
- exports.handlerBorderStyle = handlerBorderStyle;
750
- exports.insets = insets;
751
- exports.justifies = justifies;
752
- exports.margins = margins;
753
- exports.opacity = opacity;
754
- exports.orders = orders;
755
- exports.outline = outline;
756
- exports.overflows = overflows;
757
- exports.paddings = paddings;
758
- exports.placements = placements;
759
- exports.positions = positions;
760
- exports.questionMark = questionMark;
761
- exports.rules = rules;
762
- exports.sizes = sizes;
763
- exports.svgUtilities = svgUtilities;
764
- exports.tabSizes = tabSizes;
765
- exports.textAligns = textAligns;
766
- exports.textColors = textColors;
767
- exports.textDecorations = textDecorations;
768
- exports.textIndents = textIndents;
769
- exports.textShadows = textShadows;
770
- exports.textStrokes = textStrokes;
771
- exports.transitions = transitions;
772
- exports.verticalAligns = verticalAligns;
773
- exports.willChange = willChange;
774
- exports.zIndexes = zIndexes;
272
+ exports.baseSize = baseSize;
273
+ exports.blur = blur;
274
+ exports.borderRadius = borderRadius;
275
+ exports.boxShadow = boxShadow;
276
+ exports.breakpoints = breakpoints;
277
+ exports.dropShadow = dropShadow;
278
+ exports.duration = duration;
279
+ exports.easing = easing;
280
+ exports.fontFamily = fontFamily;
281
+ exports.fontSize = fontSize;
282
+ exports.height = height;
283
+ exports.letterSpacing = letterSpacing;
284
+ exports.lineHeight = lineHeight;
285
+ exports.lineWidth = lineWidth;
286
+ exports.maxHeight = maxHeight;
287
+ exports.maxWidth = maxWidth;
288
+ exports.preflightBase = preflightBase;
289
+ exports.ringWidth = ringWidth;
290
+ exports.spacing = spacing;
291
+ exports.textIndent = textIndent;
292
+ exports.textShadow = textShadow;
293
+ exports.textStrokeWidth = textStrokeWidth;
294
+ exports.theme = theme;
295
+ exports.verticalBreakpoints = verticalBreakpoints;
296
+ exports.width = width;
297
+ exports.wordSpacing = wordSpacing;