@unocss/preset-mini 0.42.1 → 0.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
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, m as makeGlobalStaticRules, i as colorableShadows, j as insetMap, r as resolveVerticalBreakpoints, k as resolveBreakpoints, l as directionSize } from './utilities.mjs';
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, m as makeGlobalStaticRules, i as colorableShadows, j as insetMap, r as resolveVerticalBreakpoints, k as resolveBreakpoints, l as directionSize } from './colors2.mjs';
2
2
  import { toArray } from '@unocss/core';
3
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';
4
4
 
@@ -372,15 +372,15 @@ const grids = [
372
372
  return { [`grid-${rowCol(c)}`]: `span ${v}/span ${v}` };
373
373
  }, { autocomplete: ["grid-(row|col)-span-<num>", "(row|col)-span-<num>"] }],
374
374
  [/^(?:grid-)?(row|col)-start-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-start`]: handler.bracket.cssvar(v) ?? v })],
375
- [/^(?:grid-)?(row|col)-end-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-end`]: handler.bracket.cssvar(v) ?? v })],
376
- [/^(?:grid-)?auto-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({ [`grid-auto-${rowCol(c)}`]: autoDirection(c, theme, v) })],
375
+ [/^(?:grid-)?(row|col)-end-(.+)$/, ([, c, v]) => ({ [`grid-${rowCol(c)}-end`]: handler.bracket.cssvar(v) ?? v }), { autocomplete: ["grid-(row|col)-(start|end)-<num>"] }],
376
+ [/^(?:grid-)?auto-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({ [`grid-auto-${rowCol(c)}`]: autoDirection(c, theme, v) }), { autocomplete: ["grid-auto-(rows|cols)-<num>"] }],
377
377
  [/^(?:grid-auto-flow|auto-flow|grid-flow)-(.+)$/, ([, v]) => ({ "grid-auto-flow": handler.bracket.cssvar(v) })],
378
- [/^(?:grid-auto-flow|auto-flow|grid-flow)-(row|col|dense|row-dense|col-dense)$/, ([, v]) => ({ "grid-auto-flow": rowCol(v).replace("-", " ") })],
378
+ [/^(?: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)"] }],
379
379
  [/^grid-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({
380
380
  [`grid-template-${rowCol(c)}`]: theme[`gridTemplate${rowColTheme(c)}`]?.[v] ?? handler.bracket.cssvar(v)
381
381
  })],
382
382
  [/^grid-(rows|cols)-minmax-([\w.-]+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(auto-fill,minmax(${d},1fr))` })],
383
- [/^grid-(rows|cols)-(\d+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(${d},minmax(0,1fr))` })],
383
+ [/^grid-(rows|cols)-(\d+)$/, ([, c, d]) => ({ [`grid-template-${rowCol(c)}`]: `repeat(${d},minmax(0,1fr))` }), { autocomplete: ["grid-(rows|cols)-<num>", "grid-(rows|cols)-none"] }],
384
384
  ["grid-rows-none", { "grid-template-rows": "none" }],
385
385
  ["grid-cols-none", { "grid-template-columns": "none" }]
386
386
  ];
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const utilities = require('./utilities.cjs');
3
+ const colors = require('./colors2.cjs');
4
4
  const variants$1 = require('./variants.cjs');
5
5
  const core = require('@unocss/core');
6
6
 
