@unocss/preset-mini 0.49.4 → 0.49.5

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 CHANGED
@@ -3,13 +3,13 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const core = require('@unocss/core');
6
- require('./shared/preset-mini.b2a92d2d.cjs');
7
- const colors$1 = require('./shared/preset-mini.87096f14.cjs');
8
- const _default$1 = require('./shared/preset-mini.6fee3361.cjs');
6
+ require('./shared/preset-mini.df9c634c.cjs');
7
+ const colors$1 = require('./shared/preset-mini.f9ff00ee.cjs');
8
+ const _default$1 = require('./shared/preset-mini.aca68d93.cjs');
9
9
  const colors = require('./shared/preset-mini.30606736.cjs');
10
- const _default = require('./shared/preset-mini.62e01fcd.cjs');
11
- const _default$2 = require('./shared/preset-mini.7c26129e.cjs');
12
- require('./shared/preset-mini.36f890d6.cjs');
10
+ const _default = require('./shared/preset-mini.2341d2ee.cjs');
11
+ const _default$2 = require('./shared/preset-mini.52ab4b0f.cjs');
12
+ require('./shared/preset-mini.7086e6db.cjs');
13
13
 
14
14
  const preflights = [
15
15
  {
package/dist/index.d.ts CHANGED
@@ -29,7 +29,7 @@ interface PresetMiniOptions extends PresetOptions {
29
29
  */
30
30
  dark?: 'class' | 'media' | DarkModeSelectors;
31
31
  /**
32
- * Generate pesudo selector as `[group=""]` instead of `.group`
32
+ * Generate psuedo selector as `[group=""]` instead of `.group`
33
33
  *
34
34
  * @default false
35
35
  */
package/dist/index.mjs CHANGED
@@ -1,12 +1,12 @@
1
1
  import { entriesToCss, toArray } from '@unocss/core';
2
- import './shared/preset-mini.91445aa5.mjs';
3
- export { p as parseColor } from './shared/preset-mini.1f0aea1e.mjs';
4
- import { r as rules } from './shared/preset-mini.d77e50e3.mjs';
2
+ import './shared/preset-mini.86be0521.mjs';
3
+ export { p as parseColor } from './shared/preset-mini.5eaf6188.mjs';
4
+ import { r as rules } from './shared/preset-mini.34e0c9b9.mjs';
5
5
  export { c as colors } from './shared/preset-mini.65ac75be.mjs';
6
- import { t as theme } from './shared/preset-mini.abaf1689.mjs';
7
- export { t as theme } from './shared/preset-mini.abaf1689.mjs';
8
- import { v as variants } from './shared/preset-mini.7e22fc5d.mjs';
9
- import './shared/preset-mini.354ecb56.mjs';
6
+ import { t as theme } from './shared/preset-mini.76eb599a.mjs';
7
+ export { t as theme } from './shared/preset-mini.76eb599a.mjs';
8
+ import { v as variants } from './shared/preset-mini.9f800526.mjs';
9
+ import './shared/preset-mini.ca55daef.mjs';
10
10
 
11
11
  const preflights = [
12
12
  {
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.b2a92d2d.cjs');
6
- const _default = require('./shared/preset-mini.6fee3361.cjs');
7
- require('./shared/preset-mini.87096f14.cjs');
5
+ const transform = require('./shared/preset-mini.df9c634c.cjs');
6
+ const _default = require('./shared/preset-mini.aca68d93.cjs');
7
+ require('./shared/preset-mini.f9ff00ee.cjs');
8
8
  require('@unocss/core');
9
9
 
10
10
 
package/dist/rules.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { F as alignments, C as appearance, s as appearances, S as borderStyles, b as borders, o as boxShadows, Q as boxShadowsBase, K as boxSizing, z as breaks, O as contains, c as contentVisibility, a as contents, q as cursors, d as displays, I as floats, n as fontSmoothings, m as fontStyles, f as fonts, T as handlerBorderStyle, H as insets, E as justifies, D as orders, B as outline, A as overflows, G as placements, u as pointerEvents, p as positions, v as resizes, R as ringBase, r as rings, t as tabSizes, l as textAligns, h as textDecorations, e as textIndents, g as textOverflows, j as textShadows, i as textStrokes, k as textTransforms, P as transformBase, M as transforms, L as transitions, x as userSelects, U as varEmpty, w as verticalAligns, y as whitespaces, N as willChange, J as zIndexes } from './shared/preset-mini.91445aa5.mjs';
2
- export { d as aspectRatio, b as bgColors, c as containerParent, i as cssProperty, h as cssVariables, f as flex, g as gaps, a as grids, m as margins, o as opacity, p as paddings, q as questionMark, r as rules, s as sizes, e as svgUtilities, t as textColors } from './shared/preset-mini.d77e50e3.mjs';
3
- import './shared/preset-mini.1f0aea1e.mjs';
1
+ export { F as alignments, C as appearance, s as appearances, S as borderStyles, b as borders, o as boxShadows, Q as boxShadowsBase, K as boxSizing, z as breaks, O as contains, c as contentVisibility, a as contents, q as cursors, d as displays, I as floats, n as fontSmoothings, m as fontStyles, f as fonts, T as handlerBorderStyle, H as insets, E as justifies, D as orders, B as outline, A as overflows, G as placements, u as pointerEvents, p as positions, v as resizes, R as ringBase, r as rings, t as tabSizes, l as textAligns, h as textDecorations, e as textIndents, g as textOverflows, j as textShadows, i as textStrokes, k as textTransforms, P as transformBase, M as transforms, L as transitions, x as userSelects, U as varEmpty, w as verticalAligns, y as whitespaces, N as willChange, J as zIndexes } from './shared/preset-mini.86be0521.mjs';
2
+ export { d as aspectRatio, b as bgColors, c as containerParent, i as cssProperty, h as cssVariables, f as flex, g as gaps, a as grids, m as margins, o as opacity, p as paddings, q as questionMark, r as rules, s as sizes, e as svgUtilities, t as textColors } from './shared/preset-mini.34e0c9b9.mjs';
3
+ import './shared/preset-mini.5eaf6188.mjs';
4
4
  import '@unocss/core';
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  const colors = require('./preset-mini.30606736.cjs');
4
- const transform = require('./preset-mini.b2a92d2d.cjs');
5
- require('./preset-mini.87096f14.cjs');
4
+ const transform = require('./preset-mini.df9c634c.cjs');
5
+ require('./preset-mini.f9ff00ee.cjs');
6
6
  require('@unocss/core');
7
7
 
8
8
  const fontFamily = {
@@ -109,11 +109,11 @@ const breakpoints = {
109
109
  const verticalBreakpoints = { ...breakpoints };
110
110
  const lineWidth = {
111
111
  DEFAULT: "1px",
112
- none: "0px"
112
+ none: "0"
113
113
  };
114
114
  const spacing = {
115
115
  "DEFAULT": "1rem",
116
- "none": "0rem",
116
+ "none": "0",
117
117
  "xs": "0.75rem",
118
118
  "sm": "0.875rem",
119
119
  "lg": "1.125rem",
@@ -129,7 +129,7 @@ const spacing = {
129
129
  };
130
130
  const duration = {
131
131
  DEFAULT: "150ms",
132
- none: "0ms",
132
+ none: "0s",
133
133
  75: "75ms",
134
134
  100: "100ms",
135
135
  150: "150ms",
@@ -141,7 +141,7 @@ const duration = {
141
141
  };
142
142
  const borderRadius = {
143
143
  "DEFAULT": "0.25rem",
144
- "none": "0rem",
144
+ "none": "0",
145
145
  "sm": "0.125rem",
146
146
  "md": "0.375rem",
147
147
  "lg": "0.5rem",
@@ -169,7 +169,7 @@ const easing = {
169
169
  };
170
170
  const ringWidth = {
171
171
  DEFAULT: "1px",
172
- none: "0px"
172
+ none: "0"
173
173
  };
174
174
 
175
175
  const blur = {
@@ -1,5 +1,5 @@
1
- import { d as displays, b as borders, c as contentVisibility, a as contents, f as fonts, t as tabSizes, e as textIndents, g as textOverflows, h as textDecorations, i as textStrokes, j as textShadows, k as textTransforms, l as textAligns, m as fontStyles, n as fontSmoothings, o as boxShadows, r as rings, p as positions, q as cursors, s as appearances, u as pointerEvents, v as resizes, w as verticalAligns, x as userSelects, y as whitespaces, z as breaks, A as overflows, B as outline, C as appearance, D as orders, E as justifies, F as alignments, G as placements, H as insets, I as floats, J as zIndexes, K as boxSizing, L as transitions, M as transforms, N as willChange, O as contains } from './preset-mini.91445aa5.mjs';
2
- import { h as handler, c as colorResolver, n as numberWithUnitRE, r as resolveVerticalBreakpoints, l as resolveBreakpoints, o as directionSize } from './preset-mini.1f0aea1e.mjs';
1
+ import { d as displays, b as borders, c as contentVisibility, a as contents, f as fonts, t as tabSizes, e as textIndents, g as textOverflows, h as textDecorations, i as textStrokes, j as textShadows, k as textTransforms, l as textAligns, m as fontStyles, n as fontSmoothings, o as boxShadows, r as rings, p as positions, q as cursors, s as appearances, u as pointerEvents, v as resizes, w as verticalAligns, x as userSelects, y as whitespaces, z as breaks, A as overflows, B as outline, C as appearance, D as orders, E as justifies, F as alignments, G as placements, H as insets, I as floats, J as zIndexes, K as boxSizing, L as transitions, M as transforms, N as willChange, O as contains } from './preset-mini.86be0521.mjs';
2
+ import { h as handler, c as colorResolver, n as numberWithUnitRE, r as resolveVerticalBreakpoints, l as resolveBreakpoints, o as directionSize } from './preset-mini.5eaf6188.mjs';
3
3
  import { warnOnce } from '@unocss/core';
4
4
 
5
5
  const opacity = [
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- const colors = require('./preset-mini.87096f14.cjs');
3
+ const colors = require('./preset-mini.f9ff00ee.cjs');
4
4
  const core = require('@unocss/core');
5
- const variants$1 = require('./preset-mini.36f890d6.cjs');
5
+ const variants$1 = require('./preset-mini.7086e6db.cjs');
6
6
 
7
7
  const variantAria = {
8
8
  name: "aria",
@@ -454,6 +454,7 @@ const PseudoClasses = Object.fromEntries([
454
454
  ["last", ":last-child"],
455
455
  "only-child",
456
456
  "only-of-type",
457
+ ["backdrop-element", "::backdrop"],
457
458
  ["placeholder", "::placeholder"],
458
459
  ["before", "::before"],
459
460
  ["after", "::after"],
@@ -473,9 +474,13 @@ const PseudoClassFunctions = [
473
474
  const PseudoClassesStr = Object.entries(PseudoClasses).filter(([, pseudo]) => !pseudo.startsWith("::")).map(([key]) => key).join("|");
474
475
  const PseudoClassesColonStr = Object.entries(PseudoClassesColon).filter(([, pseudo]) => !pseudo.startsWith("::")).map(([key]) => key).join("|");
475
476
  const PseudoClassFunctionsStr = PseudoClassFunctions.join("|");
476
- const sortValue = (pseudo) => {
477
- if (pseudo === "active")
478
- return 1;
477
+ const pseudoModifier = (pseudo) => {
478
+ if (pseudo === "active") {
479
+ return {
480
+ sort: 1,
481
+ noMerge: true
482
+ };
483
+ }
479
484
  };
480
485
  const taggedPseudoClassMatcher = (tag, parent, combinator) => {
481
486
  const rawRE = new RegExp(`^(${core.escapeRegExp(parent)}:)(\\S+)${core.escapeRegExp(combinator)}\\1`);
@@ -511,7 +516,7 @@ const taggedPseudoClassMatcher = (tag, parent, combinator) => {
511
516
  label,
512
517
  input.slice(original.length),
513
518
  `${parent}${core.escapeSelector(label)}${pseudo}`,
514
- sortValue(pseudoKey)
519
+ pseudoKey
515
520
  ];
516
521
  };
517
522
  return {
@@ -527,16 +532,16 @@ const taggedPseudoClassMatcher = (tag, parent, combinator) => {
527
532
  const result = matchBracket(input) || matchPseudo(input);
528
533
  if (!result)
529
534
  return;
530
- const [label, matcher, prefix, sort] = result;
535
+ const [label, matcher, prefix, pseudoName = ""] = result;
531
536
  if (label !== "")
532
537
  core.warnOnce("The labeled variant is experimental and may not follow semver.");
533
538
  return {
534
539
  matcher,
535
540
  handle: (input2, next) => next({
536
541
  ...input2,
537
- prefix: `${prefix}${combinator}${input2.prefix}`.replace(rawRE, "$1$2:")
538
- }),
539
- sort
542
+ prefix: `${prefix}${combinator}${input2.prefix}`.replace(rawRE, "$1$2:"),
543
+ ...pseudoModifier(pseudoName)
544
+ })
540
545
  };
541
546
  },
542
547
  multiPass: true
@@ -568,7 +573,7 @@ const variantPseudoClassesAndElements = () => {
568
573
  return next({
569
574
  ...input2,
570
575
  ...selectors,
571
- sort: sortValue(match[1])
576
+ ...pseudoModifier(match[1])
572
577
  });
573
578
  }
574
579
  };
@@ -187,8 +187,11 @@ function rem(str) {
187
187
  return;
188
188
  const [, n, unit] = match;
189
189
  const num = parseFloat(n);
190
- if (!Number.isNaN(num))
190
+ if (!Number.isNaN(num)) {
191
+ if (num === 0)
192
+ return "0";
191
193
  return unit ? `${round(num)}${unit}` : `${round(num / 4)}rem`;
194
+ }
192
195
  }
193
196
  function px(str) {
194
197
  if (str.match(unitOnlyRE))
@@ -198,8 +201,11 @@ function px(str) {
198
201
  return;
199
202
  const [, n, unit] = match;
200
203
  const num = parseFloat(n);
201
- if (!Number.isNaN(num))
204
+ if (!Number.isNaN(num)) {
205
+ if (num === 0)
206
+ return "0";
202
207
  return unit ? `${round(num)}${unit}` : `${round(num)}px`;
208
+ }
203
209
  }
204
210
  function number(str) {
205
211
  if (!numberRE.test(str))
@@ -220,8 +226,11 @@ function fraction(str) {
220
226
  return "100%";
221
227
  const [left, right] = str.split("/");
222
228
  const num = parseFloat(left) / parseFloat(right);
223
- if (!Number.isNaN(num))
229
+ if (!Number.isNaN(num)) {
230
+ if (num === 0)
231
+ return "0";
224
232
  return `${round(num * 100)}%`;
233
+ }
225
234
  }
226
235
  const bracketTypeRe = /^\[(color|length|position|quoted|string):/i;
227
236
  function bracketWithType(str, requiredType) {
@@ -287,8 +296,11 @@ function time(str) {
287
296
  return;
288
297
  const [, n, unit] = match;
289
298
  const num = parseFloat(n);
290
- if (!Number.isNaN(num))
299
+ if (!Number.isNaN(num)) {
300
+ if (num === 0 && !unit)
301
+ return "0s";
291
302
  return unit ? `${round(num)}${unit}` : `${round(num)}ms`;
303
+ }
292
304
  }
293
305
  function degree(str) {
294
306
  const match = str.match(/^(-?[0-9.]+)(deg|rad|grad|turn)?$/i);
@@ -296,8 +308,11 @@ function degree(str) {
296
308
  return;
297
309
  const [, n, unit] = match;
298
310
  const num = parseFloat(n);
299
- if (!Number.isNaN(num))
311
+ if (!Number.isNaN(num)) {
312
+ if (num === 0)
313
+ return "0";
300
314
  return unit ? `${round(num)}${unit}` : `${round(num)}deg`;
315
+ }
301
316
  }
302
317
  function global(str) {
303
318
  if (globalKeywords.includes(str))
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const core = require('@unocss/core');
4
- const colors = require('./preset-mini.87096f14.cjs');
4
+ const colors = require('./preset-mini.f9ff00ee.cjs');
5
5
 
6
6
  const variantMatcher = (name, handler) => {
7
7
  let re;
@@ -1,6 +1,6 @@
1
1
  import { c as colors } from './preset-mini.65ac75be.mjs';
2
- import { P as transformBase, Q as boxShadowsBase, R as ringBase } from './preset-mini.91445aa5.mjs';
3
- import './preset-mini.1f0aea1e.mjs';
2
+ import { P as transformBase, Q as boxShadowsBase, R as ringBase } from './preset-mini.86be0521.mjs';
3
+ import './preset-mini.5eaf6188.mjs';
4
4
  import '@unocss/core';
5
5
 
6
6
  const fontFamily = {
@@ -107,11 +107,11 @@ const breakpoints = {
107
107
  const verticalBreakpoints = { ...breakpoints };
108
108
  const lineWidth = {
109
109
  DEFAULT: "1px",
110
- none: "0px"
110
+ none: "0"
111
111
  };
112
112
  const spacing = {
113
113
  "DEFAULT": "1rem",
114
- "none": "0rem",
114
+ "none": "0",
115
115
  "xs": "0.75rem",
116
116
  "sm": "0.875rem",
117
117
  "lg": "1.125rem",
@@ -127,7 +127,7 @@ const spacing = {
127
127
  };
128
128
  const duration = {
129
129
  DEFAULT: "150ms",
130
- none: "0ms",
130
+ none: "0s",
131
131
  75: "75ms",
132
132
  100: "100ms",
133
133
  150: "150ms",
@@ -139,7 +139,7 @@ const duration = {
139
139
  };
140
140
  const borderRadius = {
141
141
  "DEFAULT": "0.25rem",
142
- "none": "0rem",
142
+ "none": "0",
143
143
  "sm": "0.125rem",
144
144
  "md": "0.375rem",
145
145
  "lg": "0.5rem",
@@ -167,7 +167,7 @@ const easing = {
167
167
  };
168
168
  const ringWidth = {
169
169
  DEFAULT: "1px",
170
- none: "0px"
170
+ none: "0"
171
171
  };
172
172
 
173
173
  const blur = {
@@ -1,4 +1,4 @@
1
- import { g as globalKeywords, h as handler, c as colorResolver, d as directionMap, a as hasParseableColor, b as cornerMap, p as parseColor, e as colorToString, f as colorOpacityToString, m as makeGlobalStaticRules, s as splitShorthand, i as colorableShadows, j as insetMap, k as positionMap, x as xyzMap } from './preset-mini.1f0aea1e.mjs';
1
+ import { g as globalKeywords, h as handler, c as colorResolver, d as directionMap, a as hasParseableColor, b as cornerMap, p as parseColor, e as colorToString, f as colorOpacityToString, m as makeGlobalStaticRules, s as splitShorthand, i as colorableShadows, j as insetMap, k as positionMap, x as xyzMap } from './preset-mini.5eaf6188.mjs';
2
2
  import { toArray } from '@unocss/core';
3
3
 
4
4
  const verticalAlignAlias = {
@@ -235,15 +235,16 @@ const fonts = [
235
235
  const sizePairs = toArray(theme.fontSize?.[size]);
236
236
  const lineHeight = leading ? handleLineHeight(leading, theme) : void 0;
237
237
  if (sizePairs?.[0]) {
238
- const [fontSize, height] = sizePairs;
238
+ const [fontSize2, height] = sizePairs;
239
239
  return {
240
- "font-size": fontSize,
240
+ "font-size": fontSize2,
241
241
  "line-height": lineHeight ?? height ?? "1"
242
242
  };
243
243
  }
244
- if (lineHeight) {
244
+ const fontSize = handler.bracketOfLength.rem(size);
245
+ if (lineHeight && fontSize) {
245
246
  return {
246
- "font-size": handler.bracketOfLength.rem(size),
247
+ "font-size": fontSize,
247
248
  "line-height": lineHeight
248
249
  };
249
250
  }
@@ -1,6 +1,6 @@
1
- import { h as handler, l as resolveBreakpoints, q as getBracket, C as CONTROL_MINI_NO_NEGATIVE, t as getComponent } from './preset-mini.1f0aea1e.mjs';
1
+ import { h as handler, l as resolveBreakpoints, q as getBracket, C as CONTROL_MINI_NO_NEGATIVE, t as getComponent } from './preset-mini.5eaf6188.mjs';
2
2
  import { warnOnce, escapeRegExp, escapeSelector } from '@unocss/core';
3
- import { v as variantGetParameter, a as variantGetBracket, b as variantMatcher, c as variantParentMatcher } from './preset-mini.354ecb56.mjs';
3
+ import { v as variantGetParameter, a as variantGetBracket, b as variantMatcher, c as variantParentMatcher } from './preset-mini.ca55daef.mjs';
4
4
 
5
5
  const variantAria = {
6
6
  name: "aria",
@@ -452,6 +452,7 @@ const PseudoClasses = Object.fromEntries([
452
452
  ["last", ":last-child"],
453
453
  "only-child",
454
454
  "only-of-type",
455
+ ["backdrop-element", "::backdrop"],
455
456
  ["placeholder", "::placeholder"],
456
457
  ["before", "::before"],
457
458
  ["after", "::after"],
@@ -471,9 +472,13 @@ const PseudoClassFunctions = [
471
472
  const PseudoClassesStr = Object.entries(PseudoClasses).filter(([, pseudo]) => !pseudo.startsWith("::")).map(([key]) => key).join("|");
472
473
  const PseudoClassesColonStr = Object.entries(PseudoClassesColon).filter(([, pseudo]) => !pseudo.startsWith("::")).map(([key]) => key).join("|");
473
474
  const PseudoClassFunctionsStr = PseudoClassFunctions.join("|");
474
- const sortValue = (pseudo) => {
475
- if (pseudo === "active")
476
- return 1;
475
+ const pseudoModifier = (pseudo) => {
476
+ if (pseudo === "active") {
477
+ return {
478
+ sort: 1,
479
+ noMerge: true
480
+ };
481
+ }
477
482
  };
478
483
  const taggedPseudoClassMatcher = (tag, parent, combinator) => {
479
484
  const rawRE = new RegExp(`^(${escapeRegExp(parent)}:)(\\S+)${escapeRegExp(combinator)}\\1`);
@@ -509,7 +514,7 @@ const taggedPseudoClassMatcher = (tag, parent, combinator) => {
509
514
  label,
510
515
  input.slice(original.length),
511
516
  `${parent}${escapeSelector(label)}${pseudo}`,
512
- sortValue(pseudoKey)
517
+ pseudoKey
513
518
  ];
514
519
  };
515
520
  return {
@@ -525,16 +530,16 @@ const taggedPseudoClassMatcher = (tag, parent, combinator) => {
525
530
  const result = matchBracket(input) || matchPseudo(input);
526
531
  if (!result)
527
532
  return;
528
- const [label, matcher, prefix, sort] = result;
533
+ const [label, matcher, prefix, pseudoName = ""] = result;
529
534
  if (label !== "")
530
535
  warnOnce("The labeled variant is experimental and may not follow semver.");
531
536
  return {
532
537
  matcher,
533
538
  handle: (input2, next) => next({
534
539
  ...input2,
535
- prefix: `${prefix}${combinator}${input2.prefix}`.replace(rawRE, "$1$2:")
536
- }),
537
- sort
540
+ prefix: `${prefix}${combinator}${input2.prefix}`.replace(rawRE, "$1$2:"),
541
+ ...pseudoModifier(pseudoName)
542
+ })
538
543
  };
539
544
  },
540
545
  multiPass: true
@@ -566,7 +571,7 @@ const variantPseudoClassesAndElements = () => {
566
571
  return next({
567
572
  ...input2,
568
573
  ...selectors,
569
- sort: sortValue(match[1])
574
+ ...pseudoModifier(match[1])
570
575
  });
571
576
  }
572
577
  };
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- const transform = require('./preset-mini.b2a92d2d.cjs');
4
- const colors = require('./preset-mini.87096f14.cjs');
3
+ const transform = require('./preset-mini.df9c634c.cjs');
4
+ const colors = require('./preset-mini.f9ff00ee.cjs');
5
5
  const core = require('@unocss/core');
6
6
 
7
7
  const opacity = [
@@ -1,5 +1,5 @@
1
1
  import { escapeRegExp } from '@unocss/core';
2
- import { q as getBracket } from './preset-mini.1f0aea1e.mjs';
2
+ import { q as getBracket } from './preset-mini.5eaf6188.mjs';
3
3
 
4
4
  const variantMatcher = (name, handler) => {
5
5
  let re;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const colors = require('./preset-mini.87096f14.cjs');
3
+ const colors = require('./preset-mini.f9ff00ee.cjs');
4
4
  const core = require('@unocss/core');
5
5
 
6
6
  const verticalAlignAlias = {
@@ -237,15 +237,16 @@ const fonts = [
237
237
  const sizePairs = core.toArray(theme.fontSize?.[size]);
238
238
  const lineHeight = leading ? handleLineHeight(leading, theme) : void 0;
239
239
  if (sizePairs?.[0]) {
240
- const [fontSize, height] = sizePairs;
240
+ const [fontSize2, height] = sizePairs;
241
241
  return {
242
- "font-size": fontSize,
242
+ "font-size": fontSize2,
243
243
  "line-height": lineHeight ?? height ?? "1"
244
244
  };
245
245
  }
246
- if (lineHeight) {
246
+ const fontSize = colors.handler.bracketOfLength.rem(size);
247
+ if (lineHeight && fontSize) {
247
248
  return {
248
- "font-size": colors.handler.bracketOfLength.rem(size),
249
+ "font-size": fontSize,
249
250
  "line-height": lineHeight
250
251
  };
251
252
  }
@@ -189,8 +189,11 @@ function rem(str) {
189
189
  return;
190
190
  const [, n, unit] = match;
191
191
  const num = parseFloat(n);
192
- if (!Number.isNaN(num))
192
+ if (!Number.isNaN(num)) {
193
+ if (num === 0)
194
+ return "0";
193
195
  return unit ? `${round(num)}${unit}` : `${round(num / 4)}rem`;
196
+ }
194
197
  }
195
198
  function px(str) {
196
199
  if (str.match(unitOnlyRE))
@@ -200,8 +203,11 @@ function px(str) {
200
203
  return;
201
204
  const [, n, unit] = match;
202
205
  const num = parseFloat(n);
203
- if (!Number.isNaN(num))
206
+ if (!Number.isNaN(num)) {
207
+ if (num === 0)
208
+ return "0";
204
209
  return unit ? `${round(num)}${unit}` : `${round(num)}px`;
210
+ }
205
211
  }
206
212
  function number(str) {
207
213
  if (!numberRE.test(str))
@@ -222,8 +228,11 @@ function fraction(str) {
222
228
  return "100%";
223
229
  const [left, right] = str.split("/");
224
230
  const num = parseFloat(left) / parseFloat(right);
225
- if (!Number.isNaN(num))
231
+ if (!Number.isNaN(num)) {
232
+ if (num === 0)
233
+ return "0";
226
234
  return `${round(num * 100)}%`;
235
+ }
227
236
  }
228
237
  const bracketTypeRe = /^\[(color|length|position|quoted|string):/i;
229
238
  function bracketWithType(str, requiredType) {
@@ -289,8 +298,11 @@ function time(str) {
289
298
  return;
290
299
  const [, n, unit] = match;
291
300
  const num = parseFloat(n);
292
- if (!Number.isNaN(num))
301
+ if (!Number.isNaN(num)) {
302
+ if (num === 0 && !unit)
303
+ return "0s";
293
304
  return unit ? `${round(num)}${unit}` : `${round(num)}ms`;
305
+ }
294
306
  }
295
307
  function degree(str) {
296
308
  const match = str.match(/^(-?[0-9.]+)(deg|rad|grad|turn)?$/i);
@@ -298,8 +310,11 @@ function degree(str) {
298
310
  return;
299
311
  const [, n, unit] = match;
300
312
  const num = parseFloat(n);
301
- if (!Number.isNaN(num))
313
+ if (!Number.isNaN(num)) {
314
+ if (num === 0)
315
+ return "0";
302
316
  return unit ? `${round(num)}${unit}` : `${round(num)}deg`;
317
+ }
303
318
  }
304
319
  function global(str) {
305
320
  if (globalKeywords.includes(str))
package/dist/theme.cjs CHANGED
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const colors = require('./shared/preset-mini.30606736.cjs');
6
- const _default = require('./shared/preset-mini.62e01fcd.cjs');
7
- require('./shared/preset-mini.b2a92d2d.cjs');
8
- require('./shared/preset-mini.87096f14.cjs');
6
+ const _default = require('./shared/preset-mini.2341d2ee.cjs');
7
+ require('./shared/preset-mini.df9c634c.cjs');
8
+ require('./shared/preset-mini.f9ff00ee.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 './shared/preset-mini.65ac75be.mjs';
2
- export { q as baseSize, b as blur, m as borderRadius, n as boxShadow, i as breakpoints, A as containers, d as dropShadow, k as duration, o as easing, f as fontFamily, a as fontSize, y as height, h as letterSpacing, l as lineHeight, j as lineWidth, z as maxHeight, x as maxWidth, p as preflightBase, r as ringWidth, s as spacing, c as textIndent, g as textShadow, e as textStrokeWidth, t as theme, v as verticalBreakpoints, u as width, w as wordSpacing } from './shared/preset-mini.abaf1689.mjs';
3
- import './shared/preset-mini.91445aa5.mjs';
4
- import './shared/preset-mini.1f0aea1e.mjs';
2
+ export { q as baseSize, b as blur, m as borderRadius, n as boxShadow, i as breakpoints, A as containers, d as dropShadow, k as duration, o as easing, f as fontFamily, a as fontSize, y as height, h as letterSpacing, l as lineHeight, j as lineWidth, z as maxHeight, x as maxWidth, p as preflightBase, r as ringWidth, s as spacing, c as textIndent, g as textShadow, e as textStrokeWidth, t as theme, v as verticalBreakpoints, u as width, w as wordSpacing } from './shared/preset-mini.76eb599a.mjs';
3
+ import './shared/preset-mini.86be0521.mjs';
4
+ import './shared/preset-mini.5eaf6188.mjs';
5
5
  import '@unocss/core';
package/dist/utils.cjs CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const colors = require('./shared/preset-mini.87096f14.cjs');
6
- const variants = require('./shared/preset-mini.36f890d6.cjs');
5
+ const colors = require('./shared/preset-mini.f9ff00ee.cjs');
6
+ const variants = require('./shared/preset-mini.7086e6db.cjs');
7
7
  require('@unocss/core');
8
8
 
9
9
 
package/dist/utils.mjs CHANGED
@@ -1,3 +1,3 @@
1
- export { C as CONTROL_MINI_NO_NEGATIVE, f as colorOpacityToString, c as colorResolver, e as colorToString, i as colorableShadows, b as cornerMap, d as directionMap, o as directionSize, q as getBracket, t as getComponent, z as getComponents, g as globalKeywords, w as h, h as handler, a as hasParseableColor, u as hex2rgba, j as insetMap, m as makeGlobalStaticRules, p as parseColor, v as parseCssColor, k as positionMap, l as resolveBreakpoints, r as resolveVerticalBreakpoints, s as splitShorthand, y as valueHandlers, x as xyzMap } from './shared/preset-mini.1f0aea1e.mjs';
2
- export { a as variantGetBracket, v as variantGetParameter, b as variantMatcher, c as variantParentMatcher } from './shared/preset-mini.354ecb56.mjs';
1
+ export { C as CONTROL_MINI_NO_NEGATIVE, f as colorOpacityToString, c as colorResolver, e as colorToString, i as colorableShadows, b as cornerMap, d as directionMap, o as directionSize, q as getBracket, t as getComponent, z as getComponents, g as globalKeywords, w as h, h as handler, a as hasParseableColor, u as hex2rgba, j as insetMap, m as makeGlobalStaticRules, p as parseColor, v as parseCssColor, k as positionMap, l as resolveBreakpoints, r as resolveVerticalBreakpoints, s as splitShorthand, y as valueHandlers, x as xyzMap } from './shared/preset-mini.5eaf6188.mjs';
2
+ export { a as variantGetBracket, v as variantGetParameter, b as variantMatcher, c as variantParentMatcher } from './shared/preset-mini.ca55daef.mjs';
3
3
  import '@unocss/core';
package/dist/variants.cjs CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const _default = require('./shared/preset-mini.7c26129e.cjs');
6
- require('./shared/preset-mini.87096f14.cjs');
5
+ const _default = require('./shared/preset-mini.52ab4b0f.cjs');
6
+ require('./shared/preset-mini.f9ff00ee.cjs');
7
7
  require('@unocss/core');
8
- require('./shared/preset-mini.36f890d6.cjs');
8
+ require('./shared/preset-mini.7086e6db.cjs');
9
9
 
10
10
 
11
11
 
package/dist/variants.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { c as calcMaxWidthBySize, u as partClasses, a as variantAria, b as variantBreakpoints, f as variantColorsMediaOrClass, d as variantCombinators, e as variantContainerQuery, m as variantCssLayer, k as variantCustomMedia, g as variantDataAttribute, i as variantImportant, n as variantInternalLayer, h as variantLanguageDirections, q as variantNegative, j as variantPrint, s as variantPseudoClassFunctions, r as variantPseudoClassesAndElements, o as variantScope, l as variantSelector, w as variantSupports, t as variantTaggedPseudoClasses, p as variantVariables, v as variants } from './shared/preset-mini.7e22fc5d.mjs';
2
- import './shared/preset-mini.1f0aea1e.mjs';
1
+ export { c as calcMaxWidthBySize, u as partClasses, a as variantAria, b as variantBreakpoints, f as variantColorsMediaOrClass, d as variantCombinators, e as variantContainerQuery, m as variantCssLayer, k as variantCustomMedia, g as variantDataAttribute, i as variantImportant, n as variantInternalLayer, h as variantLanguageDirections, q as variantNegative, j as variantPrint, s as variantPseudoClassFunctions, r as variantPseudoClassesAndElements, o as variantScope, l as variantSelector, w as variantSupports, t as variantTaggedPseudoClasses, p as variantVariables, v as variants } from './shared/preset-mini.9f800526.mjs';
2
+ import './shared/preset-mini.5eaf6188.mjs';
3
3
  import '@unocss/core';
4
- import './shared/preset-mini.354ecb56.mjs';
4
+ import './shared/preset-mini.ca55daef.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/preset-mini",
3
- "version": "0.49.4",
3
+ "version": "0.49.5",
4
4
  "description": "The minimal preset for UnoCSS",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -61,7 +61,7 @@
61
61
  "*.css"
62
62
  ],
63
63
  "dependencies": {
64
- "@unocss/core": "0.49.4"
64
+ "@unocss/core": "0.49.5"
65
65
  },
66
66
  "scripts": {
67
67
  "build": "unbuild",