@unocss/preset-mini 0.49.3 → 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.
@@ -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 = {
@@ -139,6 +139,28 @@ function handlerBorderStyle([, a = "", s]) {
139
139
  return directionMap[a].map((i) => [`border${i}-style`, s]);
140
140
  }
141
141
 
142
+ const decorationStyles = ["solid", "double", "dotted", "dashed", "wavy", ...globalKeywords];
143
+ const textDecorations = [
144
+ [/^(?:decoration-)?(underline|overline|line-through)$/, ([, s]) => ({ "text-decoration-line": s }), { autocomplete: "decoration-(underline|overline|line-through)" }],
145
+ [/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s], { theme }) => ({ "text-decoration-thickness": theme.lineWidth?.[s] ?? handler.bracket.cssvar.global.px(s) }), { autocomplete: "(underline|decoration)-<num>" }],
146
+ [/^(?:underline|decoration)-(auto|from-font)$/, ([, s]) => ({ "text-decoration-thickness": s }), { autocomplete: "(underline|decoration)-(auto|from-font)" }],
147
+ [/^(?:underline|decoration)-(.+)$/, (match, ctx) => {
148
+ const result = colorResolver("text-decoration-color", "line")(match, ctx);
149
+ if (result) {
150
+ return {
151
+ "-webkit-text-decoration-color": result["text-decoration-color"],
152
+ ...result
153
+ };
154
+ }
155
+ }, { autocomplete: "(underline|decoration)-$colors" }],
156
+ [/^(?:underline|decoration)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-line-opacity": handler.bracket.percent(opacity) }), { autocomplete: "(underline|decoration)-(op|opacity)-<percent>" }],
157
+ [/^(?:underline|decoration)-offset-(.+)$/, ([, s], { theme }) => ({ "text-underline-offset": theme.lineWidth?.[s] ?? handler.auto.bracket.cssvar.global.px(s) }), { autocomplete: "(underline|decoration)-(offset)-<num>" }],
158
+ ...decorationStyles.map((v) => [`underline-${v}`, { "text-decoration-style": v }]),
159
+ ...decorationStyles.map((v) => [`decoration-${v}`, { "text-decoration-style": v }]),
160
+ ["no-underline", { "text-decoration": "none" }],
161
+ ["decoration-none", { "text-decoration": "none" }]
162
+ ];
163
+
142
164
  const transitionPropertyGroup = {
143
165
  all: "all",
144
166
  colors: ["color", "background-color", "border-color", "outline-color", "text-decoration-color", "fill", "stroke"].join(","),
@@ -213,15 +235,16 @@ const fonts = [
213
235
  const sizePairs = toArray(theme.fontSize?.[size]);
214
236
  const lineHeight = leading ? handleLineHeight(leading, theme) : void 0;
215
237
  if (sizePairs?.[0]) {
216
- const [fontSize, height] = sizePairs;
238
+ const [fontSize2, height] = sizePairs;
217
239
  return {
218
- "font-size": fontSize,
240
+ "font-size": fontSize2,
219
241
  "line-height": lineHeight ?? height ?? "1"
220
242
  };
221
243
  }
222
- if (lineHeight) {
244
+ const fontSize = handler.bracketOfLength.rem(size);
245
+ if (lineHeight && fontSize) {
223
246
  return {
224
- "font-size": handler.bracketOfLength.rem(size),
247
+ "font-size": fontSize,
225
248
  "line-height": lineHeight
226
249
  };
227
250
  }
@@ -727,26 +750,4 @@ function handleSkew([, d, b]) {
727
750
  }
728
751
  }
729
752
 
730
- const decorationStyles = ["solid", "double", "dotted", "dashed", "wavy", ...globalKeywords];
731
- const textDecorations = [
732
- [/^(?:decoration-)?(underline|overline|line-through)$/, ([, s]) => ({ "text-decoration-line": s }), { autocomplete: "decoration-(underline|overline|line-through)" }],
733
- [/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s], { theme }) => ({ "text-decoration-thickness": theme.lineWidth?.[s] ?? handler.bracket.cssvar.global.px(s) }), { autocomplete: "(underline|decoration)-<num>" }],
734
- [/^(?:underline|decoration)-(auto|from-font)$/, ([, s]) => ({ "text-decoration-thickness": s }), { autocomplete: "(underline|decoration)-(auto|from-font)" }],
735
- [/^(?:underline|decoration)-(.+)$/, (match, ctx) => {
736
- const result = colorResolver("text-decoration-color", "line")(match, ctx);
737
- if (result) {
738
- return {
739
- "-webkit-text-decoration-color": result["text-decoration-color"],
740
- ...result
741
- };
742
- }
743
- }, { autocomplete: "(underline|decoration)-$colors" }],
744
- [/^(?:underline|decoration)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-line-opacity": handler.bracket.percent(opacity) }), { autocomplete: "(underline|decoration)-(op|opacity)-<percent>" }],
745
- [/^(?:underline|decoration)-offset-(.+)$/, ([, s], { theme }) => ({ "text-underline-offset": theme.lineWidth?.[s] ?? handler.auto.bracket.cssvar.global.px(s) }), { autocomplete: "(underline|decoration)-(offset)-<num>" }],
746
- ...decorationStyles.map((v) => [`underline-${v}`, { "text-decoration-style": v }]),
747
- ...decorationStyles.map((v) => [`decoration-${v}`, { "text-decoration-style": v }]),
748
- ["no-underline", { "text-decoration": "none" }],
749
- ["decoration-none", { "text-decoration": "none" }]
750
- ];
751
-
752
753
  export { overflows as A, outline as B, appearance as C, orders as D, justifies as E, alignments as F, placements as G, insets as H, floats as I, zIndexes as J, boxSizing as K, transitions as L, transforms as M, willChange as N, contains as O, transformBase as P, boxShadowsBase as Q, ringBase as R, borderStyles as S, handlerBorderStyle as T, varEmpty as U, contents as a, borders as b, contentVisibility as c, displays as d, textIndents as e, fonts as f, textOverflows as g, textDecorations as h, textStrokes as i, textShadows as j, textTransforms as k, textAligns as l, fontStyles as m, fontSmoothings as n, boxShadows as o, positions as p, cursors as q, rings as r, appearances as s, tabSizes as t, pointerEvents as u, resizes as v, verticalAligns as w, userSelects as x, whitespaces as y, breaks as z };
@@ -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 variantParentMatcher, c as variantMatcher } from './preset-mini.29117527.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",
@@ -148,6 +148,20 @@ const variantContainerQuery = {
148
148
  multiPass: true
149
149
  };