@@ -14,7 +14,7 @@ const calcMaxWidthBySize = (size) => {
14
14
  const variantBreakpoints = {
15
15
  name: "breakpoints",
16
16
  match(matcher, context) {
17
- const variantEntries = Object.entries(utilities.resolveBreakpoints(context) ?? {}).map(([point, size], idx) => [point, size, idx]);
17
+ const variantEntries = Object.entries(colors.resolveBreakpoints(context) ?? {}).map(([point, size], idx) => [point, size, idx]);
18
18
  for (const [point, size, idx] of variantEntries) {
19
19
  if (!regexCache[point])
20
20
  regexCache[point] = new RegExp(`^((?:[al]t-)?${point}[:-])`);
@@ -183,24 +183,28 @@ const variantScope = {
183
183
  const variantVariables = {
184
184
  name: "variables",
185
185
  match(matcher) {
186
- const match = matcher.match(/^(\[.+?\]):/);
187
- if (match) {
188
- const variant = utilities.handler.bracket(match[1]) ?? "";
189
- return {
190
- matcher: matcher.slice(match[0].length),
191
- handle(input, next) {
192
- const updates = variant.startsWith("@") ? {
193
- parent: `${input.parent ? `${input.parent} $$ ` : ""}${variant}`
194
- } : {
195
- selector: variant.replace(/&/g, input.selector)
196
- };
197
- return next({
198
- ...input,
199
- ...updates
200
- });
201
- }
202
- };
203
- }
186
+ if (!matcher.startsWith("["))
187
+ return;
188
+ const [match, rest] = colors.getComponent(matcher, "[", "]", ":") ?? [];
189
+ if (!(match && rest && rest !== ""))
190
+ return;
191
+ const variant = colors.handler.bracket(match) ?? "";
192
+ if (!(variant.startsWith("@") || variant.includes("&")))
193
+ return;
194
+ return {
195
+ matcher: rest,
196
+ handle(input, next) {
197
+ const updates = variant.startsWith("@") ? {
198
+ parent: `${input.parent ? `${input.parent} $$ ` : ""}${variant}`
199
+ } : {
200
+ selector: variant.replace(/&/g, input.selector)
201
+ };
202
+ return next({
203
+ ...input,
204
+ ...updates
205
+ });
206
+ }
207
+ };
204
208
  },
205
209
  multiPass: true
206
210
  };
@@ -217,7 +221,7 @@ const variantNegative = {
217
221
  return {
218
222
  matcher: matcher.slice(1),
219
223
  body: (body) => {
220
- if (body.find((v) => v[0] === utilities.CONTROL_MINI_NO_NEGATIVE))
224
+ if (body.find((v) => v[0] === colors.CONTROL_MINI_NO_NEGATIVE))
221
225
  return;
222
226
  let changed = false;
223
227
  body.forEach((v) => {
@@ -1,4 +1,4 @@
1
- import { k as resolveBreakpoints, h as handler, C as CONTROL_MINI_NO_NEGATIVE } from './utilities.mjs';
1
+ import { k as resolveBreakpoints, n as getComponent, h as handler, C as CONTROL_MINI_NO_NEGATIVE } from './colors2.mjs';
2
2
  import { v as variantParentMatcher, a as variantMatcher } from './variants.mjs';
3
3
  import { escapeRegExp } from '@unocss/core';
4
4
 
@@ -181,24 +181,28 @@ const variantScope = {
181
181
  const variantVariables = {
182
182
  name: "variables",
183
183
  match(matcher) {
184
- const match = matcher.match(/^(\[.+?\]):/);
185
- if (match) {
186
- const variant = handler.bracket(match[1]) ?? "";
187
- return {
188
- matcher: matcher.slice(match[0].length),
189
- handle(input, next) {
190
- const updates = variant.startsWith("@") ? {
191
- parent: `${input.parent ? `${input.parent} $$ ` : ""}${variant}`
192
- } : {
193
- selector: variant.replace(/&/g, input.selector)
194
- };
195
- return next({
196
- ...input,
197
- ...updates
198
- });
199
- }
200
- };
201
- }
184
+ if (!matcher.startsWith("["))
185
+ return;
186
+ const [match, rest] = getComponent(matcher, "[", "]", ":") ?? [];
187
+ if (!(match && rest && rest !== ""))
188
+ return;
189
+ const variant = handler.bracket(match) ?? "";
190
+ if (!(variant.startsWith("@") || variant.includes("&")))
191
+ return;
192
+ return {
193
+ matcher: rest,
194
+ handle(input, next) {
195
+ const updates = variant.startsWith("@") ? {
196
+ parent: `${input.parent ? `${input.parent} $$ ` : ""}${variant}`
197
+ } : {
198
+ selector: variant.replace(/&/g, input.selector)
199
+ };
200
+ return next({
201
+ ...input,
202
+ ...updates
203
+ });
204
+ }
205
+ };
202
206
  },
203
207
  multiPass: true
204
208
  };
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- const utilities = require('./utilities.cjs');
3
+ const colors = require('./colors2.cjs');
4
4
 
5
5
  const cursorValues = ["auto", "default", "none", "context-menu", "help", "pointer", "progress", "wait", "cell", "crosshair", "text", "vertical-text", "alias", "copy", "move", "no-drop", "not-allowed", "grab", "grabbing", "all-scroll", "col-resize", "row-resize", "n-resize", "e-resize", "s-resize", "w-resize", "ne-resize", "nw-resize", "se-resize", "sw-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "zoom-in", "zoom-out"];
6
- const varEmpty = "var(--un-empty,/*!*/ /*!*/)";
6
+ const varEmpty = " ";
7
7
  const displays = [
8
8
  ["inline", { display: "inline" }],
9
9
  ["block", { display: "block" }],
@@ -12,48 +12,48 @@ const displays = [
12
12
  ["flow-root", { display: "flow-root" }],
13
13
  ["list-item", { display: "list-item" }],
14
14
  ["hidden", { display: "none" }],
15
- [/^display-(.+)$/, ([, c]) => ({ display: utilities.handler.bracket.cssvar.global(c) || c })]
15
+ [/^display-(.+)$/, ([, c]) => ({ display: colors.handler.bracket.cssvar.global(c) || c })]
16
16
  ];
17
17
  const appearances = [
18
18
  ["visible", { visibility: "visible" }],
19
19
  ["invisible", { visibility: "hidden" }],
20
20
  ["backface-visible", { "backface-visibility": "visible" }],
21
21
  ["backface-hidden", { "backface-visibility": "hidden" }],
22
- ...utilities.makeGlobalStaticRules("backface", "backface-visibility")
22
+ ...colors.makeGlobalStaticRules("backface", "backface-visibility")
23
23
  ];
24
24
  const cursors = [
25
- [/^cursor-(.+)$/, ([, c]) => ({ cursor: utilities.handler.bracket.cssvar.global(c) })],
25
+ [/^cursor-(.+)$/, ([, c]) => ({ cursor: colors.handler.bracket.cssvar.global(c) })],
26
26
  ...cursorValues.map((v) => [`cursor-${v}`, { cursor: v }])
27
27
  ];
28
28
  const pointerEvents = [
29
29
  ["pointer-events-auto", { "pointer-events": "auto" }],
30
30
  ["pointer-events-none", { "pointer-events": "none" }],
31
- ...utilities.makeGlobalStaticRules("pointer-events")
31
+ ...colors.makeGlobalStaticRules("pointer-events")
32
32
  ];
33
33
  const resizes = [
34
34
  ["resize-x", { resize: "horizontal" }],
35
35
  ["resize-y", { resize: "vertical" }],
36
36
  ["resize", { resize: "both" }],
37
37
  ["resize-none", { resize: "none" }],
38
- ...utilities.makeGlobalStaticRules("resize")
38
+ ...colors.makeGlobalStaticRules("resize")
39
39
  ];
40
40
  const userSelects = [
41
41
  ["select-auto", { "user-select": "auto" }],
42
42
  ["select-all", { "user-select": "all" }],
43
43
  ["select-text", { "user-select": "text" }],
44
44
  ["select-none", { "user-select": "none" }],
45
- ...utilities.makeGlobalStaticRules("select", "user-select")
45
+ ...colors.makeGlobalStaticRules("select", "user-select")
46
46
  ];
47
47
  const whitespaces = [
48
48
  [
49
49
  /^(?:whitespace-|ws-)([-\w]+)$/,
50
- ([, v]) => ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces", ...utilities.globalKeywords].includes(v) ? { "white-space": v } : void 0,
50
+ ([, v]) => ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces", ...colors.globalKeywords].includes(v) ? { "white-space": v } : void 0,
51
51
  { autocomplete: "(whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap|break-spaces)" }
52
52
  ]
53
53
  ];
54
54
  const contents = [
55
55
  [/^content-\[(.+)\]$/, ([, v]) => ({ content: `"${v}"` })],
56
- [/^content-(\$.+)]$/, ([, v]) => ({ content: utilities.handler.cssvar(v) })],
56
+ [/^content-(\$.+)]$/, ([, v]) => ({ content: colors.handler.cssvar(v) })],
57
57
  ["content-empty", { content: '""' }],
58
58
  ["content-none", { content: '""' }]
59
59
  ];
@@ -72,7 +72,7 @@ const textTransforms = [
72
72
  ["case-lower", { "text-transform": "lowercase" }],
73
73
  ["case-capital", { "text-transform": "capitalize" }],
74
74
  ["case-normal", { "text-transform": "none" }],
75
- ...utilities.makeGlobalStaticRules("case", "text-transform")
75
+ ...colors.makeGlobalStaticRules("case", "text-transform")
76
76
  ];
77
77
  const fontStyles = [
78
78
  ["italic", { "font-style": "italic" }],
@@ -103,48 +103,48 @@ const ringBase = {
103
103
  "--un-ring-offset-color": "#fff",
104
104
  "--un-ring-width": "0px",
105
105
  "--un-ring-color": "rgba(147,197,253,0.5)",
106
- "--un-shadow": "0 0 #0000"
106
+ "--un-shadow": "0 0 rgba(0,0,0,0)"
107
107
  };
108
108
  const rings = [
109
109
  [/^ring(?:-(.+))?$/, ([, d], { theme }) => {
110
- const value = theme.ringWidth?.[d || "DEFAULT"] ?? utilities.handler.px(d || "1");
110
+ const value = theme.ringWidth?.[d || "DEFAULT"] ?? colors.handler.px(d || "1");
111
111
  if (value) {
112
112
  return {
113
113
  "--un-ring-width": value,
114
114
  "--un-ring-offset-shadow": "var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color)",
115
115
  "--un-ring-shadow": "var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color)",
116
- "box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow, 0 0 #0000)"
116
+ "box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow)"
117
117
  };
118
118
  }
119
119
  }, { autocomplete: "ring-$ringWidth" }],
120
- [/^ring-(?:width-|size-)(.+)$/, ([, d], { theme }) => ({ "--un-ring-width": theme.lineWidth?.[d] ?? utilities.handler.bracket.cssvar.px(d) }), { autocomplete: "ring-(width|size)-$lineWidth" }],
120
+ [/^ring-(?:width-|size-)(.+)$/, ([, d], { theme }) => ({ "--un-ring-width": theme.lineWidth?.[d] ?? colors.handler.bracket.cssvar.px(d) }), { autocomplete: "ring-(width|size)-$lineWidth" }],
121
121
  ["ring-offset", { "--un-ring-offset-width": "1px" }],
122
- [/^ring-offset-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "--un-ring-offset-width": theme.lineWidth?.[d] ?? utilities.handler.bracket.cssvar.px(d) }), { autocomplete: "ring-offset-(width|size)-$lineWidth" }],
123
- [/^ring-(.+)$/, utilities.colorResolver("--un-ring-color", "ring"), { autocomplete: "ring-$colors" }],
124
- [/^ring-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-opacity": utilities.handler.bracket.percent(opacity) }), { autocomplete: "ring-(op|opacity)-<percent>" }],
125
- [/^ring-offset-(.+)$/, utilities.colorResolver("--un-ring-offset-color", "ring-offset"), { autocomplete: "ring-offset-$colors" }],
126
- [/^ring-offset-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-offset-opacity": utilities.handler.bracket.percent(opacity) }), { autocomplete: "ring-offset-(op|opacity)-<percent>" }],
122
+ [/^ring-offset-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "--un-ring-offset-width": theme.lineWidth?.[d] ?? colors.handler.bracket.cssvar.px(d) }), { autocomplete: "ring-offset-(width|size)-$lineWidth" }],
123
+ [/^ring-(.+)$/, colors.colorResolver("--un-ring-color", "ring"), { autocomplete: "ring-$colors" }],
124
+ [/^ring-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-opacity": colors.handler.bracket.percent(opacity) }), { autocomplete: "ring-(op|opacity)-<percent>" }],
125
+ [/^ring-offset-(.+)$/, colors.colorResolver("--un-ring-offset-color", "ring-offset"), { autocomplete: "ring-offset-$colors" }],
126
+ [/^ring-offset-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-offset-opacity": colors.handler.bracket.percent(opacity) }), { autocomplete: "ring-offset-(op|opacity)-<percent>" }],
127
127
  ["ring-inset", { "--un-ring-inset": "inset" }]
128
128
  ];
129
129
 
130
130
  const boxShadowsBase = {
131
- "--un-ring-offset-shadow": "0 0 #0000",
132
- "--un-ring-shadow": "0 0 #0000",
131
+ "--un-ring-offset-shadow": "0 0 rgba(0,0,0,0)",
132
+ "--un-ring-shadow": "0 0 rgba(0,0,0,0)",
133
133
  "--un-shadow-inset": varEmpty,
134
- "--un-shadow": "0 0 #0000"
134
+ "--un-shadow": "0 0 rgba(0,0,0,0)"
135
135
  };
136
136
  const boxShadows = [
137
137
  [/^shadow(?:-(.+))?$/, ([, d], { theme }) => {
138
138
  const v = theme.boxShadow?.[d || "DEFAULT"];
139
139
  if (v) {
140
140
  return {
141
- "--un-shadow": utilities.colorableShadows(v, "--un-shadow-color").join(","),
142
- "box-shadow": "var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow)"
141
+ "--un-shadow": colors.colorableShadows(v, "--un-shadow-color").join(","),
142
+ "box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow)"
143
143
  };
144
144
  }
145
145
  }, { autocomplete: "shadow-$boxShadow" }],
146
- [/^shadow-(.+)$/, utilities.colorResolver("--un-shadow-color", "shadow"), { autocomplete: "shadow-$colors" }],
147
- [/^shadow-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-shadow-opacity": utilities.handler.bracket.percent(opacity) }), { autocomplete: "shadow-(op|opacity)-<percent>" }],
146
+ [/^shadow-(.+)$/, colors.colorResolver("--un-shadow-color", "shadow"), { autocomplete: "shadow-$colors" }],
147
+ [/^shadow-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-shadow-opacity": colors.handler.bracket.percent(opacity) }), { autocomplete: "shadow-(op|opacity)-<percent>" }],
148
148
  ["shadow-inset", { "--un-shadow-inset": "inset" }]
149
149
  ];
150
150
 
@@ -194,9 +194,9 @@ const transformBase = {
194
194
  "--un-translate-z": 0
195
195
  };
196
196
  const transforms = [
197
- [/^(?:transform-)?origin-(.+)$/, ([, s]) => ({ "transform-origin": utilities.positionMap[s] ?? utilities.handler.bracket.cssvar(s) }), { autocomplete: [`transform-origin-(${Object.keys(utilities.positionMap).join("|")})`, `origin-(${Object.keys(utilities.positionMap).join("|")})`] }],
197
+ [/^(?:transform-)?origin-(.+)$/, ([, s]) => ({ "transform-origin": colors.positionMap[s] ?? colors.handler.bracket.cssvar(s) }), { autocomplete: [`transform-origin-(${Object.keys(colors.positionMap).join("|")})`, `origin-(${Object.keys(colors.positionMap).join("|")})`] }],
198
198
  [/^(?:transform-)?perspect(?:ive)?-(.+)$/, ([, s]) => {
199
- const v = utilities.handler.bracket.cssvar.px.numberWithUnit(s);
199
+ const v = colors.handler.bracket.cssvar.px.numberWithUnit(s);
200
200
  if (v != null) {
201
201
  return {
202
202
  "-webkit-perspective": v,
@@ -205,7 +205,7 @@ const transforms = [
205
205
  }
206
206
  }],
207
207
  [/^(?:transform-)?perspect(?:ive)?-origin-(.+)$/, ([, s]) => {
208
- const v = utilities.handler.bracket.cssvar(s) ?? (s.length >= 3 ? utilities.positionMap[s] : void 0);
208
+ const v = colors.handler.bracket.cssvar(s) ?? (s.length >= 3 ? colors.positionMap[s] : void 0);
209
209
  if (v != null) {
210
210
  return {
211
211
  "-webkit-perspective-origin": v,
@@ -226,28 +226,28 @@ const transforms = [
226
226
  ["transform-cpu", { transform: transformCpu }],
227
227
  ["transform-gpu", { transform: transformGpu }],
228
228
  ["transform-none", { transform: "none" }],
229
- ...utilities.makeGlobalStaticRules("transform")
229
+ ...colors.makeGlobalStaticRules("transform")
230
230
  ];
231
231
  function handleTranslate([, d, b], { theme }) {
232
- const v = theme.spacing?.[b] ?? utilities.handler.bracket.cssvar.fraction.rem(b);
232
+ const v = theme.spacing?.[b] ?? colors.handler.bracket.cssvar.fraction.rem(b);
233
233
  if (v != null) {
234
234
  return [
235
- ...utilities.xyzMap[d].map((i) => [`--un-translate${i}`, v]),
235
+ ...colors.xyzMap[d].map((i) => [`--un-translate${i}`, v]),
236
236
  ["transform", transformCpu]
237
237
  ];
238
238
  }
239
239
  }
240
240
  function handleScale([, d, b]) {
241
- const v = utilities.handler.bracket.cssvar.fraction.percent(b);
241
+ const v = colors.handler.bracket.cssvar.fraction.percent(b);
242
242
  if (v != null) {
243
243
  return [
244
- ...utilities.xyzMap[d].map((i) => [`--un-scale${i}`, v]),
244
+ ...colors.xyzMap[d].map((i) => [`--un-scale${i}`, v]),
245
245
  ["transform", transformCpu]
246
246
  ];
247
247
  }
248
248
  }
249
249
  function handleRotate([, d = "", b]) {
250
- const v = utilities.handler.bracket.cssvar.degree(b);
250
+ const v = colors.handler.bracket.cssvar.degree(b);
251
251
  if (v != null) {
252
252
  if (d) {
253
253
  return {
@@ -267,7 +267,7 @@ function handleRotate([, d = "", b]) {
267
267
  }
268
268
  }
269
269
  function handleSkew([, d, b]) {
270
- const v = utilities.handler.bracket.cssvar.degree(b);
270
+ const v = colors.handler.bracket.cssvar.degree(b);
271
271
  if (v != null) {
272
272
  return {
273
273
  [`--un-skew-${d}`]: v,
@@ -1,7 +1,7 @@
1
- import { h as handler, m as makeGlobalStaticRules, g as globalKeywords, c as colorResolver, i as colorableShadows, n as positionMap, x as xyzMap } from './utilities.mjs';
1
+ import { h as handler, m as makeGlobalStaticRules, g as globalKeywords, c as colorResolver, i as colorableShadows, o as positionMap, x as xyzMap } from './colors2.mjs';
2
2
 
3
3
  const cursorValues = ["auto", "default", "none", "context-menu", "help", "pointer", "progress", "wait", "cell", "crosshair", "text", "vertical-text", "alias", "copy", "move", "no-drop", "not-allowed", "grab", "grabbing", "all-scroll", "col-resize", "row-resize", "n-resize", "e-resize", "s-resize", "w-resize", "ne-resize", "nw-resize", "se-resize", "sw-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "zoom-in", "zoom-out"];
4
- const varEmpty = "var(--un-empty,/*!*/ /*!*/)";
4
+ const varEmpty = " ";
5
5
  const displays = [
6
6
  ["inline", { display: "inline" }],
7
7
  ["block", { display: "block" }],
@@ -101,7 +101,7 @@ const ringBase = {
101
101
  "--un-ring-offset-color": "#fff",
102
102
  "--un-ring-width": "0px",
103
103
  "--un-ring-color": "rgba(147,197,253,0.5)",
104
- "--un-shadow": "0 0 #0000"
104
+ "--un-shadow": "0 0 rgba(0,0,0,0)"
105
105
  };
106
106
  const rings = [
107
107
  [/^ring(?:-(.+))?$/, ([, d], { theme }) => {
@@ -111,7 +111,7 @@ const rings = [
111
111
  "--un-ring-width": value,
112
112
  "--un-ring-offset-shadow": "var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color)",
113
113
  "--un-ring-shadow": "var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color)",
114
- "box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow, 0 0 #0000)"
114
+ "box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow)"
115
115
  };
116
116
  }
117
117
  }, { autocomplete: "ring-$ringWidth" }],
@@ -126,10 +126,10 @@ const rings = [
126
126
  ];
127
127
 
128
128
  const boxShadowsBase = {
129
- "--un-ring-offset-shadow": "0 0 #0000",
130
- "--un-ring-shadow": "0 0 #0000",
129
+ "--un-ring-offset-shadow": "0 0 rgba(0,0,0,0)",
130
+ "--un-ring-shadow": "0 0 rgba(0,0,0,0)",
131
131
  "--un-shadow-inset": varEmpty,
132
- "--un-shadow": "0 0 #0000"
132
+ "--un-shadow": "0 0 rgba(0,0,0,0)"
133
133
  };
134
134
  const boxShadows = [
135
135
  [/^shadow(?:-(.+))?$/, ([, d], { theme }) => {
@@ -137,7 +137,7 @@ const boxShadows = [
137
137
  if (v) {
138
138
  return {
139
139
  "--un-shadow": colorableShadows(v, "--un-shadow-color").join(","),
140
- "box-shadow": "var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow)"
140
+ "box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow)"
141
141
  };
142
142
  }
143
143
  }, { autocomplete: "shadow-$boxShadow" }],
package/dist/index.cjs CHANGED
@@ -7,7 +7,7 @@ const _default = require('./chunks/default.cjs');
7
7
  const _default$1 = require('./chunks/default2.cjs');
8
8
  const _default$2 = require('./chunks/default3.cjs');
9
9
  const colors = require('./chunks/colors.cjs');
10
- const utilities = require('./chunks/utilities.cjs');
10
+ const colors$1 = require('./chunks/colors2.cjs');
11
11
  require('./chunks/transform.cjs');
12
12
  require('./chunks/variants.cjs');
13
13
 
@@ -33,7 +33,8 @@ const presetMini = (options = {}) => {
33
33
  variants: _default$2.variants(options),
34
34
  options,
35
35
  postprocess: options.variablePrefix && options.variablePrefix !== "un-" ? VarPrefixPostprocessor(options.variablePrefix) : void 0,
36
- preflights
36
+ preflights,
37
+ prefix: options.prefix
37
38
  };
38
39
  };
39
40
  function VarPrefixPostprocessor(prefix) {
@@ -48,7 +49,7 @@ function VarPrefixPostprocessor(prefix) {
48
49
 
49
50
  exports.theme = _default.theme;
50
51
  exports.colors = colors.colors;
51
- exports.parseColor = utilities.parseColor;
52
+ exports.parseColor = colors$1.parseColor;
52
53
  exports["default"] = presetMini;
53
54
  exports.preflights = preflights;
54
55
  exports.presetMini = presetMini;
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import { T as Theme } from './types-9e30040a.js';
3
3
  export { T as Theme, a as ThemeAnimation } from './types-9e30040a.js';
4
4
  export { t as theme } from './default-0fe8c7f8.js';
5
5
  export { c as colors } from './colors-f2b5968c.js';
6
- export { p as parseColor } from './utilities-654ad3bd.js';
6
+ export { p as parseColor } from './utilities-b44b330d.js';
7
7
 
8
8
  declare const preflights: Preflight[];
9
9
 
@@ -20,6 +20,12 @@ interface PresetMiniOptions extends PresetOptions {
20
20
  * @default 'un-'
21
21
  */
22
22
  variablePrefix?: string;
23
+ /**
24
+ * Utils prefix
25
+ *
26
+ * @default undefined
27
+ */
28
+ prefix?: string;
23
29
  }
24
30
  declare const presetMini: (options?: PresetMiniOptions) => Preset<Theme>;
25
31
 
package/dist/index.mjs CHANGED
@@ -4,7 +4,7 @@ export { t as theme } from './chunks/default.mjs';
4
4
  import { r as rules } from './chunks/default2.mjs';
5
5
  import { v as variants } from './chunks/default3.mjs';
6
6
  export { c as colors } from './chunks/colors.mjs';
7
- export { p as parseColor } from './chunks/utilities.mjs';
7
+ export { p as parseColor } from './chunks/colors2.mjs';
8
8
  import './chunks/transform.mjs';
9
9
  import './chunks/variants.mjs';
10
10
 
@@ -30,7 +30,8 @@ const presetMini = (options = {}) => {
30
30
  variants: variants(options),
31
31
  options,
32
32
  postprocess: options.variablePrefix && options.variablePrefix !== "un-" ? VarPrefixPostprocessor(options.variablePrefix) : void 0,
33
- preflights
33
+ preflights,
34
+ prefix: options.prefix
34
35
  };
35
36
  };
36
37
  function VarPrefixPostprocessor(prefix) {
package/dist/rules.cjs CHANGED
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const _default = require('./chunks/default2.cjs');
6
6
  const transform = require('./chunks/transform.cjs');
7
- require('./chunks/utilities.cjs');
7
+ require('./chunks/colors2.cjs');
8
8
  require('@unocss/core');
9
9
 
10
10
 
package/dist/rules.d.ts CHANGED
@@ -72,7 +72,7 @@ declare const aspectRatio: Rule[];
72
72
  declare const paddings: Rule[];
73
73
  declare const margins: Rule[];
74
74
 
75
- declare const varEmpty = "var(--un-empty,/*!*/ /*!*/)";
75
+ declare const varEmpty = " ";
76
76
  declare const displays: Rule[];
77
77
  declare const appearances: Rule[];
78
78
  declare const cursors: Rule[];
package/dist/rules.mjs CHANGED
@@ -1,4 +1,4 @@
1
1
  export { m as alignments, a as appearance, A as aspectRatio, f as bgColors, b as borderStyles, c as borders, u as boxSizing, L as cssProperty, K as cssVariables, g as flex, s as floats, F as fonts, h as gaps, i as grids, q as insets, k as justifies, C as margins, d as opacity, l as orders, o as outline, j as overflows, B as paddings, n as placements, p as positions, x as questionMark, r as rules, y as sizes, D as svgUtilities, G as tabSizes, t as textAligns, e as textColors, M as textDecorations, H as textIndents, J as textShadows, I as textStrokes, E as transitions, v as verticalAligns, w as willChange, z as zIndexes } from './chunks/default2.mjs';
2
2
  export { k as appearances, h as boxShadows, b as boxShadowsBase, m as breaks, c as contents, j as cursors, d as displays, g as fontSmoothings, f as fontStyles, p as pointerEvents, l as resizes, r as ringBase, i as rings, a as textOverflows, e as textTransforms, t as transformBase, n as transforms, u as userSelects, v as varEmpty, w as whitespaces } from './chunks/transform.mjs';
3
- import './chunks/utilities.mjs';
3
+ import './chunks/colors2.mjs';
4
4
  import '@unocss/core';
package/dist/theme.cjs CHANGED
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const colors = require('./chunks/colors.cjs');
6
6
  const _default = require('./chunks/default.cjs');
7
7
  require('./chunks/transform.cjs');
8
- require('./chunks/utilities.cjs');
8
+ require('./chunks/colors2.cjs');
9
9
  require('@unocss/core');
10
10
 
11
11
 
package/dist/theme.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  export { c as colors } from './chunks/colors.mjs';
2
2
  export { p as baseSize, b as blur, m as borderRadius, n as boxShadow, i as breakpoints, d as dropShadow, k as duration, o as easing, f as fontFamily, a as fontSize, x as height, h as letterSpacing, l as lineHeight, j as lineWidth, y as maxHeight, u as maxWidth, z as preflightBase, r as ringWidth, s as spacing, c as textIndent, g as textShadow, e as textStrokeWidth, t as theme, v as verticalBreakpoints, q as width, w as wordSpacing } from './chunks/default.mjs';
3
3
  import './chunks/transform.mjs';
4
- import './chunks/utilities.mjs';
4
+ import './chunks/colors2.mjs';
5
5
  import '@unocss/core';
@@ -56,5 +56,7 @@ declare const hasParseableColor: (color: string | undefined, theme: Theme) => bo
56
56
  declare const resolveBreakpoints: ({ theme, generator }: Readonly<VariantContext<Theme>>) => Record<string, string> | undefined;
57
57
  declare const resolveVerticalBreakpoints: ({ theme, generator }: Readonly<VariantContext<Theme>>) => Record<string, string> | undefined;
58
58
  declare const makeGlobalStaticRules: (prefix: string, property?: string) => Rule<{}>[];
59
+ declare function getComponent(str: string, open: string, close: string, separator: string): string[] | undefined;
60
+ declare function getComponents(str: string, separator: string, limit?: number): string[] | undefined;
59
61
 
60
- export { CONTROL_MINI_NO_NEGATIVE as C, colorableShadows as a, resolveVerticalBreakpoints as b, colorResolver as c, directionSize as d, hasParseableColor as h, makeGlobalStaticRules as m, parseColor as p, resolveBreakpoints as r };
62
+ export { CONTROL_MINI_NO_NEGATIVE as C, colorableShadows as a, resolveVerticalBreakpoints as b, colorResolver as c, directionSize as d, getComponents as e, getComponent as g, hasParseableColor as h, makeGlobalStaticRules as m, parseColor as p, resolveBreakpoints as r };
package/dist/utils.cjs CHANGED
@@ -2,34 +2,35 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const utilities = require('./chunks/utilities.cjs');
5
+ const colors = require('./chunks/colors2.cjs');
6
6
  const variants = require('./chunks/variants.cjs');
7
7
  require('@unocss/core');
8
8
 
9
9
 
10
10
 
11
- exports.CONTROL_MINI_NO_NEGATIVE = utilities.CONTROL_MINI_NO_NEGATIVE;
12
- exports.colorOpacityToString = utilities.colorOpacityToString;
13
- exports.colorResolver = utilities.colorResolver;
14
- exports.colorToString = utilities.colorToString;
15
- exports.colorableShadows = utilities.colorableShadows;
16
- exports.cornerMap = utilities.cornerMap;
17
- exports.directionMap = utilities.directionMap;
18
- exports.directionSize = utilities.directionSize;
19
- exports.getComponents = utilities.getComponents;
20
- exports.globalKeywords = utilities.globalKeywords;
21
- exports.h = utilities.h;
22
- exports.handler = utilities.handler;
23
- exports.hasParseableColor = utilities.hasParseableColor;
24
- exports.hex2rgba = utilities.hex2rgba;
25
- exports.insetMap = utilities.insetMap;
26
- exports.makeGlobalStaticRules = utilities.makeGlobalStaticRules;
27
- exports.parseColor = utilities.parseColor;
28
- exports.parseCssColor = utilities.parseCssColor;
29
- exports.positionMap = utilities.positionMap;
30
- exports.resolveBreakpoints = utilities.resolveBreakpoints;
31
- exports.resolveVerticalBreakpoints = utilities.resolveVerticalBreakpoints;
32
- exports.valueHandlers = utilities.valueHandlers;
33
- exports.xyzMap = utilities.xyzMap;
11
+ exports.CONTROL_MINI_NO_NEGATIVE = colors.CONTROL_MINI_NO_NEGATIVE;
12
+ exports.colorOpacityToString = colors.colorOpacityToString;
13
+ exports.colorResolver = colors.colorResolver;
14
+ exports.colorToString = colors.colorToString;
15
+ exports.colorableShadows = colors.colorableShadows;
16
+ exports.cornerMap = colors.cornerMap;
17
+ exports.directionMap = colors.directionMap;
18
+ exports.directionSize = colors.directionSize;
19
+ exports.getComponent = colors.getComponent;
20
+ exports.getComponents = colors.getComponents;
21
+ exports.globalKeywords = colors.globalKeywords;
22
+ exports.h = colors.h;
23
+ exports.handler = colors.handler;
24
+ exports.hasParseableColor = colors.hasParseableColor;
25
+ exports.hex2rgba = colors.hex2rgba;
26
+ exports.insetMap = colors.insetMap;
27
+ exports.makeGlobalStaticRules = colors.makeGlobalStaticRules;
28
+ exports.parseColor = colors.parseColor;
29
+ exports.parseCssColor = colors.parseCssColor;
30
+ exports.positionMap = colors.positionMap;
31
+ exports.resolveBreakpoints = colors.resolveBreakpoints;
32
+ exports.resolveVerticalBreakpoints = colors.resolveVerticalBreakpoints;
33
+ exports.valueHandlers = colors.valueHandlers;
34
+ exports.xyzMap = colors.xyzMap;
34
35
  exports.variantMatcher = variants.variantMatcher;
35
36
  exports.variantParentMatcher = variants.variantParentMatcher;
package/dist/utils.d.ts CHANGED
@@ -1,13 +1,12 @@
1
1
  import * as _unocss_core from '@unocss/core';
2
2
  import { RGBAColorValue, CSSColorValue, VariantHandlerContext, VariantObject } from '@unocss/core';
3
- export { C as CONTROL_MINI_NO_NEGATIVE, c as colorResolver, a as colorableShadows, d as directionSize, h as hasParseableColor, m as makeGlobalStaticRules, p as parseColor, r as resolveBreakpoints, b as resolveVerticalBreakpoints } from './utilities-654ad3bd.js';
3
+ export { C as CONTROL_MINI_NO_NEGATIVE, c as colorResolver, a as colorableShadows, d as directionSize, g as getComponent, e as getComponents, h as hasParseableColor, m as makeGlobalStaticRules, p as parseColor, r as resolveBreakpoints, b as resolveVerticalBreakpoints } from './utilities-b44b330d.js';
4
4
  import './types-9e30040a.js';
5
5
 
6
6
  declare function hex2rgba(hex?: string): RGBAColorValue | undefined;
7
7
  declare function parseCssColor(str?: string): CSSColorValue | undefined;
8
8
  declare function colorOpacityToString(color: CSSColorValue): string | number;
9
9
  declare function colorToString(color: CSSColorValue | string, alphaOverride?: string | number): string;
10
- declare function getComponents(str: string, separator?: string, limit?: number): string[] | undefined;
11
10
 
12
11
  declare const directionMap: Record<string, string[]>;
13
12
  declare const insetMap: Record<string, string[]>;
@@ -79,4 +78,4 @@ declare const h: _unocss_core.ValueHandler<"number" | "auto" | "global" | "posit
79
78
  declare const variantMatcher: (name: string, handler: (input: VariantHandlerContext) => Record<string, any>) => VariantObject;
80
79
  declare const variantParentMatcher: (name: string, parent: string) => VariantObject;
81
80
 
82
- export { colorOpacityToString, colorToString, cornerMap, directionMap, getComponents, globalKeywords, h, handler, hex2rgba, insetMap, parseCssColor, positionMap, handlers as valueHandlers, variantMatcher, variantParentMatcher, xyzMap };
81
+ export { colorOpacityToString, colorToString, cornerMap, directionMap, globalKeywords, h, handler, hex2rgba, insetMap, parseCssColor, positionMap, handlers as valueHandlers, variantMatcher, variantParentMatcher, xyzMap };