@unocss/preset-mini 0.44.7 → 0.45.4

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