@unocss/preset-mini 0.53.0 → 0.53.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +6 -6
- package/dist/index.mjs +7 -7
- package/dist/rules.cjs +3 -3
- package/dist/rules.mjs +3 -3
- package/dist/shared/{preset-mini.b9e9b262.cjs → preset-mini.0ea9a044.cjs} +2 -2
- package/dist/shared/{preset-mini.6babd10a.mjs → preset-mini.17fe8f10.mjs} +64 -63
- package/dist/shared/{preset-mini.7577b1bf.mjs → preset-mini.354bed23.mjs} +26 -26
- package/dist/shared/{preset-mini.8d9dbf2c.cjs → preset-mini.3567e469.cjs} +20 -20
- package/dist/shared/{preset-mini.82cf398e.mjs → preset-mini.407f1930.mjs} +20 -20
- package/dist/shared/{preset-mini.422a3875.mjs → preset-mini.438da325.mjs} +2 -2
- package/dist/shared/{preset-mini.64d922d5.mjs → preset-mini.6c244f7e.mjs} +7 -7
- package/dist/shared/{preset-mini.bd1a81a2.mjs → preset-mini.9af3cc95.mjs} +1 -1
- package/dist/shared/{preset-mini.099ab35c.cjs → preset-mini.a21c5071.cjs} +6 -6
- package/dist/shared/{preset-mini.c3ab5ec7.cjs → preset-mini.d778b487.cjs} +1 -1
- package/dist/shared/{preset-mini.60fa5b43.cjs → preset-mini.db8ecde7.cjs} +64 -63
- package/dist/shared/{preset-mini.dfb70bd4.cjs → preset-mini.f4e50e04.cjs} +26 -26
- package/dist/theme.cjs +3 -3
- package/dist/theme.mjs +3 -3
- package/dist/utils.cjs +2 -2
- package/dist/utils.mjs +2 -2
- package/dist/variants.cjs +3 -3
- package/dist/variants.mjs +3 -3
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -4,13 +4,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const extractorArbitraryVariants = require('@unocss/extractor-arbitrary-variants');
|
|
6
6
|
const core = require('@unocss/core');
|
|
7
|
-
require('./shared/preset-mini.
|
|
8
|
-
const _default$1 = require('./shared/preset-mini.
|
|
9
|
-
const colors$1 = require('./shared/preset-mini.
|
|
7
|
+
require('./shared/preset-mini.db8ecde7.cjs');
|
|
8
|
+
const _default$1 = require('./shared/preset-mini.f4e50e04.cjs');
|
|
9
|
+
const colors$1 = require('./shared/preset-mini.a21c5071.cjs');
|
|
10
10
|
const colors = require('./shared/preset-mini.f3fc54d2.cjs');
|
|
11
|
-
const _default = require('./shared/preset-mini.
|
|
12
|
-
const _default$2 = require('./shared/preset-mini.
|
|
13
|
-
require('./shared/preset-mini.
|
|
11
|
+
const _default = require('./shared/preset-mini.0ea9a044.cjs');
|
|
12
|
+
const _default$2 = require('./shared/preset-mini.3567e469.cjs');
|
|
13
|
+
require('./shared/preset-mini.d778b487.cjs');
|
|
14
14
|
|
|
15
15
|
const preflights = [
|
|
16
16
|
{
|
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { extractorArbitraryVariants } from '@unocss/extractor-arbitrary-variants';
|
|
2
2
|
import { entriesToCss, toArray } from '@unocss/core';
|
|
3
|
-
import './shared/preset-mini.
|
|
4
|
-
import { r as rules } from './shared/preset-mini.
|
|
5
|
-
export { p as parseColor } from './shared/preset-mini.
|
|
3
|
+
import './shared/preset-mini.17fe8f10.mjs';
|
|
4
|
+
import { r as rules } from './shared/preset-mini.354bed23.mjs';
|
|
5
|
+
export { p as parseColor } from './shared/preset-mini.6c244f7e.mjs';
|
|
6
6
|
export { c as colors } from './shared/preset-mini.1c66bf79.mjs';
|
|
7
|
-
import { t as theme } from './shared/preset-mini.
|
|
8
|
-
export { t as theme } from './shared/preset-mini.
|
|
9
|
-
import { v as variants } from './shared/preset-mini.
|
|
10
|
-
import './shared/preset-mini.
|
|
7
|
+
import { t as theme } from './shared/preset-mini.438da325.mjs';
|
|
8
|
+
export { t as theme } from './shared/preset-mini.438da325.mjs';
|
|
9
|
+
import { v as variants } from './shared/preset-mini.407f1930.mjs';
|
|
10
|
+
import './shared/preset-mini.9af3cc95.mjs';
|
|
11
11
|
|
|
12
12
|
const preflights = [
|
|
13
13
|
{
|
package/dist/rules.cjs
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const transform = require('./shared/preset-mini.
|
|
6
|
-
const _default = require('./shared/preset-mini.
|
|
7
|
-
require('./shared/preset-mini.
|
|
5
|
+
const transform = require('./shared/preset-mini.db8ecde7.cjs');
|
|
6
|
+
const _default = require('./shared/preset-mini.f4e50e04.cjs');
|
|
7
|
+
require('./shared/preset-mini.a21c5071.cjs');
|
|
8
8
|
require('@unocss/core');
|
|
9
9
|
|
|
10
10
|
|
package/dist/rules.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { I as alignments, F as appearance, w as appearances, b as bgColors, X as borderStyles, a as borders, r as boxShadows, V as boxShadowsBase, O as boxSizing, C as breaks, S as contains, c as contentVisibility, e as contents, v as cursors, d as displays, K as flexGridJustifiesAlignments, M as floats, q as fontSmoothings, p as fontStyles, f as fonts, Y as handlerBorderStyle, L as insets, H as justifies, o as opacity, G as orders, E as outline, D as overflows, J as placements, x as pointerEvents, u as positions, y as resizes, W as ringBase, s as rings, t as tabSizes, m as textAligns, n as textColors, i as textDecorations, g as textIndents, h as textOverflows, k as textShadows, j as textStrokes, l as textTransforms, T as textWraps, U as transformBase, Q as transforms, P as transitions, A as userSelects, Z as varEmpty, z as verticalAligns, B as whitespaces, R as willChange, N as zIndexes } from './shared/preset-mini.
|
|
2
|
-
export { b as aspectRatio, c as containerParent, h as cssProperty, e as cssVariables, f as flex, g as gaps, a as grids, m as margins, p as paddings, q as questionMark, r as rules, s as sizes, d as svgUtilities } from './shared/preset-mini.
|
|
3
|
-
import './shared/preset-mini.
|
|
1
|
+
export { I as alignments, F as appearance, w as appearances, b as bgColors, X as borderStyles, a as borders, r as boxShadows, V as boxShadowsBase, O as boxSizing, C as breaks, S as contains, c as contentVisibility, e as contents, v as cursors, d as displays, K as flexGridJustifiesAlignments, M as floats, q as fontSmoothings, p as fontStyles, f as fonts, Y as handlerBorderStyle, L as insets, H as justifies, o as opacity, G as orders, E as outline, D as overflows, J as placements, x as pointerEvents, u as positions, y as resizes, W as ringBase, s as rings, t as tabSizes, m as textAligns, n as textColors, i as textDecorations, g as textIndents, h as textOverflows, k as textShadows, j as textStrokes, l as textTransforms, T as textWraps, U as transformBase, Q as transforms, P as transitions, A as userSelects, Z as varEmpty, z as verticalAligns, B as whitespaces, R as willChange, N as zIndexes } from './shared/preset-mini.17fe8f10.mjs';
|
|
2
|
+
export { b as aspectRatio, c as containerParent, h as cssProperty, e as cssVariables, f as flex, g as gaps, a as grids, m as margins, p as paddings, q as questionMark, r as rules, s as sizes, d as svgUtilities } from './shared/preset-mini.354bed23.mjs';
|
|
3
|
+
import './shared/preset-mini.6c244f7e.mjs';
|
|
4
4
|
import '@unocss/core';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const colors = require('./preset-mini.f3fc54d2.cjs');
|
|
4
|
-
const transform = require('./preset-mini.
|
|
4
|
+
const transform = require('./preset-mini.db8ecde7.cjs');
|
|
5
5
|
require('@unocss/core');
|
|
6
|
-
require('./preset-mini.
|
|
6
|
+
require('./preset-mini.a21c5071.cjs');
|
|
7
7
|
|
|
8
8
|
const fontFamily = {
|
|
9
9
|
sans: [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as globalKeywords, h
|
|
1
|
+
import { g as globalKeywords, h, c as colorResolver, d as directionMap, a as hasParseableColor, b as cornerMap, p as parseColor, e as colorToString, f as colorOpacityToString, n as numberWithUnitRE, m as makeGlobalStaticRules, s as splitShorthand, i as colorableShadows, j as insetMap, k as positionMap, x as xyzMap } from './preset-mini.6c244f7e.mjs';
|
|
2
2
|
import { toArray } from '@unocss/core';
|
|
3
3
|
|
|
4
4
|
const verticalAlignAlias = {
|
|
@@ -23,9 +23,9 @@ const verticalAligns = [
|
|
|
23
23
|
const textAligns = ["center", "left", "right", "justify", "start", "end"].map((v) => [`text-${v}`, { "text-align": v }]);
|
|
24
24
|
|
|
25
25
|
const outline = [
|
|
26
|
-
[/^outline-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "outline-width": theme.lineWidth?.[d] ??
|
|
26
|
+
[/^outline-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "outline-width": theme.lineWidth?.[d] ?? h.bracket.cssvar.global.px(d) }), { autocomplete: "outline-(width|size)-<num>" }],
|
|
27
27
|
[/^outline-(?:color-)?(.+)$/, colorResolver("outline-color", "outline-color"), { autocomplete: "outline-$colors" }],
|
|
28
|
-
[/^outline-offset-(.+)$/, ([, d], { theme }) => ({ "outline-offset": theme.lineWidth?.[d] ??
|
|
28
|
+
[/^outline-offset-(.+)$/, ([, d], { theme }) => ({ "outline-offset": theme.lineWidth?.[d] ?? h.bracket.cssvar.global.px(d) }), { autocomplete: "outline-(offset)-<num>" }],
|
|
29
29
|
["outline", { "outline-style": "solid" }],
|
|
30
30
|
...["auto", "dashed", "dotted", "double", "hidden", "solid", "groove", "ridge", "inset", "outset", ...globalKeywords].map((v) => [`outline-${v}`, { "outline-style": v }]),
|
|
31
31
|
["outline-none", { "outline": "2px solid transparent", "outline-offset": "2px" }]
|
|
@@ -37,7 +37,7 @@ const appearance = [
|
|
|
37
37
|
}]
|
|
38
38
|
];
|
|
39
39
|
function willChangeProperty(prop) {
|
|
40
|
-
return
|
|
40
|
+
return h.properties.auto.global(prop) ?? {
|
|
41
41
|
contents: "contents",
|
|
42
42
|
scroll: "scroll-position"
|
|
43
43
|
}[prop];
|
|
@@ -114,7 +114,7 @@ function handlerBorder(m, ctx) {
|
|
|
114
114
|
return handlerBorderSize(m, ctx);
|
|
115
115
|
}
|
|
116
116
|
function handlerBorderSize([, a = "", b], { theme }) {
|
|
117
|
-
const v = theme.lineWidth?.[b || "DEFAULT"] ??
|
|
117
|
+
const v = theme.lineWidth?.[b || "DEFAULT"] ?? h.bracket.cssvar.global.px(b || "1");
|
|
118
118
|
if (a in directionMap && v != null)
|
|
119
119
|
return directionMap[a].map((i) => [`border${i}-width`, v]);
|
|
120
120
|
}
|
|
@@ -127,12 +127,12 @@ function handlerBorderColor([, a = "", c], { theme }) {
|
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
function handlerBorderOpacity([, a = "", opacity]) {
|
|
130
|
-
const v =
|
|
130
|
+
const v = h.bracket.percent.cssvar(opacity);
|
|
131
131
|
if (a in directionMap && v != null)
|
|
132
132
|
return directionMap[a].map((i) => [`--un-border${i}-opacity`, v]);
|
|
133
133
|
}
|
|
134
134
|
function handlerRounded([, a = "", s], { theme }) {
|
|
135
|
-
const v = theme.borderRadius?.[s || "DEFAULT"] ||
|
|
135
|
+
const v = theme.borderRadius?.[s || "DEFAULT"] || h.bracket.cssvar.global.fraction.rem(s || "1");
|
|
136
136
|
if (a in cornerMap && v != null)
|
|
137
137
|
return cornerMap[a].map((i) => [`border${i}-radius`, v]);
|
|
138
138
|
}
|
|
@@ -142,23 +142,23 @@ function handlerBorderStyle([, a = "", s]) {
|
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
const opacity = [
|
|
145
|
-
[/^op(?:acity)?-?(.+)$/, ([, d]) => ({ opacity:
|
|
145
|
+
[/^op(?:acity)?-?(.+)$/, ([, d]) => ({ opacity: h.bracket.percent.cssvar(d) })]
|
|
146
146
|
];
|
|
147
147
|
const textColors = [
|
|
148
148
|
[/^(?:color|c)-(.+)$/, colorResolver("color", "text"), { autocomplete: "(color|c)-$colors" }],
|
|
149
149
|
[/^text-(.+)$/, colorResolver("color", "text", (css) => !css.color?.toString().match(numberWithUnitRE)), { autocomplete: "text-$colors" }],
|
|
150
150
|
[/^(?:text|color|c)-(.+)$/, ([, v]) => globalKeywords.includes(v) ? { color: v } : void 0, { autocomplete: `(text|color|c)-(${globalKeywords.join("|")})` }],
|
|
151
|
-
[/^(?:text|color|c)-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-text-opacity":
|
|
151
|
+
[/^(?:text|color|c)-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-text-opacity": h.bracket.percent.cssvar(opacity2) }), { autocomplete: "(text|color|c)-(op|opacity)-<percent>" }]
|
|
152
152
|
];
|
|
153
153
|
const bgColors = [
|
|
154
154
|
[/^bg-(.+)$/, colorResolver("background-color", "bg"), { autocomplete: "bg-$colors" }],
|
|
155
|
-
[/^bg-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-bg-opacity":
|
|
155
|
+
[/^bg-op(?:acity)?-?(.+)$/, ([, opacity2]) => ({ "--un-bg-opacity": h.bracket.percent.cssvar(opacity2) }), { autocomplete: "bg-(op|opacity)-<percent>" }]
|
|
156
156
|
];
|
|
157
157
|
|
|
158
158
|
const decorationStyles = ["solid", "double", "dotted", "dashed", "wavy", ...globalKeywords];
|
|
159
159
|
const textDecorations = [
|
|
160
160
|
[/^(?:decoration-)?(underline|overline|line-through)$/, ([, s]) => ({ "text-decoration-line": s }), { autocomplete: "decoration-(underline|overline|line-through)" }],
|
|
161
|
-
[/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s], { theme }) => ({ "text-decoration-thickness": theme.lineWidth?.[s] ??
|
|
161
|
+
[/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s], { theme }) => ({ "text-decoration-thickness": theme.lineWidth?.[s] ?? h.bracket.cssvar.global.px(s) }), { autocomplete: "(underline|decoration)-<num>" }],
|
|
162
162
|
[/^(?:underline|decoration)-(auto|from-font)$/, ([, s]) => ({ "text-decoration-thickness": s }), { autocomplete: "(underline|decoration)-(auto|from-font)" }],
|
|
163
163
|
[/^(?:underline|decoration)-(.+)$/, (match, ctx) => {
|
|
164
164
|
const result = colorResolver("text-decoration-color", "line")(match, ctx);
|
|
@@ -169,8 +169,8 @@ const textDecorations = [
|
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
171
|
}, { autocomplete: "(underline|decoration)-$colors" }],
|
|
172
|
-
[/^(?:underline|decoration)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-line-opacity":
|
|
173
|
-
[/^(?:underline|decoration)-offset-(.+)$/, ([, s], { theme }) => ({ "text-underline-offset": theme.lineWidth?.[s] ??
|
|
172
|
+
[/^(?:underline|decoration)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-line-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "(underline|decoration)-(op|opacity)-<percent>" }],
|
|
173
|
+
[/^(?:underline|decoration)-offset-(.+)$/, ([, s], { theme }) => ({ "text-underline-offset": theme.lineWidth?.[s] ?? h.auto.bracket.cssvar.global.px(s) }), { autocomplete: "(underline|decoration)-(offset)-<num>" }],
|
|
174
174
|
...decorationStyles.map((v) => [`underline-${v}`, { "text-decoration-style": v }]),
|
|
175
175
|
...decorationStyles.map((v) => [`decoration-${v}`, { "text-decoration-style": v }]),
|
|
176
176
|
["no-underline", { "text-decoration": "none" }],
|
|
@@ -186,13 +186,13 @@ const transitionPropertyGroup = {
|
|
|
186
186
|
transform: "transform"
|
|
187
187
|
};
|
|
188
188
|
function transitionProperty(prop) {
|
|
189
|
-
return
|
|
189
|
+
return h.properties(prop) ?? transitionPropertyGroup[prop];
|
|
190
190
|
}
|
|
191
191
|
const transitions = [
|
|
192
192
|
[/^transition(?:-([a-z-]+(?:,[a-z-]+)*))?(?:-(\d+))?$/, ([, prop, d], { theme }) => {
|
|
193
193
|
const p = prop != null ? transitionProperty(prop) : [transitionPropertyGroup.colors, "opacity", "box-shadow", "transform", "filter", "backdrop-filter"].join(",");
|
|
194
194
|
if (p) {
|
|
195
|
-
const duration = theme.duration?.[d || "DEFAULT"] ??
|
|
195
|
+
const duration = theme.duration?.[d || "DEFAULT"] ?? h.time(d || "150");
|
|
196
196
|
return {
|
|
197
197
|
"transition-property": p,
|
|
198
198
|
"transition-timing-function": "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
@@ -202,22 +202,22 @@ const transitions = [
|
|
|
202
202
|
}, { autocomplete: `transition-(${Object.keys(transitionPropertyGroup).join("|")})` }],
|
|
203
203
|
[
|
|
204
204
|
/^(?:transition-)?duration-(.+)$/,
|
|
205
|
-
([, d], { theme }) => ({ "transition-duration": theme.duration?.[d || "DEFAULT"] ??
|
|
205
|
+
([, d], { theme }) => ({ "transition-duration": theme.duration?.[d || "DEFAULT"] ?? h.bracket.cssvar.time(d) }),
|
|
206
206
|
{ autocomplete: ["transition-duration-$duration", "duration-$duration"] }
|
|
207
207
|
],
|
|
208
208
|
[
|
|
209
209
|
/^(?:transition-)?delay-(.+)$/,
|
|
210
|
-
([, d], { theme }) => ({ "transition-delay": theme.duration?.[d || "DEFAULT"] ??
|
|
210
|
+
([, d], { theme }) => ({ "transition-delay": theme.duration?.[d || "DEFAULT"] ?? h.bracket.cssvar.time(d) }),
|
|
211
211
|
{ autocomplete: ["transition-delay-$duration", "delay-$duration"] }
|
|
212
212
|
],
|
|
213
213
|
[
|
|
214
214
|
/^(?:transition-)?ease(?:-(.+))?$/,
|
|
215
|
-
([, d], { theme }) => ({ "transition-timing-function": theme.easing?.[d || "DEFAULT"] ??
|
|
215
|
+
([, d], { theme }) => ({ "transition-timing-function": theme.easing?.[d || "DEFAULT"] ?? h.bracket.cssvar(d) }),
|
|
216
216
|
{ autocomplete: ["transition-ease-(linear|in|out|in-out|DEFAULT)", "ease-(linear|in|out|in-out|DEFAULT)"] }
|
|
217
217
|
],
|
|
218
218
|
[
|
|
219
219
|
/^(?:transition-)?property-(.+)$/,
|
|
220
|
-
([, v]) => ({ "transition-property":
|
|
220
|
+
([, v]) => ({ "transition-property": h.bracket.global(v) || transitionProperty(v) }),
|
|
221
221
|
{ autocomplete: [`transition-property-(${[...globalKeywords, ...Object.keys(transitionPropertyGroup)].join("|")})`] }
|
|
222
222
|
],
|
|
223
223
|
["transition-none", { transition: "none" }],
|
|
@@ -236,14 +236,9 @@ const weightMap = {
|
|
|
236
236
|
black: "900"
|
|
237
237
|
};
|
|
238
238
|
function handleLineHeight(s, theme) {
|
|
239
|
-
return theme.lineHeight?.[s] ||
|
|
239
|
+
return theme.lineHeight?.[s] || h.bracket.cssvar.global.rem(s);
|
|
240
240
|
}
|
|
241
241
|
const fonts = [
|
|
242
|
-
[
|
|
243
|
-
/^font-(.+)$/,
|
|
244
|
-
([, d], { theme }) => ({ "font-family": theme.fontFamily?.[d] || handler.bracket.cssvar.global(d) }),
|
|
245
|
-
{ autocomplete: "font-$fontFamily" }
|
|
246
|
-
],
|
|
247
242
|
[
|
|
248
243
|
/^text-(.+)$/,
|
|
249
244
|
([, s = "base"], { theme }) => {
|
|
@@ -257,26 +252,26 @@ const fonts = [
|
|
|
257
252
|
"line-height": lineHeight ?? height ?? "1"
|
|
258
253
|
};
|
|
259
254
|
}
|
|
260
|
-
const fontSize =
|
|
255
|
+
const fontSize = h.bracketOfLength.rem(size);
|
|
261
256
|
if (lineHeight && fontSize) {
|
|
262
257
|
return {
|
|
263
258
|
"font-size": fontSize,
|
|
264
259
|
"line-height": lineHeight
|
|
265
260
|
};
|
|
266
261
|
}
|
|
267
|
-
return { "font-size":
|
|
262
|
+
return { "font-size": h.bracketOfLength.rem(s) };
|
|
268
263
|
},
|
|
269
264
|
{ autocomplete: "text-$fontSize" }
|
|
270
265
|
],
|
|
271
266
|
[/^text-size-(.+)$/, ([, s], { theme }) => {
|
|
272
267
|
const themed = toArray(theme.fontSize?.[s]);
|
|
273
|
-
const size = themed?.[0] ??
|
|
268
|
+
const size = themed?.[0] ?? h.bracket.cssvar.global.rem(s);
|
|
274
269
|
if (size != null)
|
|
275
270
|
return { "font-size": size };
|
|
276
271
|
}, { autocomplete: "text-size-$fontSize" }],
|
|
277
272
|
[
|
|
278
273
|
/^(?:font|fw)-?([^-]+)$/,
|
|
279
|
-
([, s]) => ({ "font-weight": weightMap[s] ||
|
|
274
|
+
([, s]) => ({ "font-weight": weightMap[s] || h.bracket.global.number(s) }),
|
|
280
275
|
{ autocomplete: `(font|fw)-(100|200|300|400|500|600|700|800|900|${Object.keys(weightMap).join("|")})` }
|
|
281
276
|
],
|
|
282
277
|
[
|
|
@@ -288,21 +283,26 @@ const fonts = [
|
|
|
288
283
|
["font-synthesis-style", { "font-synthesis": "style" }],
|
|
289
284
|
["font-synthesis-small-caps", { "font-synthesis": "small-caps" }],
|
|
290
285
|
["font-synthesis-none", { "font-synthesis": "none" }],
|
|
291
|
-
[/^font-synthesis-(.+)$/, ([, s]) => ({ "font-synthesis":
|
|
286
|
+
[/^font-synthesis-(.+)$/, ([, s]) => ({ "font-synthesis": h.bracket.cssvar.global(s) })],
|
|
292
287
|
[
|
|
293
288
|
/^(?:font-)?tracking-(.+)$/,
|
|
294
|
-
([, s], { theme }) => ({ "letter-spacing": theme.letterSpacing?.[s] ||
|
|
289
|
+
([, s], { theme }) => ({ "letter-spacing": theme.letterSpacing?.[s] || h.bracket.cssvar.global.rem(s) }),
|
|
295
290
|
{ autocomplete: "tracking-$letterSpacing" }
|
|
296
291
|
],
|
|
297
292
|
[
|
|
298
293
|
/^(?:font-)?word-spacing-(.+)$/,
|
|
299
|
-
([, s], { theme }) => ({ "word-spacing": theme.wordSpacing?.[s] ||
|
|
294
|
+
([, s], { theme }) => ({ "word-spacing": theme.wordSpacing?.[s] || h.bracket.cssvar.global.rem(s) }),
|
|
300
295
|
{ autocomplete: "word-spacing-$wordSpacing" }
|
|
296
|
+
],
|
|
297
|
+
[
|
|
298
|
+
/^font-(.+)$/,
|
|
299
|
+
([, d], { theme }) => ({ "font-family": theme.fontFamily?.[d] || h.bracket.cssvar.global(d) }),
|
|
300
|
+
{ autocomplete: "font-$fontFamily" }
|
|
301
301
|
]
|
|
302
302
|
];
|
|
303
303
|
const tabSizes = [
|
|
304
304
|
[/^tab(?:-(.+))?$/, ([, s]) => {
|
|
305
|
-
const v =
|
|
305
|
+
const v = h.bracket.cssvar.global.number(s || "4");
|
|
306
306
|
if (v != null) {
|
|
307
307
|
return {
|
|
308
308
|
"-moz-tab-size": v,
|
|
@@ -313,12 +313,12 @@ const tabSizes = [
|
|
|
313
313
|
}]
|
|
314
314
|
];
|
|
315
315
|
const textIndents = [
|
|
316
|
-
[/^indent(?:-(.+))?$/, ([, s], { theme }) => ({ "text-indent": theme.textIndent?.[s || "DEFAULT"] ||
|
|
316
|
+
[/^indent(?:-(.+))?$/, ([, s], { theme }) => ({ "text-indent": theme.textIndent?.[s || "DEFAULT"] || h.bracket.cssvar.global.fraction.rem(s) }), { autocomplete: "indent-$textIndent" }]
|
|
317
317
|
];
|
|
318
318
|
const textStrokes = [
|
|
319
|
-
[/^text-stroke(?:-(.+))?$/, ([, s], { theme }) => ({ "-webkit-text-stroke-width": theme.textStrokeWidth?.[s || "DEFAULT"] ||
|
|
319
|
+
[/^text-stroke(?:-(.+))?$/, ([, s], { theme }) => ({ "-webkit-text-stroke-width": theme.textStrokeWidth?.[s || "DEFAULT"] || h.bracket.cssvar.px(s) }), { autocomplete: "text-stroke-$textStrokeWidth" }],
|
|
320
320
|
[/^text-stroke-(.+)$/, colorResolver("-webkit-text-stroke-color", "text-stroke"), { autocomplete: "text-stroke-$colors" }],
|
|
321
|
-
[/^text-stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-stroke-opacity":
|
|
321
|
+
[/^text-stroke-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-stroke-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "text-stroke-(op|opacity)-<percent>" }]
|
|
322
322
|
];
|
|
323
323
|
const textShadows = [
|
|
324
324
|
[/^text-shadow(?:-(.+))?$/, ([, s], { theme }) => {
|
|
@@ -329,10 +329,10 @@ const textShadows = [
|
|
|
329
329
|
"text-shadow": "var(--un-text-shadow)"
|
|
330
330
|
};
|
|
331
331
|
}
|
|
332
|
-
return { "text-shadow":
|
|
332
|
+
return { "text-shadow": h.bracket.cssvar.global(s) };
|
|
333
333
|
}, { autocomplete: "text-shadow-$textShadow" }],
|
|
334
334
|
[/^text-shadow-color-(.+)$/, colorResolver("--un-text-shadow-color", "text-shadow"), { autocomplete: "text-shadow-color-$colors" }],
|
|
335
|
-
[/^text-shadow-color-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-shadow-opacity":
|
|
335
|
+
[/^text-shadow-color-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-shadow-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "text-shadow-color-(op|opacity)-<percent>" }]
|
|
336
336
|
];
|
|
337
337
|
|
|
338
338
|
const overflowValues = [
|
|
@@ -376,7 +376,7 @@ const justifies = [
|
|
|
376
376
|
...makeGlobalStaticRules("justify-self")
|
|
377
377
|
];
|
|
378
378
|
const orders = [
|
|
379
|
-
[/^order-(.+)$/, ([, v]) => ({ order:
|
|
379
|
+
[/^order-(.+)$/, ([, v]) => ({ order: h.bracket.cssvar.number(v) })],
|
|
380
380
|
["order-first", { order: "-9999" }],
|
|
381
381
|
["order-last", { order: "9999" }],
|
|
382
382
|
["order-none", { order: "0" }]
|
|
@@ -429,7 +429,7 @@ const flexGridJustifiesAlignments = [...justifies, ...alignments].flatMap(([k, v
|
|
|
429
429
|
[`grid-${k}`, v]
|
|
430
430
|
]);
|
|
431
431
|
function handleInsetValue(v, { theme }) {
|
|
432
|
-
return theme.spacing?.[v] ??
|
|
432
|
+
return theme.spacing?.[v] ?? h.bracket.cssvar.global.auto.fraction.rem(v);
|
|
433
433
|
}
|
|
434
434
|
function handleInsetValues([, d, v], ctx) {
|
|
435
435
|
const r = handleInsetValue(v, ctx);
|
|
@@ -468,8 +468,8 @@ const floats = [
|
|
|
468
468
|
...makeGlobalStaticRules("clear")
|
|
469
469
|
];
|
|
470
470
|
const zIndexes = [
|
|
471
|
-
[/^(?:position-|pos-)?z([\d.]+)$/, ([, v]) => ({ "z-index":
|
|
472
|
-
[/^(?:position-|pos-)?z-(.+)$/, ([, v]) => ({ "z-index":
|
|
471
|
+
[/^(?:position-|pos-)?z([\d.]+)$/, ([, v]) => ({ "z-index": h.number(v) })],
|
|
472
|
+
[/^(?:position-|pos-)?z-(.+)$/, ([, v]) => ({ "z-index": h.bracket.cssvar.global.auto.number(v) }), { autocomplete: "z-<num>" }]
|
|
473
473
|
];
|
|
474
474
|
const boxSizing = [
|
|
475
475
|
["box-border", { "box-sizing": "border-box" }],
|
|
@@ -488,7 +488,7 @@ const displays = [
|
|
|
488
488
|
["flow-root", { display: "flow-root" }],
|
|
489
489
|
["list-item", { display: "list-item" }],
|
|
490
490
|
["hidden", { display: "none" }],
|
|
491
|
-
[/^display-(.+)$/, ([, c]) => ({ display:
|
|
491
|
+
[/^display-(.+)$/, ([, c]) => ({ display: h.bracket.cssvar.global(c) || c })]
|
|
492
492
|
];
|
|
493
493
|
const appearances = [
|
|
494
494
|
["visible", { visibility: "visible" }],
|
|
@@ -498,14 +498,14 @@ const appearances = [
|
|
|
498
498
|
...makeGlobalStaticRules("backface", "backface-visibility")
|
|
499
499
|
];
|
|
500
500
|
const cursors = [
|
|
501
|
-
[/^cursor-(.+)$/, ([, c]) => ({ cursor:
|
|
501
|
+
[/^cursor-(.+)$/, ([, c]) => ({ cursor: h.bracket.cssvar.global(c) })],
|
|
502
502
|
...cursorValues.map((v) => [`cursor-${v}`, { cursor: v }])
|
|
503
503
|
];
|
|
504
504
|
const contains = [
|
|
505
505
|
[/^contain-(.*)$/, ([, d]) => {
|
|
506
|
-
if (
|
|
506
|
+
if (h.bracket(d) != null) {
|
|
507
507
|
return {
|
|
508
|
-
contain:
|
|
508
|
+
contain: h.bracket(d).split(" ").map((e) => h.cssvar.fraction(e) ?? e).join(" ")
|
|
509
509
|
};
|
|
510
510
|
}
|
|
511
511
|
return containValues.includes(d) ? { contain: d } : void 0;
|
|
@@ -538,14 +538,14 @@ const whitespaces = [
|
|
|
538
538
|
]
|
|
539
539
|
];
|
|
540
540
|
const contentVisibility = [
|
|
541
|
-
[/^intrinsic-size-(.+)$/, ([, d]) => ({ "contain-intrinsic-size":
|
|
541
|
+
[/^intrinsic-size-(.+)$/, ([, d]) => ({ "contain-intrinsic-size": h.bracket.cssvar.global.fraction.rem(d) }), { autocomplete: "intrinsic-size-<num>" }],
|
|
542
542
|
["content-visibility-visible", { "content-visibility": "visible" }],
|
|
543
543
|
["content-visibility-hidden", { "content-visibility": "hidden" }],
|
|
544
544
|
["content-visibility-auto", { "content-visibility": "auto" }],
|
|
545
545
|
...makeGlobalStaticRules("content-visibility")
|
|
546
546
|
];
|
|
547
547
|
const contents = [
|
|
548
|
-
[/^content-(.+)$/, ([, v]) => ({ content:
|
|
548
|
+
[/^content-(.+)$/, ([, v]) => ({ content: h.bracket.cssvar(v) })],
|
|
549
549
|
["content-empty", { content: '""' }],
|
|
550
550
|
["content-none", { content: "none" }]
|
|
551
551
|
];
|
|
@@ -553,7 +553,8 @@ const breaks = [
|
|
|
553
553
|
["break-normal", { "overflow-wrap": "normal", "word-break": "normal" }],
|
|
554
554
|
["break-words", { "overflow-wrap": "break-word" }],
|
|
555
555
|
["break-all", { "word-break": "break-all" }],
|
|
556
|
-
["break-keep", { "word-break": "keep-all" }]
|
|
556
|
+
["break-keep", { "word-break": "keep-all" }],
|
|
557
|
+
["break-anywhere", { "overflow-wrap": "anywhere" }]
|
|
557
558
|
];
|
|
558
559
|
const textWraps = [
|
|
559
560
|
["text-wrap", { "text-wrap": "wrap" }],
|
|
@@ -606,7 +607,7 @@ const ringBase = {
|
|
|
606
607
|
};
|
|
607
608
|
const rings = [
|
|
608
609
|
[/^ring(?:-(.+))?$/, ([, d], { theme }) => {
|
|
609
|
-
const value = theme.ringWidth?.[d || "DEFAULT"] ??
|
|
610
|
+
const value = theme.ringWidth?.[d || "DEFAULT"] ?? h.px(d || "1");
|
|
610
611
|
if (value) {
|
|
611
612
|
return {
|
|
612
613
|
"--un-ring-width": value,
|
|
@@ -616,13 +617,13 @@ const rings = [
|
|
|
616
617
|
};
|
|
617
618
|
}
|
|
618
619
|
}, { autocomplete: "ring-$ringWidth" }],
|
|
619
|
-
[/^ring-(?:width-|size-)(.+)$/, ([, d], { theme }) => ({ "--un-ring-width": theme.lineWidth?.[d] ??
|
|
620
|
+
[/^ring-(?:width-|size-)(.+)$/, ([, d], { theme }) => ({ "--un-ring-width": theme.lineWidth?.[d] ?? h.bracket.cssvar.px(d) }), { autocomplete: "ring-(width|size)-$lineWidth" }],
|
|
620
621
|
["ring-offset", { "--un-ring-offset-width": "1px" }],
|
|
621
|
-
[/^ring-offset-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "--un-ring-offset-width": theme.lineWidth?.[d] ??
|
|
622
|
+
[/^ring-offset-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "--un-ring-offset-width": theme.lineWidth?.[d] ?? h.bracket.cssvar.px(d) }), { autocomplete: "ring-offset-(width|size)-$lineWidth" }],
|
|
622
623
|
[/^ring-(.+)$/, colorResolver("--un-ring-color", "ring"), { autocomplete: "ring-$colors" }],
|
|
623
|
-
[/^ring-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-opacity":
|
|
624
|
+
[/^ring-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "ring-(op|opacity)-<percent>" }],
|
|
624
625
|
[/^ring-offset-(.+)$/, colorResolver("--un-ring-offset-color", "ring-offset"), { autocomplete: "ring-offset-$colors" }],
|
|
625
|
-
[/^ring-offset-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-offset-opacity":
|
|
626
|
+
[/^ring-offset-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-offset-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "ring-offset-(op|opacity)-<percent>" }],
|
|
626
627
|
["ring-inset", { "--un-ring-inset": "inset" }]
|
|
627
628
|
];
|
|
628
629
|
|
|
@@ -637,7 +638,7 @@ const boxShadows = [
|
|
|
637
638
|
const [, d] = match;
|
|
638
639
|
const { theme } = context;
|
|
639
640
|
const v = theme.boxShadow?.[d || "DEFAULT"];
|
|
640
|
-
const c = d ?
|
|
641
|
+
const c = d ? h.bracket.cssvar(d) : void 0;
|
|
641
642
|
if ((v != null || c != null) && !hasParseableColor(c, theme)) {
|
|
642
643
|
return {
|
|
643
644
|
"--un-shadow": colorableShadows(v || c, "--un-shadow-color").join(","),
|
|
@@ -646,7 +647,7 @@ const boxShadows = [
|
|
|
646
647
|
}
|
|
647
648
|
return colorResolver("--un-shadow-color", "shadow")(match, context);
|
|
648
649
|
}, { autocomplete: ["shadow-$colors", "shadow-$boxShadow"] }],
|
|
649
|
-
[/^shadow-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-shadow-opacity":
|
|
650
|
+
[/^shadow-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-shadow-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "shadow-(op|opacity)-<percent>" }],
|
|
650
651
|
["shadow-inset", { "--un-shadow-inset": "inset" }]
|
|
651
652
|
];
|
|
652
653
|
|
|
@@ -696,9 +697,9 @@ const transformBase = {
|
|
|
696
697
|
"--un-translate-z": 0
|
|
697
698
|
};
|
|
698
699
|
const transforms = [
|
|
699
|
-
[/^(?:transform-)?origin-(.+)$/, ([, s]) => ({ "transform-origin": positionMap[s] ??
|
|
700
|
+
[/^(?:transform-)?origin-(.+)$/, ([, s]) => ({ "transform-origin": positionMap[s] ?? h.bracket.cssvar(s) }), { autocomplete: [`transform-origin-(${Object.keys(positionMap).join("|")})`, `origin-(${Object.keys(positionMap).join("|")})`] }],
|
|
700
701
|
[/^(?:transform-)?perspect(?:ive)?-(.+)$/, ([, s]) => {
|
|
701
|
-
const v =
|
|
702
|
+
const v = h.bracket.cssvar.px.numberWithUnit(s);
|
|
702
703
|
if (v != null) {
|
|
703
704
|
return {
|
|
704
705
|
"-webkit-perspective": v,
|
|
@@ -707,7 +708,7 @@ const transforms = [
|
|
|
707
708
|
}
|
|
708
709
|
}],
|
|
709
710
|
[/^(?:transform-)?perspect(?:ive)?-origin-(.+)$/, ([, s]) => {
|
|
710
|
-
const v =
|
|
711
|
+
const v = h.bracket.cssvar(s) ?? (s.length >= 3 ? positionMap[s] : void 0);
|
|
711
712
|
if (v != null) {
|
|
712
713
|
return {
|
|
713
714
|
"-webkit-perspective-origin": v,
|
|
@@ -732,7 +733,7 @@ const transforms = [
|
|
|
732
733
|
...makeGlobalStaticRules("transform")
|
|
733
734
|
];
|
|
734
735
|
function handleTranslate([, d, b], { theme }) {
|
|
735
|
-
const v = theme.spacing?.[b] ??
|
|
736
|
+
const v = theme.spacing?.[b] ?? h.bracket.cssvar.fraction.rem(b);
|
|
736
737
|
if (v != null) {
|
|
737
738
|
return [
|
|
738
739
|
...xyzMap[d].map((i) => [`--un-translate${i}`, v]),
|
|
@@ -741,7 +742,7 @@ function handleTranslate([, d, b], { theme }) {
|
|
|
741
742
|
}
|
|
742
743
|
}
|
|
743
744
|
function handleScale([, d, b]) {
|
|
744
|
-
const v =
|
|
745
|
+
const v = h.bracket.cssvar.fraction.percent(b);
|
|
745
746
|
if (v != null) {
|
|
746
747
|
return [
|
|
747
748
|
...xyzMap[d].map((i) => [`--un-scale${i}`, v]),
|
|
@@ -750,7 +751,7 @@ function handleScale([, d, b]) {
|
|
|
750
751
|
}
|
|
751
752
|
}
|
|
752
753
|
function handleRotate([, d = "", b]) {
|
|
753
|
-
const v =
|
|
754
|
+
const v = h.bracket.cssvar.degree(b);
|
|
754
755
|
if (v != null) {
|
|
755
756
|
if (d) {
|
|
756
757
|
return {
|
|
@@ -770,7 +771,7 @@ function handleRotate([, d = "", b]) {
|
|
|
770
771
|
}
|
|
771
772
|
}
|
|
772
773
|
function handleSkew([, d, b]) {
|
|
773
|
-
const v =
|
|
774
|
+
const v = h.bracket.cssvar.degree(b);
|
|
774
775
|
if (v != null) {
|
|
775
776
|
return [
|
|
776
777
|
...xyzMap[d].map((i) => [`--un-skew${i}`, v]),
|