150
150
 
151
+ const variantColorsMediaOrClass = (options = {}) => {
152
+ if (options?.dark === "class" || typeof options.dark === "object") {
153
+ const { dark = ".dark", light = ".light" } = typeof options.dark === "string" ? {} : options.dark;
154
+ return [
155
+ variantMatcher("dark", (input) => ({ prefix: `${dark} $$ ${input.prefix}` })),
156
+ variantMatcher("light", (input) => ({ prefix: `${light} $$ ${input.prefix}` }))
157
+ ];
158
+ }
159
+ return [
160
+ variantParentMatcher("dark", "@media (prefers-color-scheme: dark)"),
161
+ variantParentMatcher("light", "@media (prefers-color-scheme: light)")
162
+ ];
163
+ };
164
+
151
165
  const variantDataAttribute = {
152
166
  name: "data",
153
167
  match(matcher, ctx) {
@@ -165,67 +179,6 @@ const variantDataAttribute = {
165
179
  }
166
180
  };
167
181
 
168
- const variantPrint = variantParentMatcher("print", "@media print");
169
- const variantCustomMedia = {
170
- name: "media",
171
- match(matcher, ctx) {
172
- const variant = variantGetParameter("media-", matcher, ctx.generator.config.separators);
173
- if (variant) {
174
- const [match, rest] = variant;
175
- let media = handler.bracket(match) ?? "";
176
- if (media === "")
177
- media = ctx.theme.media?.[match] ?? "";
178
- if (media) {
179
- return {
180
- matcher: rest,
181
- handle: (input, next) => next({
182
- ...input,
183
- parent: `${input.parent ? `${input.parent} $$ ` : ""}@media ${media}`
184
- })
185
- };
186
- }
187
- }
188
- },
189
- multiPass: true
190
- };
191
-
192
- const variantSupports = {
193
- name: "supports",
194
- match(matcher, ctx) {
195
- const variant = variantGetParameter("supports-", matcher, ctx.generator.config.separators);
196
- if (variant) {
197
- const [match, rest] = variant;
198
- let supports = handler.bracket(match) ?? "";
199
- if (supports === "")
200
- supports = ctx.theme.supports?.[match] ?? "";
201
- if (supports) {
202
- return {
203
- matcher: rest,
204
- handle: (input, next) => next({
205
- ...input,
206
- parent: `${input.parent ? `${input.parent} $$ ` : ""}@supports ${supports}`
207
- })
208
- };
209
- }
210
- }
211
- },
212
- multiPass: true
213
- };
214
-
215
- const variantColorsMediaOrClass = (options = {}) => {
216
- if (options?.dark === "class" || typeof options.dark === "object") {
217
- const { dark = ".dark", light = ".light" } = typeof options.dark === "string" ? {} : options.dark;
218
- return [
219
- variantMatcher("dark", (input) => ({ prefix: `${dark} $$ ${input.prefix}` })),
220
- variantMatcher("light", (input) => ({ prefix: `${light} $$ ${input.prefix}` }))
221
- ];
222
- }
223
- return [
224
- variantParentMatcher("dark", "@media (prefers-color-scheme: dark)"),
225
- variantParentMatcher("light", "@media (prefers-color-scheme: light)")
226
- ];
227
- };
228
-
229
182
  const variantLanguageDirections = [
230
183
  variantMatcher("rtl", (input) => ({ prefix: `[dir="rtl"] $$ ${input.prefix}` })),
231
184
  variantMatcher("ltr", (input) => ({ prefix: `[dir="ltr"] $$ ${input.prefix}` }))
@@ -412,6 +365,53 @@ const variantImportant = () => {
412
365
  };
413
366
  };
414
367
 
368
+ const variantPrint = variantParentMatcher("print", "@media print");
369
+ const variantCustomMedia = {
370
+ name: "media",
371
+ match(matcher, ctx) {
372
+ const variant = variantGetParameter("media-", matcher, ctx.generator.config.separators);
373
+ if (variant) {
374
+ const [match, rest] = variant;
375
+ let media = handler.bracket(match) ?? "";
376
+ if (media === "")
377
+ media = ctx.theme.media?.[match] ?? "";
378
+ if (media) {
379
+ return {
380
+ matcher: rest,
381
+ handle: (input, next) => next({
382
+ ...input,
383
+ parent: `${input.parent ? `${input.parent} $$ ` : ""}@media ${media}`
384
+ })
385
+ };
386
+ }
387
+ }
388
+ },
389
+ multiPass: true
390
+ };
391
+
392
+ const variantSupports = {
393
+ name: "supports",
394
+ match(matcher, ctx) {
395
+ const variant = variantGetParameter("supports-", matcher, ctx.generator.config.separators);
396
+ if (variant) {
397
+ const [match, rest] = variant;
398
+ let supports = handler.bracket(match) ?? "";
399
+ if (supports === "")
400
+ supports = ctx.theme.supports?.[match] ?? "";
401
+ if (supports) {
402
+ return {
403
+ matcher: rest,
404
+ handle: (input, next) => next({
405
+ ...input,
406
+ parent: `${input.parent ? `${input.parent} $$ ` : ""}@supports ${supports}`
407
+ })
408
+ };
409
+ }
410
+ }
411
+ },
412
+ multiPass: true
413
+ };
414
+
415
415
  const PseudoClasses = Object.fromEntries([
416
416
  ["first-letter", "::first-letter"],
417
417
  ["first-line", "::first-line"],
@@ -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
  };
@@ -647,4 +652,4 @@ const variants = (options) => [
647
652
  variantVariables
648
653
  ];
649
654
 
650
- export { variantAria as a, variantBreakpoints as b, calcMaxWidthBySize as c, variantCombinators as d, variantContainerQuery as e, variantDataAttribute as f, variantPrint as g, variantCustomMedia as h, variantSupports as i, variantColorsMediaOrClass as j, variantLanguageDirections as k, variantSelector as l, variantCssLayer as m, variantInternalLayer as n, variantScope as o, variantVariables as p, variantPseudoClassesAndElements as q, variantPseudoClassFunctions as r, variantTaggedPseudoClasses as s, partClasses as t, variantImportant as u, variants as v, variantNegative as w };
655
+ export { variantAria as a, variantBreakpoints as b, calcMaxWidthBySize as c, variantCombinators as d, variantContainerQuery as e, variantColorsMediaOrClass as f, variantDataAttribute as g, variantLanguageDirections as h, variantImportant as i, variantPrint as j, variantCustomMedia as k, variantSelector as l, variantCssLayer as m, variantInternalLayer as n, variantScope as o, variantVariables as p, variantNegative as q, variantPseudoClassesAndElements as r, variantPseudoClassFunctions as s, variantTaggedPseudoClasses as t, partClasses as u, variants as v, variantSupports as w };
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- const decoration = require('./preset-mini.0c11b1ec.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 = [
@@ -265,57 +265,57 @@ const rules = [
265
265
  cssProperty,
266
266
  paddings,
267
267
  margins,
268
- decoration.displays,
268
+ transform.displays,
269
269
  opacity,
270
270
  bgColors,
271
271
  svgUtilities,
272
- decoration.borders,
273
- decoration.contentVisibility,
274
- decoration.contents,
275
- decoration.fonts,
276
- decoration.tabSizes,
277
- decoration.textIndents,
278
- decoration.textOverflows,
279
- decoration.textDecorations,
280
- decoration.textStrokes,
281
- decoration.textShadows,
282
- decoration.textTransforms,
283
- decoration.textAligns,
272
+ transform.borders,
273
+ transform.contentVisibility,
274
+ transform.contents,
275
+ transform.fonts,
276
+ transform.tabSizes,
277
+ transform.textIndents,
278
+ transform.textOverflows,
279
+ transform.textDecorations,
280
+ transform.textStrokes,
281
+ transform.textShadows,
282
+ transform.textTransforms,
283
+ transform.textAligns,
284
284
  textColors,
285
- decoration.fontStyles,
286
- decoration.fontSmoothings,
287
- decoration.boxShadows,
288
- decoration.rings,
285
+ transform.fontStyles,
286
+ transform.fontSmoothings,
287
+ transform.boxShadows,
288
+ transform.rings,
289
289
  flex,
290
290
  grids,
291
291
  gaps,
292
- decoration.positions,
292
+ transform.positions,
293
293
  sizes,
294
294
  aspectRatio,
295
- decoration.cursors,
296
- decoration.appearances,
297
- decoration.pointerEvents,
298
- decoration.resizes,
299
- decoration.verticalAligns,
300
- decoration.userSelects,
301
- decoration.whitespaces,
302
- decoration.breaks,
303
- decoration.overflows,
304
- decoration.outline,
305
- decoration.appearance,
306
- decoration.orders,
307
- decoration.justifies,
308
- decoration.alignments,
309
- decoration.placements,
310
- decoration.insets,
311
- decoration.floats,
312
- decoration.zIndexes,
313
- decoration.boxSizing,
314
- decoration.transitions,
315
- decoration.transforms,
316
- decoration.willChange,
295
+ transform.cursors,
296
+ transform.appearances,
297
+ transform.pointerEvents,
298
+ transform.resizes,
299
+ transform.verticalAligns,
300
+ transform.userSelects,
301
+ transform.whitespaces,
302
+ transform.breaks,
303
+ transform.overflows,
304
+ transform.outline,
305
+ transform.appearance,
306
+ transform.orders,
307
+ transform.justifies,
308
+ transform.alignments,
309
+ transform.placements,
310
+ transform.insets,
311
+ transform.floats,
312
+ transform.zIndexes,
313
+ transform.boxSizing,
314
+ transform.transitions,
315
+ transform.transforms,
316
+ transform.willChange,
317
317
  containerParent,
318
- decoration.contains,
318
+ transform.contains,
319
319
  questionMark
320
320
  ].flat(1);
321
321
 
@@ -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;
@@ -77,4 +77,4 @@ const variantGetParameter = (prefix, matcher, separators) => {
77
77
  }
78
78
  };
79
79
 
80
- export { variantGetBracket as a, variantParentMatcher as b, variantMatcher as c, variantGetParameter as v };
80
+ export { variantGetBracket as a, variantMatcher as b, variantParentMatcher as c, variantGetParameter as v };
@@ -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 = {
@@ -141,6 +141,28 @@ function handlerBorderStyle([, a = "", s]) {
141
141
  return colors.directionMap[a].map((i) => [`border${i}-style`, s]);
142
142
  }
143
143
 
144
+ const decorationStyles = ["solid", "double", "dotted", "dashed", "wavy", ...colors.globalKeywords];
145
+ const textDecorations = [
146
+ [/^(?:decoration-)?(underline|overline|line-through)$/, ([, s]) => ({ "text-decoration-line": s }), { autocomplete: "decoration-(underline|overline|line-through)" }],
147
+ [/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s], { theme }) => ({ "text-decoration-thickness": theme.lineWidth?.[s] ?? colors.handler.bracket.cssvar.global.px(s) }), { autocomplete: "(underline|decoration)-<num>" }],
148
+ [/^(?:underline|decoration)-(auto|from-font)$/, ([, s]) => ({ "text-decoration-thickness": s }), { autocomplete: "(underline|decoration)-(auto|from-font)" }],
149
+ [/^(?:underline|decoration)-(.+)$/, (match, ctx) => {
150
+ const result = colors.colorResolver("text-decoration-color", "line")(match, ctx);
151
+ if (result) {
152
+ return {
153
+ "-webkit-text-decoration-color": result["text-decoration-color"],
154
+ ...result
155
+ };
156
+ }
157
+ }, { autocomplete: "(underline|decoration)-$colors" }],
158
+ [/^(?:underline|decoration)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-line-opacity": colors.handler.bracket.percent(opacity) }), { autocomplete: "(underline|decoration)-(op|opacity)-<percent>" }],
159
+ [/^(?:underline|decoration)-offset-(.+)$/, ([, s], { theme }) => ({ "text-underline-offset": theme.lineWidth?.[s] ?? colors.handler.auto.bracket.cssvar.global.px(s) }), { autocomplete: "(underline|decoration)-(offset)-<num>" }],
160
+ ...decorationStyles.map((v) => [`underline-${v}`, { "text-decoration-style": v }]),
161
+ ...decorationStyles.map((v) => [`decoration-${v}`, { "text-decoration-style": v }]),
162
+ ["no-underline", { "text-decoration": "none" }],
163
+ ["decoration-none", { "text-decoration": "none" }]
164
+ ];
165
+
144
166
  const transitionPropertyGroup = {
145
167
  all: "all",
146
168
  colors: ["color", "background-color", "border-color", "outline-color", "text-decoration-color", "fill", "stroke"].join(","),
@@ -215,15 +237,16 @@ const fonts = [
215
237
  const sizePairs = core.toArray(theme.fontSize?.[size]);
216
238
  const lineHeight = leading ? handleLineHeight(leading, theme) : void 0;
217
239
  if (sizePairs?.[0]) {
218
- const [fontSize, height] = sizePairs;
240
+ const [fontSize2, height] = sizePairs;
219
241
  return {
220
- "font-size": fontSize,
242
+ "font-size": fontSize2,
221
243
  "line-height": lineHeight ?? height ?? "1"
222
244
  };
223
245
  }
224
- if (lineHeight) {
246
+ const fontSize = colors.handler.bracketOfLength.rem(size);
247
+ if (lineHeight && fontSize) {
225
248
  return {
226
- "font-size": colors.handler.bracketOfLength.rem(size),
249
+ "font-size": fontSize,
227
250
  "line-height": lineHeight
228
251
  };
229
252
  }
@@ -729,28 +752,6 @@ function handleSkew([, d, b]) {
729
752
  }
730
753
  }
731
754
 
732
- const decorationStyles = ["solid", "double", "dotted", "dashed", "wavy", ...colors.globalKeywords];
733
- const textDecorations = [
734
- [/^(?:decoration-)?(underline|overline|line-through)$/, ([, s]) => ({ "text-decoration-line": s }), { autocomplete: "decoration-(underline|overline|line-through)" }],
735
- [/^(?:underline|decoration)-(?:size-)?(.+)$/, ([, s], { theme }) => ({ "text-decoration-thickness": theme.lineWidth?.[s] ?? colors.handler.bracket.cssvar.global.px(s) }), { autocomplete: "(underline|decoration)-<num>" }],
736
- [/^(?:underline|decoration)-(auto|from-font)$/, ([, s]) => ({ "text-decoration-thickness": s }), { autocomplete: "(underline|decoration)-(auto|from-font)" }],
737
- [/^(?:underline|decoration)-(.+)$/, (match, ctx) => {
738
- const result = colors.colorResolver("text-decoration-color", "line")(match, ctx);
739
- if (result) {
740
- return {
741
- "-webkit-text-decoration-color": result["text-decoration-color"],
742
- ...result
743
- };
744
- }
745
- }, { autocomplete: "(underline|decoration)-$colors" }],
746
- [/^(?:underline|decoration)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-line-opacity": colors.handler.bracket.percent(opacity) }), { autocomplete: "(underline|decoration)-(op|opacity)-<percent>" }],
747
- [/^(?:underline|decoration)-offset-(.+)$/, ([, s], { theme }) => ({ "text-underline-offset": theme.lineWidth?.[s] ?? colors.handler.auto.bracket.cssvar.global.px(s) }), { autocomplete: "(underline|decoration)-(offset)-<num>" }],
748
- ...decorationStyles.map((v) => [`underline-${v}`, { "text-decoration-style": v }]),
749
- ...decorationStyles.map((v) => [`decoration-${v}`, { "text-decoration-style": v }]),
750
- ["no-underline", { "text-decoration": "none" }],
751
- ["decoration-none", { "text-decoration": "none" }]
752
- ];
753
-
754
755
  exports.alignments = alignments;
755
756
  exports.appearance = appearance;
756
757
  exports.appearances = appearances;
@@ -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.7713e984.cjs');
7
- require('./shared/preset-mini.0c11b1ec.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.d.ts CHANGED
@@ -116,6 +116,30 @@ declare const ringWidth: {
116
116
  none: string;
117
117
  };
118
118
 
119
+ declare const preflightBase: {
120
+ '--un-ring-inset': string;
121
+ '--un-ring-offset-width': string;
122
+ '--un-ring-offset-color': string;
123
+ '--un-ring-width': string;
124
+ '--un-ring-color': string;
125
+ '--un-shadow': string;
126
+ '--un-ring-offset-shadow': string;
127
+ '--un-ring-shadow': string;
128
+ '--un-shadow-inset': string;
129
+ '--un-rotate': number;
130
+ '--un-rotate-x': number;
131
+ '--un-rotate-y': number;
132
+ '--un-rotate-z': number;
133
+ '--un-scale-x': number;
134
+ '--un-scale-y': number;
135
+ '--un-scale-z': number;
136
+ '--un-skew-x': number;
137
+ '--un-skew-y': number;
138
+ '--un-translate-x': number;
139
+ '--un-translate-y': number;
140
+ '--un-translate-z': number;
141
+ };
142
+
119
143
  declare const baseSize: {
120
144
  xs: string;
121
145
  sm: string;
@@ -198,28 +222,4 @@ declare const containers: {
198
222
  [k: string]: string;
199
223
  };
200
224
 
201
- declare const preflightBase: {
202
- '--un-ring-inset': string;
203
- '--un-ring-offset-width': string;
204
- '--un-ring-offset-color': string;
205
- '--un-ring-width': string;
206
- '--un-ring-color': string;
207
- '--un-shadow': string;
208
- '--un-ring-offset-shadow': string;
209
- '--un-ring-shadow': string;
210
- '--un-shadow-inset': string;
211
- '--un-rotate': number;
212
- '--un-rotate-x': number;
213
- '--un-rotate-y': number;
214
- '--un-rotate-z': number;
215
- '--un-scale-x': number;
216
- '--un-scale-y': number;
217
- '--un-scale-z': number;
218
- '--un-skew-x': number;
219
- '--un-skew-y': number;
220
- '--un-translate-x': number;
221
- '--un-translate-y': number;
222
- '--un-translate-z': number;
223
- };
224
-
225
225
  export { baseSize, blur, borderRadius, boxShadow, breakpoints, containers, dropShadow, duration, easing, fontFamily, fontSize, height, letterSpacing, lineHeight, lineWidth, maxHeight, maxWidth, preflightBase, ringWidth, spacing, textIndent, textShadow, textStrokeWidth, verticalBreakpoints, width, wordSpacing };
package/dist/theme.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  export { c as colors } from './shared/preset-mini.65ac75be.mjs';
2
- export { p as baseSize, b as blur, m as borderRadius, n as boxShadow, i as breakpoints, z as containers, 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, A 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 './shared/preset-mini.d4b3c145.mjs';
3
- import './shared/preset-mini.0e65716b.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';