@unocss/preset-mini 0.42.1 → 0.43.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -0
- package/dist/chunks/{utilities.cjs → colors2.cjs} +233 -231
- package/dist/chunks/{utilities.mjs → colors2.mjs} +233 -232
- package/dist/chunks/default.cjs +3 -3
- package/dist/chunks/default.mjs +3 -3
- package/dist/chunks/default2.cjs +123 -122
- package/dist/chunks/default2.mjs +6 -6
- package/dist/chunks/default3.cjs +25 -21
- package/dist/chunks/default3.mjs +23 -19
- package/dist/chunks/transform.cjs +37 -37
- package/dist/chunks/transform.mjs +8 -8
- package/dist/index.cjs +4 -3
- package/dist/index.d.ts +7 -1
- package/dist/index.mjs +3 -2
- package/dist/rules.cjs +2 -1
- package/dist/rules.d.ts +4 -3
- package/dist/rules.mjs +2 -2
- package/dist/theme.cjs +1 -1
- package/dist/theme.mjs +1 -1
- package/dist/{utilities-654ad3bd.d.ts → utilities-b44b330d.d.ts} +3 -1
- package/dist/utils.cjs +25 -24
- package/dist/utils.d.ts +2 -3
- package/dist/utils.mjs +1 -1
- package/dist/variants.cjs +1 -1
- package/dist/variants.d.ts +1 -1
- package/dist/variants.mjs +1 -1
- package/package.json +2 -2
package/dist/chunks/default2.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const colors = require('./colors2.cjs');
|
|
4
4
|
const core = require('@unocss/core');
|
|
5
5
|
const transform = require('./transform.cjs');
|
|
6
6
|
|
|
@@ -16,19 +16,19 @@ const verticalAlignAlias = {
|
|
|
16
16
|
"text-bottom": "text-bottom",
|
|
17
17
|
"sub": "sub",
|
|
18
18
|
"super": "super",
|
|
19
|
-
...Object.fromEntries(
|
|
19
|
+
...Object.fromEntries(colors.globalKeywords.map((x) => [x, x]))
|
|
20
20
|
};
|
|
21
21
|
const verticalAligns = [
|
|
22
22
|
[/^(?:vertical|align|v)-([-\w]+)$/, ([, v]) => ({ "vertical-align": verticalAlignAlias[v] }), { autocomplete: `(vertical|align|v)-(${Object.keys(verticalAlignAlias).join("|")})` }]
|
|
23
23
|
];
|
|
24
|
-
const textAligns = ["center", "left", "right", "justify", "start", "end", ...
|
|
24
|
+
const textAligns = ["center", "left", "right", "justify", "start", "end", ...colors.globalKeywords].map((v) => [`text-${v}`, { "text-align": v }]);
|
|
25
25
|
|
|
26
26
|
const outline = [
|
|
27
|
-
[/^outline-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "outline-width": theme.lineWidth?.[d] ??
|
|
28
|
-
[/^outline-(?:color-)?(.+)$/,
|
|
29
|
-
[/^outline-offset-(.+)$/, ([, d], { theme }) => ({ "outline-offset": theme.lineWidth?.[d] ??
|
|
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
30
|
["outline", { "outline-style": "solid" }],
|
|
31
|
-
...["auto", "dashed", "dotted", "double", "hidden", "solid", "groove", "ridge", "inset", "outset", ...
|
|
31
|
+
...["auto", "dashed", "dotted", "double", "hidden", "solid", "groove", "ridge", "inset", "outset", ...colors.globalKeywords].map((v) => [`outline-${v}`, { "outline-style": v }]),
|
|
32
32
|
["outline-none", { "outline": "2px solid transparent", "outline-offset": "2px" }]
|
|
33
33
|
];
|
|
34
34
|
const appearance = [
|
|
@@ -38,7 +38,7 @@ const appearance = [
|
|
|
38
38
|
}]
|
|
39
39
|
];
|
|
40
40
|
const willChangeProperty = (prop) => {
|
|
41
|
-
return
|
|
41
|
+
return colors.handler.properties.auto.global(prop) ?? {
|
|
42
42
|
contents: "contents",
|
|
43
43
|
scroll: "scroll-position"
|
|
44
44
|
}[prop];
|
|
@@ -47,7 +47,7 @@ const willChange = [
|
|
|
47
47
|
[/^will-change-(.+)/, ([, p]) => ({ "will-change": willChangeProperty(p) })]
|
|
48
48
|
];
|
|
49
49
|
|
|
50
|
-
const borderStyles = ["solid", "dashed", "dotted", "double", "hidden", "none", "groove", "ridge", "inset", "outset", ...
|
|
50
|
+
const borderStyles = ["solid", "dashed", "dotted", "double", "hidden", "none", "groove", "ridge", "inset", "outset", ...colors.globalKeywords];
|
|
51
51
|
const borders = [
|
|
52
52
|
[/^(?:border|b)()(?:-(.+))?$/, handlerBorder, { autocomplete: "(border|b)-<directions>" }],
|
|
53
53
|
[/^(?:border|b)-([xy])(?:-(.+))?$/, handlerBorder],
|
|
@@ -81,31 +81,31 @@ const borders = [
|
|
|
81
81
|
[/^(?:border|b)-([bi][se])-(?:style-)?(.+)$/, handlerBorderStyle]
|
|
82
82
|
];
|
|
83
83
|
const borderColorResolver = (direction) => ([, body], theme) => {
|
|
84
|
-
const data =
|
|
84
|
+
const data = colors.parseColor(body, theme);
|
|
85
85
|
if (!data)
|
|
86
86
|
return;
|
|
87
87
|
const { alpha, color, cssColor } = data;
|
|
88
88
|
if (cssColor) {
|
|
89
89
|
if (alpha != null) {
|
|
90
90
|
return {
|
|
91
|
-
[`border${direction}-color`]:
|
|
91
|
+
[`border${direction}-color`]: colors.colorToString(cssColor, alpha)
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
94
|
if (direction === "") {
|
|
95
95
|
return {
|
|
96
|
-
"--un-border-opacity":
|
|
97
|
-
"border-color":
|
|
96
|
+
"--un-border-opacity": colors.colorOpacityToString(cssColor),
|
|
97
|
+
"border-color": colors.colorToString(cssColor, "var(--un-border-opacity)")
|
|
98
98
|
};
|
|
99
99
|
} else {
|
|
100
100
|
return {
|
|
101
|
-
"--un-border-opacity":
|
|
101
|
+
"--un-border-opacity": colors.colorOpacityToString(cssColor),
|
|
102
102
|
[`--un-border${direction}-opacity`]: "var(--un-border-opacity)",
|
|
103
|
-
[`border${direction}-color`]:
|
|
103
|
+
[`border${direction}-color`]: colors.colorToString(cssColor, `var(--un-border${direction}-opacity)`)
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
} else if (color) {
|
|
107
107
|
return {
|
|
108
|
-
[`border${direction}-color`]:
|
|
108
|
+
[`border${direction}-color`]: colors.colorToString(color, alpha)
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
111
|
};
|
|
@@ -120,40 +120,40 @@ function handlerBorder(m, ctx) {
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
function handlerBorderSize([, a = "", b], { theme }) {
|
|
123
|
-
const v = theme.lineWidth?.[b || "DEFAULT"] ??
|
|
124
|
-
if (a in
|
|
125
|
-
return
|
|
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
126
|
}
|
|
127
127
|
function handlerBorderColor([, a = "", c], { theme }) {
|
|
128
|
-
if (a in
|
|
129
|
-
return Object.assign({}, ...
|
|
128
|
+
if (a in colors.directionMap && colors.hasParseableColor(c, theme)) {
|
|
129
|
+
return Object.assign({}, ...colors.directionMap[a].map((i) => borderColorResolver(i)(["", c], theme)));
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
function handlerBorderOpacity([, a = "", opacity]) {
|
|
133
|
-
const v =
|
|
134
|
-
if (a in
|
|
135
|
-
return
|
|
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
136
|
}
|
|
137
137
|
function handlerRounded([, a = "", s], { theme }) {
|
|
138
|
-
const v = theme.borderRadius?.[s || "DEFAULT"] ||
|
|
139
|
-
if (a in
|
|
140
|
-
return
|
|
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
141
|
}
|
|
142
142
|
function handlerBorderStyle([, a = "", s]) {
|
|
143
|
-
if (borderStyles.includes(s) && a in
|
|
144
|
-
return
|
|
143
|
+
if (borderStyles.includes(s) && a in colors.directionMap)
|
|
144
|
+
return colors.directionMap[a].map((i) => [`border${i}-style`, s]);
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
const opacity = [
|
|
148
|
-
[/^op(?:acity)?-?(.+)$/, ([, d]) => ({ opacity:
|
|
148
|
+
[/^op(?:acity)?-?(.+)$/, ([, d]) => ({ opacity: colors.handler.bracket.percent.cssvar(d) })]
|
|
149
149
|
];
|
|
150
150
|
const textColors = [
|
|
151
|
-
[/^(?:text|color|c)-(.+)$/,
|
|
152
|
-
[/^(?:text|color|c)-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-text-opacity":
|
|
151
|
+
[/^(?:text|color|c)-(.+)$/, colors.colorResolver("color", "text"), { autocomplete: "(text|color|c)-$colors" }],
|
|
152
|
+
[/^(?:text|color|c)-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-text-opacity": colors.handler.bracket.percent(opacity2) }), { autocomplete: "(text|color|c)-(op|opacity)-<percent>" }]
|
|
153
153
|
];
|
|
154
154
|
const bgColors = [
|
|
155
|
-
[/^bg-(.+)$/,
|
|
156
|
-
[/^bg-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-bg-opacity":
|
|
155
|
+
[/^bg-(.+)$/, colors.colorResolver("background-color", "bg"), { autocomplete: "bg-$colors" }],
|
|
156
|
+
[/^bg-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-bg-opacity": colors.handler.bracket.percent(opacity2) }), { autocomplete: "bg-(op|opacity)-<percent>" }]
|
|
157
157
|
];
|
|
158
158
|
|
|
159
159
|
const transitionPropertyGroup = {
|
|
@@ -165,13 +165,13 @@ const transitionPropertyGroup = {
|
|
|
165
165
|
transform: "transform"
|
|
166
166
|
};
|
|
167
167
|
const transitionProperty = (prop) => {
|
|
168
|
-
return
|
|
168
|
+
return colors.handler.properties(prop) ?? transitionPropertyGroup[prop];
|
|
169
169
|
};
|
|
170
170
|
const transitions = [
|
|
171
171
|
[/^transition(?:-([a-z-]+(?:,[a-z-]+)*))?(?:-(\d+))?$/, ([, prop, d], { theme }) => {
|
|
172
172
|
const p = prop != null ? transitionProperty(prop) : [transitionPropertyGroup.colors, "opacity", "box-shadow", "transform", "filter", "backdrop-filter"].join(",");
|
|
173
173
|
if (p) {
|
|
174
|
-
const duration = theme.duration?.[d || "DEFAULT"] ??
|
|
174
|
+
const duration = theme.duration?.[d || "DEFAULT"] ?? colors.handler.time(d || "150");
|
|
175
175
|
return {
|
|
176
176
|
"transition-property": p,
|
|
177
177
|
"transition-timing-function": "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
@@ -181,33 +181,33 @@ const transitions = [
|
|
|
181
181
|
}, { autocomplete: `transition-(${Object.keys(transitionPropertyGroup).join("|")})` }],
|
|
182
182
|
[
|
|
183
183
|
/^(?:transition-)?duration-(.+)$/,
|
|
184
|
-
([, d], { theme }) => ({ "transition-duration": theme.duration?.[d || "DEFAULT"] ??
|
|
184
|
+
([, d], { theme }) => ({ "transition-duration": theme.duration?.[d || "DEFAULT"] ?? colors.handler.bracket.cssvar.time(d) }),
|
|
185
185
|
{ autocomplete: ["transition-duration-$duration", "duration-$duration"] }
|
|
186
186
|
],
|
|
187
187
|
[
|
|
188
188
|
/^(?:transition-)?delay-(.+)$/,
|
|
189
|
-
([, d], { theme }) => ({ "transition-delay": theme.duration?.[d || "DEFAULT"] ??
|
|
189
|
+
([, d], { theme }) => ({ "transition-delay": theme.duration?.[d || "DEFAULT"] ?? colors.handler.bracket.cssvar.time(d) }),
|
|
190
190
|
{ autocomplete: ["transition-delay-$duration", "delay-$duration"] }
|
|
191
191
|
],
|
|
192
192
|
[
|
|
193
193
|
/^(?:transition-)?ease(?:-(.+))?$/,
|
|
194
|
-
([, d], { theme }) => ({ "transition-timing-function": theme.easing?.[d || "DEFAULT"] ??
|
|
194
|
+
([, d], { theme }) => ({ "transition-timing-function": theme.easing?.[d || "DEFAULT"] ?? colors.handler.bracket.cssvar(d) }),
|
|
195
195
|
{ autocomplete: ["transition-ease-(linear|in|out|in-out|DEFAULT)", "ease-(linear|in|out|in-out|DEFAULT)"] }
|
|
196
196
|
],
|
|
197
197
|
[
|
|
198
198
|
/^(?:transition-)?property-(.+)$/,
|
|
199
|
-
([, v]) => ({ "transition-property":
|
|
200
|
-
{ autocomplete: [`transition-property-(${[...
|
|
199
|
+
([, v]) => ({ "transition-property": colors.handler.global(v) || transitionProperty(v) }),
|
|
200
|
+
{ autocomplete: [`transition-property-(${[...colors.globalKeywords, ...Object.keys(transitionPropertyGroup)].join("|")})`] }
|
|
201
201
|
],
|
|
202
202
|
["transition-none", { transition: "none" }],
|
|
203
|
-
...
|
|
203
|
+
...colors.makeGlobalStaticRules("transition")
|
|
204
204
|
];
|
|
205
205
|
|
|
206
206
|
const flex = [
|
|
207
207
|
["flex", { display: "flex" }],
|
|
208
208
|
["inline-flex", { display: "inline-flex" }],
|
|
209
209
|
["flex-inline", { display: "inline-flex" }],
|
|
210
|
-
[/^flex-(.*)$/, ([, d]) => ({ flex:
|
|
210
|
+
[/^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) })],
|
|
211
211
|
["flex-1", { flex: "1 1 0%" }],
|
|
212
212
|
["flex-auto", { flex: "1 1 auto" }],
|
|
213
213
|
["flex-initial", { flex: "0 1 auto" }],
|
|
@@ -216,7 +216,7 @@ const flex = [
|
|
|
216
216
|
[/^(?:flex-)?shrink-0$/, () => ({ "flex-shrink": 0 })],
|
|
217
217
|
[/^(?:flex-)?grow$/, () => ({ "flex-grow": 1 })],
|
|
218
218
|
[/^(?:flex-)?grow-0$/, () => ({ "flex-grow": 0 })],
|
|
219
|
-
[/^(?:flex-)?basis-(.+)$/, ([, d], { theme }) => ({ "flex-basis": theme.spacing?.[d] ??
|
|
219
|
+
[/^(?:flex-)?basis-(.+)$/, ([, d], { theme }) => ({ "flex-basis": theme.spacing?.[d] ?? colors.handler.bracket.cssvar.auto.fraction.rem(d) })],
|
|
220
220
|
["flex-row", { "flex-direction": "row" }],
|
|
221
221
|
["flex-row-reverse", { "flex-direction": "row-reverse" }],
|
|
222
222
|
["flex-col", { "flex-direction": "column" }],
|
|
@@ -240,7 +240,7 @@ const weightMap = {
|
|
|
240
240
|
const fonts = [
|
|
241
241
|
[
|
|
242
242
|
/^font-(.+)$/,
|
|
243
|
-
([, d], { theme }) => ({ "font-family": theme.fontFamily?.[d] ||
|
|
243
|
+
([, d], { theme }) => ({ "font-family": theme.fontFamily?.[d] || colors.handler.bracket.cssvar.global(d) }),
|
|
244
244
|
{ autocomplete: "font-$fontFamily" }
|
|
245
245
|
],
|
|
246
246
|
[
|
|
@@ -254,45 +254,45 @@ const fonts = [
|
|
|
254
254
|
"line-height": height
|
|
255
255
|
};
|
|
256
256
|
}
|
|
257
|
-
return { "font-size":
|
|
257
|
+
return { "font-size": colors.handler.bracketOfLength.rem(s) };
|
|
258
258
|
},
|
|
259
259
|
{ autocomplete: "text-$fontSize" }
|
|
260
260
|
],
|
|
261
261
|
[/^text-size-(.+)$/, ([, s], { theme }) => {
|
|
262
262
|
const themed = core.toArray(theme.fontSize?.[s]);
|
|
263
|
-
const size = themed?.[0] ??
|
|
263
|
+
const size = themed?.[0] ?? colors.handler.bracket.cssvar.global.rem(s);
|
|
264
264
|
if (size != null)
|
|
265
265
|
return { "font-size": size };
|
|
266
266
|
}, { autocomplete: "text-size-$fontSize" }],
|
|
267
267
|
[
|
|
268
268
|
/^(?:font|fw)-?([^-]+)$/,
|
|
269
|
-
([, s]) => ({ "font-weight": weightMap[s] ||
|
|
269
|
+
([, s]) => ({ "font-weight": weightMap[s] || colors.handler.global.number(s) }),
|
|
270
270
|
{ autocomplete: `(font|fw)-(100|200|300|400|500|600|700|800|900|${Object.keys(weightMap).join("|")})` }
|
|
271
271
|
],
|
|
272
272
|
[
|
|
273
273
|
/^(?:font-)?(?:leading|lh)-(.+)$/,
|
|
274
|
-
([, s], { theme }) => ({ "line-height": theme.lineHeight?.[s] ||
|
|
274
|
+
([, s], { theme }) => ({ "line-height": theme.lineHeight?.[s] || colors.handler.bracket.cssvar.global.rem(s) }),
|
|
275
275
|
{ autocomplete: "(leading|lh)-$lineHeight" }
|
|
276
276
|
],
|
|
277
277
|
["font-synthesis-weight", { "font-synthesis": "weight" }],
|
|
278
278
|
["font-synthesis-style", { "font-synthesis": "style" }],
|
|
279
279
|
["font-synthesis-small-caps", { "font-synthesis": "small-caps" }],
|
|
280
280
|
["font-synthesis-none", { "font-synthesis": "none" }],
|
|
281
|
-
[/^font-synthesis-(.+)$/, ([, s]) => ({ "font-synthesis":
|
|
281
|
+
[/^font-synthesis-(.+)$/, ([, s]) => ({ "font-synthesis": colors.handler.bracket.cssvar.global(s) })],
|
|
282
282
|
[
|
|
283
283
|
/^(?:font-)?tracking-(.+)$/,
|
|
284
|
-
([, s], { theme }) => ({ "letter-spacing": theme.letterSpacing?.[s] ||
|
|
284
|
+
([, s], { theme }) => ({ "letter-spacing": theme.letterSpacing?.[s] || colors.handler.bracket.cssvar.global.rem(s) }),
|
|
285
285
|
{ autocomplete: "tracking-$letterSpacing" }
|
|
286
286
|
],
|
|
287
287
|
[
|
|
288
288
|
/^(?:font-)?word-spacing-(.+)$/,
|
|
289
|
-
([, s], { theme }) => ({ "word-spacing": theme.wordSpacing?.[s] ||
|
|
289
|
+
([, s], { theme }) => ({ "word-spacing": theme.wordSpacing?.[s] || colors.handler.bracket.cssvar.global.rem(s) }),
|
|
290
290
|
{ autocomplete: "word-spacing-$wordSpacing" }
|
|
291
291
|
]
|
|
292
292
|
];
|
|
293
293
|
const tabSizes = [
|
|
294
294
|
[/^tab(?:-(.+))?$/, ([, s]) => {
|
|
295
|
-
const v =
|
|
295
|
+
const v = colors.handler.bracket.cssvar.global.number(s || "4");
|
|
296
296
|
if (v != null) {
|
|
297
297
|
return {
|
|
298
298
|
"-moz-tab-size": v,
|
|
@@ -303,26 +303,26 @@ const tabSizes = [
|
|
|
303
303
|
}]
|
|
304
304
|
];
|
|
305
305
|
const textIndents = [
|
|
306
|
-
[/^indent(?:-(.+))?$/, ([, s], { theme }) => ({ "text-indent": theme.textIndent?.[s || "DEFAULT"] ||
|
|
306
|
+
[/^indent(?:-(.+))?$/, ([, s], { theme }) => ({ "text-indent": theme.textIndent?.[s || "DEFAULT"] || colors.handler.bracket.cssvar.global.fraction.rem(s) }), { autocomplete: "indent-$textIndent" }]
|
|
307
307
|
];
|
|
308
308
|
const textStrokes = [
|
|
309
|
-
[/^text-stroke(?:-(.+))?$/, ([, s], { theme }) => ({ "-webkit-text-stroke-width": theme.textStrokeWidth?.[s || "DEFAULT"] ||
|
|
310
|
-
[/^text-stroke-(.+)$/,
|
|
311
|
-
[/^text-stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-stroke-opacity":
|
|
309
|
+
[/^text-stroke(?:-(.+))?$/, ([, s], { theme }) => ({ "-webkit-text-stroke-width": theme.textStrokeWidth?.[s || "DEFAULT"] || colors.handler.bracket.cssvar.px(s) }), { autocomplete: "text-stroke-$textStrokeWidth" }],
|
|
310
|
+
[/^text-stroke-(.+)$/, colors.colorResolver("-webkit-text-stroke-color", "text-stroke"), { autocomplete: "text-stroke-$colors" }],
|
|
311
|
+
[/^text-stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-stroke-opacity": colors.handler.bracket.percent(opacity) }), { autocomplete: "text-stroke-(op|opacity)-<percent>" }]
|
|
312
312
|
];
|
|
313
313
|
const textShadows = [
|
|
314
314
|
[/^text-shadow(?:-(.+))?$/, ([, s], { theme }) => {
|
|
315
315
|
const v = theme.textShadow?.[s || "DEFAULT"];
|
|
316
316
|
if (v != null) {
|
|
317
317
|
return {
|
|
318
|
-
"--un-text-shadow":
|
|
318
|
+
"--un-text-shadow": colors.colorableShadows(v, "--un-text-shadow-color").join(","),
|
|
319
319
|
"text-shadow": "var(--un-text-shadow)"
|
|
320
320
|
};
|
|
321
321
|
}
|
|
322
|
-
return { "text-shadow":
|
|
322
|
+
return { "text-shadow": colors.handler.bracket.cssvar.global(s) };
|
|
323
323
|
}, { autocomplete: "text-shadow-$textShadow" }],
|
|
324
|
-
[/^text-shadow-color-(.+)$/,
|
|
325
|
-
[/^text-shadow-color-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-shadow-opacity":
|
|
324
|
+
[/^text-shadow-color-(.+)$/, colors.colorResolver("--un-text-shadow-color", "text-shadow"), { autocomplete: "text-shadow-color-$colors" }],
|
|
325
|
+
[/^text-shadow-color-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-shadow-opacity": colors.handler.bracket.percent(opacity) }), { autocomplete: "text-shadow-color-(op|opacity)-<percent>" }]
|
|
326
326
|
];
|
|
327
327
|
|
|
328
328
|
const directions = {
|
|
@@ -331,7 +331,7 @@ const directions = {
|
|
|
331
331
|
"y": "row-"
|
|
332
332
|
};
|
|
333
333
|
const handleGap = ([, d = "", s], { theme }) => {
|
|
334
|
-
const v = theme.spacing?.[s] ??
|
|
334
|
+
const v = theme.spacing?.[s] ?? colors.handler.bracket.cssvar.global.rem(s);
|
|
335
335
|
if (v != null) {
|
|
336
336
|
return {
|
|
337
337
|
[`grid-${directions[d]}gap`]: v,
|
|
@@ -358,31 +358,31 @@ const autoDirection = (c, theme, prop) => {
|
|
|
358
358
|
case "fr":
|
|
359
359
|
return "minmax(0,1fr)";
|
|
360
360
|
}
|
|
361
|
-
return
|
|
361
|
+
return colors.handler.bracket.cssvar.auto.rem(prop);
|
|
362
362
|
};
|
|
363
363
|
const grids = [
|
|
364
364
|
["grid", { display: "grid" }],
|
|
365
365
|
["inline-grid", { display: "inline-grid" }],
|
|
366
366
|
[/^(?:grid-)?(row|col)-(.+)$/, ([, c, v], { theme }) => ({
|
|
367
|
-
[`grid-${rowCol(c)}`]: theme[`grid${rowColTheme(c)}`]?.[v] ??
|
|
367
|
+
[`grid-${rowCol(c)}`]: theme[`grid${rowColTheme(c)}`]?.[v] ?? colors.handler.bracket.cssvar.auto(v)
|
|
368
368
|
})],
|
|
369
369
|
[/^(?:grid-)?(row|col)-span-(.+)$/, ([, c, s]) => {
|
|
370
370
|
if (s === "full")
|
|
371
371
|
return { [`grid-${rowCol(c)}`]: "1/-1" };
|
|
372
|
-
const v =
|
|
372
|
+
const v = colors.handler.bracket.number(s);
|
|
373
373
|
if (v != null)
|
|
374
374
|
return { [`grid-${rowCol(c)}`]: `span ${v}/span ${v}` };
|
|
375
375
|
}, { autocomplete: ["grid-(row|col)-span-<num>", "(row|col)-span-<num>"] }],
|
|
376
|
-
[/^(?:grid-)?(row|col)-start-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-start`]:
|
|
377
|
-
[/^(?:grid-)?(row|col)-end-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-end`]:
|
|
378
|
-
[/^(?:grid-)?auto-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({ [`grid-auto-${rowCol(c)}`]: autoDirection(c, theme, v) })],
|
|
379
|
-
[/^(?:grid-auto-flow|auto-flow|grid-flow)-(.+)$/, ([, v]) => ({ "grid-auto-flow":
|
|
380
|
-
[/^(?:grid-auto-flow|auto-flow|grid-flow)-(row|col|dense|row-dense|col-dense)$/, ([, v]) => ({ "grid-auto-flow": rowCol(v).replace("-", " ") })],
|
|
376
|
+
[/^(?:grid-)?(row|col)-start-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-start`]: colors.handler.bracket.cssvar(v) ?? v })],
|
|
377
|
+
[/^(?:grid-)?(row|col)-end-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-end`]: colors.handler.bracket.cssvar(v) ?? v }), { autocomplete: ["grid-(row|col)-(start|end)-<num>"] }],
|
|
378
|
+
[/^(?:grid-)?auto-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({ [`grid-auto-${rowCol(c)}`]: autoDirection(c, theme, v) }), { autocomplete: ["grid-auto-(rows|cols)-<num>"] }],
|
|
379
|
+
[/^(?:grid-auto-flow|auto-flow|grid-flow)-(.+)$/, ([, v]) => ({ "grid-auto-flow": colors.handler.bracket.cssvar(v) })],
|
|
380
|
+
[/^(?: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)"] }],
|
|
381
381
|
[/^grid-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({
|
|
382
|
-
[`grid-template-${rowCol(c)}`]: theme[`gridTemplate${rowColTheme(c)}`]?.[v] ??
|
|
382
|
+
[`grid-template-${rowCol(c)}`]: theme[`gridTemplate${rowColTheme(c)}`]?.[v] ?? colors.handler.bracket.cssvar(v)
|
|
383
383
|
})],
|
|
384
384
|
[/^grid-(rows|cols)-minmax-([\w.-]+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(auto-fill,minmax(${d},1fr))` })],
|
|
385
|
-
[/^grid-(rows|cols)-(\d+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(${d},minmax(0,1fr))` })],
|
|
385
|
+
[/^grid-(rows|cols)-(\d+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(${d},minmax(0,1fr))` }), { autocomplete: ["grid-(rows|cols)-<num>", "grid-(rows|cols)-none"] }],
|
|
386
386
|
["grid-rows-none", { "grid-template-rows": "none" }],
|
|
387
387
|
["grid-cols-none", { "grid-template-columns": "none" }]
|
|
388
388
|
];
|
|
@@ -393,7 +393,7 @@ const overflowValues = [
|
|
|
393
393
|
"clip",
|
|
394
394
|
"visible",
|
|
395
395
|
"scroll",
|
|
396
|
-
...
|
|
396
|
+
...colors.globalKeywords
|
|
397
397
|
];
|
|
398
398
|
const overflows = [
|
|
399
399
|
[/^(?:overflow|of)-(.+)$/, ([, v]) => overflowValues.includes(v) ? { overflow: v } : void 0, { autocomplete: [`(overflow|of)-(${overflowValues.join("|")})`, `(overflow|of)-(x|y)-(${overflowValues.join("|")})`] }],
|
|
@@ -402,7 +402,7 @@ const overflows = [
|
|
|
402
402
|
|
|
403
403
|
const positions = [
|
|
404
404
|
[/^(?:position-|pos-)?(relative|absolute|fixed|sticky)$/, ([, v]) => ({ position: v })],
|
|
405
|
-
[/^(?:position-|pos-)([-\w]+)$/, ([, v]) =>
|
|
405
|
+
[/^(?:position-|pos-)([-\w]+)$/, ([, v]) => colors.globalKeywords.includes(v) ? { position: v } : void 0],
|
|
406
406
|
[/^(?:position-|pos-)?(static)$/, ([, v]) => ({ position: v })]
|
|
407
407
|
];
|
|
408
408
|
const justifies = [
|
|
@@ -412,21 +412,21 @@ const justifies = [
|
|
|
412
412
|
["justify-between", { "justify-content": "space-between" }],
|
|
413
413
|
["justify-around", { "justify-content": "space-around" }],
|
|
414
414
|
["justify-evenly", { "justify-content": "space-evenly" }],
|
|
415
|
-
...
|
|
415
|
+
...colors.makeGlobalStaticRules("justify", "justify-content"),
|
|
416
416
|
["justify-items-start", { "justify-items": "start" }],
|
|
417
417
|
["justify-items-end", { "justify-items": "end" }],
|
|
418
418
|
["justify-items-center", { "justify-items": "center" }],
|
|
419
419
|
["justify-items-stretch", { "justify-items": "stretch" }],
|
|
420
|
-
...
|
|
420
|
+
...colors.makeGlobalStaticRules("justify-items"),
|
|
421
421
|
["justify-self-auto", { "justify-self": "auto" }],
|
|
422
422
|
["justify-self-start", { "justify-self": "start" }],
|
|
423
423
|
["justify-self-end", { "justify-self": "end" }],
|
|
424
424
|
["justify-self-center", { "justify-self": "center" }],
|
|
425
425
|
["justify-self-stretch", { "justify-self": "stretch" }],
|
|
426
|
-
...
|
|
426
|
+
...colors.makeGlobalStaticRules("justify-self")
|
|
427
427
|
];
|
|
428
428
|
const orders = [
|
|
429
|
-
[/^order-(.+)$/, ([, v]) => ({ order:
|
|
429
|
+
[/^order-(.+)$/, ([, v]) => ({ order: colors.handler.bracket.cssvar.number(v) })],
|
|
430
430
|
["order-first", { order: "-9999" }],
|
|
431
431
|
["order-last", { order: "9999" }],
|
|
432
432
|
["order-none", { order: "0" }]
|
|
@@ -438,20 +438,20 @@ const alignments = [
|
|
|
438
438
|
["content-between", { "align-content": "space-between" }],
|
|
439
439
|
["content-around", { "align-content": "space-around" }],
|
|
440
440
|
["content-evenly", { "align-content": "space-evenly" }],
|
|
441
|
-
...
|
|
441
|
+
...colors.makeGlobalStaticRules("content", "align-content"),
|
|
442
442
|
["items-start", { "align-items": "flex-start" }],
|
|
443
443
|
["items-end", { "align-items": "flex-end" }],
|
|
444
444
|
["items-center", { "align-items": "center" }],
|
|
445
445
|
["items-baseline", { "align-items": "baseline" }],
|
|
446
446
|
["items-stretch", { "align-items": "stretch" }],
|
|
447
|
-
...
|
|
447
|
+
...colors.makeGlobalStaticRules("items", "align-items"),
|
|
448
448
|
["self-auto", { "align-self": "auto" }],
|
|
449
449
|
["self-start", { "align-self": "flex-start" }],
|
|
450
450
|
["self-end", { "align-self": "flex-end" }],
|
|
451
451
|
["self-center", { "align-self": "center" }],
|
|
452
452
|
["self-stretch", { "align-self": "stretch" }],
|
|
453
453
|
["self-baseline", { "align-self": "baseline" }],
|
|
454
|
-
...
|
|
454
|
+
...colors.makeGlobalStaticRules("self", "align-self")
|
|
455
455
|
];
|
|
456
456
|
const placements = [
|
|
457
457
|
["place-content-center", { "place-content": "center" }],
|
|
@@ -461,26 +461,26 @@ const placements = [
|
|
|
461
461
|
["place-content-around", { "place-content": "space-around" }],
|
|
462
462
|
["place-content-evenly", { "place-content": "space-evenly" }],
|
|
463
463
|
["place-content-stretch", { "place-content": "stretch" }],
|
|
464
|
-
...
|
|
464
|
+
...colors.makeGlobalStaticRules("place-content"),
|
|
465
465
|
["place-items-start", { "place-items": "start" }],
|
|
466
466
|
["place-items-end", { "place-items": "end" }],
|
|
467
467
|
["place-items-center", { "place-items": "center" }],
|
|
468
468
|
["place-items-stretch", { "place-items": "stretch" }],
|
|
469
|
-
...
|
|
469
|
+
...colors.makeGlobalStaticRules("place-items"),
|
|
470
470
|
["place-self-auto", { "place-self": "auto" }],
|
|
471
471
|
["place-self-start", { "place-self": "start" }],
|
|
472
472
|
["place-self-end", { "place-self": "end" }],
|
|
473
473
|
["place-self-center", { "place-self": "center" }],
|
|
474
474
|
["place-self-stretch", { "place-self": "stretch" }],
|
|
475
|
-
...
|
|
475
|
+
...colors.makeGlobalStaticRules("place-self")
|
|
476
476
|
];
|
|
477
477
|
function handleInsetValue(v, { theme }) {
|
|
478
|
-
return theme.spacing?.[v] ??
|
|
478
|
+
return theme.spacing?.[v] ?? colors.handler.bracket.cssvar.global.auto.fraction.rem(v);
|
|
479
479
|
}
|
|
480
480
|
function handleInsetValues([, d, v], ctx) {
|
|
481
481
|
const r = handleInsetValue(v, ctx);
|
|
482
|
-
if (r != null && d in
|
|
483
|
-
return
|
|
482
|
+
if (r != null && d in colors.insetMap)
|
|
483
|
+
return colors.insetMap[d].map((i) => [i.slice(1), r]);
|
|
484
484
|
}
|
|
485
485
|
const insets = [
|
|
486
486
|
[
|
|
@@ -505,21 +505,21 @@ const floats = [
|
|
|
505
505
|
["float-left", { float: "left" }],
|
|
506
506
|
["float-right", { float: "right" }],
|
|
507
507
|
["float-none", { float: "none" }],
|
|
508
|
-
...
|
|
508
|
+
...colors.makeGlobalStaticRules("float"),
|
|
509
509
|
["clear-left", { clear: "left" }],
|
|
510
510
|
["clear-right", { clear: "right" }],
|
|
511
511
|
["clear-both", { clear: "both" }],
|
|
512
512
|
["clear-none", { clear: "none" }],
|
|
513
|
-
...
|
|
513
|
+
...colors.makeGlobalStaticRules("clear")
|
|
514
514
|
];
|
|
515
515
|
const zIndexes = [
|
|
516
|
-
[/^z([\d.]+)$/, ([, v]) => ({ "z-index":
|
|
517
|
-
[/^z-(.+)$/, ([, v]) => ({ "z-index":
|
|
516
|
+
[/^z([\d.]+)$/, ([, v]) => ({ "z-index": colors.handler.number(v) })],
|
|
517
|
+
[/^z-(.+)$/, ([, v]) => ({ "z-index": colors.handler.bracket.cssvar.global.auto.number(v) }), { autocomplete: "z-<num>" }]
|
|
518
518
|
];
|
|
519
519
|
const boxSizing = [
|
|
520
520
|
["box-border", { "box-sizing": "border-box" }],
|
|
521
521
|
["box-content", { "box-sizing": "content-box" }],
|
|
522
|
-
...
|
|
522
|
+
...colors.makeGlobalStaticRules("box", "box-sizing")
|
|
523
523
|
];
|
|
524
524
|
|
|
525
525
|
const sizeMapping = {
|
|
@@ -542,7 +542,7 @@ function getSizeValue(minmax, hw, theme, prop) {
|
|
|
542
542
|
case "min":
|
|
543
543
|
return `${prop}-content`;
|
|
544
544
|
}
|
|
545
|
-
return
|
|
545
|
+
return colors.handler.bracket.cssvar.global.auto.fraction.rem(prop);
|
|
546
546
|
}
|
|
547
547
|
const sizes = [
|
|
548
548
|
[/^(min-|max-)?([wh])-?(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: getSizeValue(m, w, theme, s) })],
|
|
@@ -554,8 +554,8 @@ const sizes = [
|
|
|
554
554
|
"(max|min)-(w|h|block|inline)-$width|height|maxWidth|maxHeight|minWidth|minHeight|inlineSize|blockSize|maxInlineSize|maxBlockSize|minInlineSize|minBlockSize"
|
|
555
555
|
]
|
|
556
556
|
}],
|
|
557
|
-
[/^(min-|max-)?(h)-screen-(.+)$/, ([, m, w, s], context) => ({ [getPropName(m, w)]:
|
|
558
|
-
[/^(min-|max-)?(w)-screen-(.+)$/, ([, m, w, s], context) => ({ [getPropName(m, w)]:
|
|
557
|
+
[/^(min-|max-)?(h)-screen-(.+)$/, ([, m, w, s], context) => ({ [getPropName(m, w)]: colors.resolveVerticalBreakpoints(context)?.[s] })],
|
|
558
|
+
[/^(min-|max-)?(w)-screen-(.+)$/, ([, m, w, s], context) => ({ [getPropName(m, w)]: colors.resolveBreakpoints(context)?.[s] }), {
|
|
559
559
|
autocomplete: [
|
|
560
560
|
"(w|h)-screen",
|
|
561
561
|
"(min|max)-(w|h)-screen",
|
|
@@ -575,27 +575,27 @@ function getAspectRatio(prop) {
|
|
|
575
575
|
case "video":
|
|
576
576
|
return "16/9";
|
|
577
577
|
}
|
|
578
|
-
return
|
|
578
|
+
return colors.handler.bracket.cssvar.global.auto.number(prop);
|
|
579
579
|
}
|
|
580
580
|
const aspectRatio = [
|
|
581
581
|
[/^aspect-(?:ratio-)?(.+)$/, ([, d]) => ({ "aspect-ratio": getAspectRatio(d) }), { autocomplete: ["aspect-(square|video|ratio)", "aspect-ratio-(square|video)"] }]
|
|
582
582
|
];
|
|
583
583
|
|
|
584
584
|
const paddings = [
|
|
585
|
-
[/^pa?()-?(-?.+)$/,
|
|
586
|
-
[/^p-?xy()()$/,
|
|
587
|
-
[/^p-?([xy])(?:-?(-?.+))?$/,
|
|
588
|
-
[/^p-?([rltbse])(?:-?(-?.+))?$/,
|
|
589
|
-
[/^p-(block|inline)(?:-(-?.+))?$/,
|
|
590
|
-
[/^p-?([bi][se])(?:-?(-?.+))?$/,
|
|
585
|
+
[/^pa?()-?(-?.+)$/, colors.directionSize("padding"), { autocomplete: ["(m|p)<num>", "(m|p)-<num>"] }],
|
|
586
|
+
[/^p-?xy()()$/, colors.directionSize("padding"), { autocomplete: "(m|p)-(xy)" }],
|
|
587
|
+
[/^p-?([xy])(?:-?(-?.+))?$/, colors.directionSize("padding")],
|
|
588
|
+
[/^p-?([rltbse])(?:-?(-?.+))?$/, colors.directionSize("padding"), { autocomplete: "(m|p)<directions>-<num>" }],
|
|
589
|
+
[/^p-(block|inline)(?:-(-?.+))?$/, colors.directionSize("padding"), { autocomplete: "(m|p)-(block|inline)-<num>" }],
|
|
590
|
+
[/^p-?([bi][se])(?:-?(-?.+))?$/, colors.directionSize("padding"), { autocomplete: "(m|p)-(bs|be|is|ie)-<num>" }]
|
|
591
591
|
];
|
|
592
592
|
const margins = [
|
|
593
|
-
[/^ma?()-?(-?.+)$/,
|
|
594
|
-
[/^m-?xy()()$/,
|
|
595
|
-
[/^m-?([xy])(?:-?(-?.+))?$/,
|
|
596
|
-
[/^m-?([rltbse])(?:-?(-?.+))?$/,
|
|
597
|
-
[/^m-(block|inline)(?:-(-?.+))?$/,
|
|
598
|
-
[/^m-?([bi][se])(?:-?(-?.+))?$/,
|
|
593
|
+
[/^ma?()-?(-?.+)$/, colors.directionSize("margin")],
|
|
594
|
+
[/^m-?xy()()$/, colors.directionSize("margin")],
|
|
595
|
+
[/^m-?([xy])(?:-?(-?.+))?$/, colors.directionSize("margin")],
|
|
596
|
+
[/^m-?([rltbse])(?:-?(-?.+))?$/, colors.directionSize("margin")],
|
|
597
|
+
[/^m-(block|inline)(?:-(-?.+))?$/, colors.directionSize("margin")],
|
|
598
|
+
[/^m-?([bi][se])(?:-?(-?.+))?$/, colors.directionSize("margin")]
|
|
599
599
|
];
|
|
600
600
|
|
|
601
601
|
const variablesAbbrMap = {
|
|
@@ -617,11 +617,11 @@ const cssVariables = [
|
|
|
617
617
|
[/^(.+?)-(\$.+)$/, ([, name, varname]) => {
|
|
618
618
|
const prop = variablesAbbrMap[name];
|
|
619
619
|
if (prop)
|
|
620
|
-
return { [prop]:
|
|
620
|
+
return { [prop]: colors.handler.cssvar(varname) };
|
|
621
621
|
}]
|
|
622
622
|
];
|
|
623
623
|
const cssProperty = [
|
|
624
|
-
[/^\[([\w_-]+):([^'"]+)\]$/, ([, prop, value]) => ({ [prop]:
|
|
624
|
+
[/^\[([\w_-]+):([^'"]+)\]$/, ([, prop, value]) => ({ [prop]: colors.handler.bracket(`[${value}]`) })]
|
|
625
625
|
];
|
|
626
626
|
|
|
627
627
|
const questionMark = [
|
|
@@ -635,13 +635,13 @@ ${constructCSS({ animation: "__un_qm 0.5s ease-in-out alternate infinite" })}`;
|
|
|
635
635
|
]
|
|
636
636
|
];
|
|
637
637
|
|
|
638
|
-
const decorationStyles = ["solid", "double", "dotted", "dashed", "wavy", ...
|
|
638
|
+
const decorationStyles = ["solid", "double", "dotted", "dashed", "wavy", ...colors.globalKeywords];
|
|
639
639
|
const textDecorations = [
|
|
640
640
|
[/^(?:decoration-)?(underline|overline|line-through)$/, ([, s]) => ({ "text-decoration-line": s }), { autocomplete: "decoration-(underline|overline|line-through)" }],
|
|
641
|
-
[/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s], { theme }) => ({ "text-decoration-thickness": theme.lineWidth?.[s] ??
|
|
641
|
+
[/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s], { theme }) => ({ "text-decoration-thickness": theme.lineWidth?.[s] ?? colors.handler.bracket.cssvar.global.px(s) }), { autocomplete: "(underline|decoration)-<num>" }],
|
|
642
642
|
[/^(?:underline|decoration)-(auto|from-font)$/, ([, s]) => ({ "text-decoration-thickness": s }), { autocomplete: "(underline|decoration)-(auto|from-font)" }],
|
|
643
643
|
[/^(?:underline|decoration)-(.+)$/, (match, ctx) => {
|
|
644
|
-
const result =
|
|
644
|
+
const result = colors.colorResolver("text-decoration-color", "line")(match, ctx);
|
|
645
645
|
if (result) {
|
|
646
646
|
return {
|
|
647
647
|
"-webkit-text-decoration-color": result["text-decoration-color"],
|
|
@@ -649,8 +649,8 @@ const textDecorations = [
|
|
|
649
649
|
};
|
|
650
650
|
}
|
|
651
651
|
}, { autocomplete: "(underline|decoration)-$colors" }],
|
|
652
|
-
[/^(?:underline|decoration)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-line-opacity":
|
|
653
|
-
[/^(?:underline|decoration)-offset-(.+)$/, ([, s], { theme }) => ({ "text-underline-offset": theme.lineWidth?.[s] ??
|
|
652
|
+
[/^(?:underline|decoration)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-line-opacity": colors.handler.bracket.percent(opacity) }), { autocomplete: "(underline|decoration)-(op|opacity)-<percent>" }],
|
|
653
|
+
[/^(?:underline|decoration)-offset-(.+)$/, ([, s], { theme }) => ({ "text-underline-offset": theme.lineWidth?.[s] ?? colors.handler.auto.bracket.cssvar.global.px(s) }), { autocomplete: "(underline|decoration)-(offset)-<num>" }],
|
|
654
654
|
...decorationStyles.map((v) => [`underline-${v}`, { "text-decoration-style": v }]),
|
|
655
655
|
...decorationStyles.map((v) => [`decoration-${v}`, { "text-decoration-style": v }]),
|
|
656
656
|
["no-underline", { "text-decoration": "none" }],
|
|
@@ -658,14 +658,14 @@ const textDecorations = [
|
|
|
658
658
|
];
|
|
659
659
|
|
|
660
660
|
const svgUtilities = [
|
|
661
|
-
[/^fill-(.+)$/,
|
|
662
|
-
[/^fill-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-fill-opacity":
|
|
661
|
+
[/^fill-(.+)$/, colors.colorResolver("fill", "fill"), { autocomplete: "fill-$colors" }],
|
|
662
|
+
[/^fill-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-fill-opacity": colors.handler.bracket.percent(opacity) }), { autocomplete: "fill-(op|opacity)-<percent>" }],
|
|
663
663
|
["fill-none", { fill: "none" }],
|
|
664
|
-
[/^stroke-(?:width-|size-)?(.+)$/, ([, s], { theme }) => ({ "stroke-width": theme.lineWidth?.[s] ??
|
|
665
|
-
[/^stroke-dash-(.+)$/, ([, s]) => ({ "stroke-dasharray":
|
|
666
|
-
[/^stroke-offset-(.+)$/, ([, s], { theme }) => ({ "stroke-dashoffset": theme.lineWidth?.[s] ??
|
|
667
|
-
[/^stroke-(.+)$/,
|
|
668
|
-
[/^stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-stroke-opacity":
|
|
664
|
+
[/^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"] }],
|
|
665
|
+
[/^stroke-dash-(.+)$/, ([, s]) => ({ "stroke-dasharray": colors.handler.bracket.cssvar.number(s) }), { autocomplete: "stroke-dash-<num>" }],
|
|
666
|
+
[/^stroke-offset-(.+)$/, ([, s], { theme }) => ({ "stroke-dashoffset": theme.lineWidth?.[s] ?? colors.handler.bracket.cssvar.px.numberWithUnit(s) }), { autocomplete: "stroke-offset-$lineWidth" }],
|
|
667
|
+
[/^stroke-(.+)$/, colors.colorResolver("stroke", "stroke"), { autocomplete: "stroke-$colors" }],
|
|
668
|
+
[/^stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-stroke-opacity": colors.handler.bracket.percent(opacity) }), { autocomplete: "stroke-(op|opacity)-<percent>" }],
|
|
669
669
|
["stroke-cap-square", { "stroke-linecap": "square" }],
|
|
670
670
|
["stroke-cap-round", { "stroke-linecap": "round" }],
|
|
671
671
|
["stroke-cap-auto", { "stroke-linecap": "butt" }],
|
|
@@ -747,6 +747,7 @@ exports.floats = floats;
|
|
|
747
747
|
exports.fonts = fonts;
|
|
748
748
|
exports.gaps = gaps;
|
|
749
749
|
exports.grids = grids;
|
|
750
|
+
exports.handlerBorderStyle = handlerBorderStyle;
|
|
750
751
|
exports.insets = insets;
|
|
751
752
|
exports.justifies = justifies;
|
|
752
753
|
exports.margins = margins;
|