@unocss/preset-mini 0.48.2 → 0.48.4

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.
Files changed (27) hide show
  1. package/dist/index.cjs +6 -6
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.mjs +7 -7
  4. package/dist/rules.cjs +3 -3
  5. package/dist/rules.mjs +3 -3
  6. package/dist/shared/{preset-mini.9a963c89.mjs → preset-mini.0a36abfc.mjs} +2 -2
  7. package/dist/shared/{preset-mini.2612e983.mjs → preset-mini.0d510914.mjs} +2 -2
  8. package/dist/shared/{preset-mini.19fa93be.cjs → preset-mini.28b1d01c.cjs} +1 -1
  9. package/dist/shared/{preset-mini.eaa84a8f.cjs → preset-mini.435805c5.cjs} +7 -7
  10. package/dist/shared/{preset-mini.1ec77f6f.cjs → preset-mini.43dfafb9.cjs} +2 -2
  11. package/dist/shared/{preset-mini.6f716ffb.mjs → preset-mini.6b96b995.mjs} +7 -7
  12. package/dist/shared/{preset-mini.bb68e31e.cjs → preset-mini.8953ff1a.cjs} +20 -9
  13. package/dist/shared/{preset-mini.2ad50fb9.cjs → preset-mini.89cb41ec.cjs} +2 -2
  14. package/dist/shared/{preset-mini.71a71f59.mjs → preset-mini.a6daaf18.mjs} +20 -9
  15. package/dist/shared/{preset-mini.33f541c6.mjs → preset-mini.bd4c0c0c.mjs} +1 -1
  16. package/dist/shared/{preset-mini.97298de6.mjs → preset-mini.ca595ab5.mjs} +12 -9
  17. package/dist/shared/{preset-mini.5002aa63.cjs → preset-mini.e54ce13d.cjs} +12 -8
  18. package/dist/theme.cjs +3 -3
  19. package/dist/theme.mjs +3 -3
  20. package/dist/{utilities-51b38240.d.ts → utilities-d2f973f4.d.ts} +5 -1
  21. package/dist/utils.cjs +3 -2
  22. package/dist/utils.d.ts +1 -1
  23. package/dist/utils.mjs +2 -2
  24. package/dist/variants.cjs +3 -3
  25. package/dist/variants.d.ts +1 -1
  26. package/dist/variants.mjs +3 -3
  27. package/package.json +2 -2
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.bb68e31e.cjs');
7
- const colors$1 = require('./shared/preset-mini.5002aa63.cjs');
8
- const _default$1 = require('./shared/preset-mini.eaa84a8f.cjs');
6
+ require('./shared/preset-mini.8953ff1a.cjs');
7
+ const colors$1 = require('./shared/preset-mini.e54ce13d.cjs');
8
+ const _default$1 = require('./shared/preset-mini.435805c5.cjs');
9
9
  const colors = require('./shared/preset-mini.30606736.cjs');
10
- const _default = require('./shared/preset-mini.1ec77f6f.cjs');
11
- const _default$2 = require('./shared/preset-mini.2ad50fb9.cjs');
12
- require('./shared/preset-mini.19fa93be.cjs');
10
+ const _default = require('./shared/preset-mini.43dfafb9.cjs');
11
+ const _default$2 = require('./shared/preset-mini.89cb41ec.cjs');
12
+ require('./shared/preset-mini.28b1d01c.cjs');
13
13
 
14
14
  const preflights = [
15
15
  {
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ export { c as colors } from './colors-b217808a.js';
3
3
  export { t as theme } from './default-344896b2.js';
4
4
  import { T as Theme } from './types-fa74508f.js';
5
5
  export { T as Theme, a as ThemeAnimation } from './types-fa74508f.js';
6
- export { p as parseColor } from './utilities-51b38240.js';
6
+ export { p as parseColor } from './utilities-d2f973f4.js';
7
7
 
8
8
  declare const preflights: Preflight[];
9
9
 
package/dist/index.mjs CHANGED
@@ -1,12 +1,12 @@
1
1
  import { entriesToCss, toArray } from '@unocss/core';
2
- import './shared/preset-mini.71a71f59.mjs';
3
- export { p as parseColor } from './shared/preset-mini.97298de6.mjs';
4
- import { r as rules } from './shared/preset-mini.6f716ffb.mjs';
2
+ import './shared/preset-mini.a6daaf18.mjs';
3
+ export { p as parseColor } from './shared/preset-mini.ca595ab5.mjs';
4
+ import { r as rules } from './shared/preset-mini.6b96b995.mjs';
5
5
  export { c as colors } from './shared/preset-mini.65ac75be.mjs';
6
- import { t as theme } from './shared/preset-mini.9a963c89.mjs';
7
- export { t as theme } from './shared/preset-mini.9a963c89.mjs';
8
- import { v as variants } from './shared/preset-mini.2612e983.mjs';
9
- import './shared/preset-mini.33f541c6.mjs';
6
+ import { t as theme } from './shared/preset-mini.0a36abfc.mjs';
7
+ export { t as theme } from './shared/preset-mini.0a36abfc.mjs';
8
+ import { v as variants } from './shared/preset-mini.0d510914.mjs';
9
+ import './shared/preset-mini.bd4c0c0c.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 decoration = require('./shared/preset-mini.bb68e31e.cjs');
6
- const _default = require('./shared/preset-mini.eaa84a8f.cjs');
7
- require('./shared/preset-mini.5002aa63.cjs');
5
+ const decoration = require('./shared/preset-mini.8953ff1a.cjs');
6
+ const _default = require('./shared/preset-mini.435805c5.cjs');
7
+ require('./shared/preset-mini.e54ce13d.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.71a71f59.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.6f716ffb.mjs';
3
- import './shared/preset-mini.97298de6.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.a6daaf18.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.6b96b995.mjs';
3
+ import './shared/preset-mini.ca595ab5.mjs';
4
4
  import '@unocss/core';
@@ -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.71a71f59.mjs';
3
- import './preset-mini.97298de6.mjs';
2
+ import { P as transformBase, Q as boxShadowsBase, R as ringBase } from './preset-mini.a6daaf18.mjs';
3
+ import './preset-mini.ca595ab5.mjs';
4
4
  import '@unocss/core';
5
5
 
6
6
  const fontFamily = {
@@ -1,6 +1,6 @@
1
- import { h as handler, l as resolveBreakpoints, q as getBracket, C as CONTROL_MINI_NO_NEGATIVE, s as getComponent } from './preset-mini.97298de6.mjs';
1
+ import { h as handler, l as resolveBreakpoints, q as getBracket, C as CONTROL_MINI_NO_NEGATIVE, t as getComponent } from './preset-mini.ca595ab5.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.33f541c6.mjs';
3
+ import { v as variantGetParameter, a as variantGetBracket, b as variantParentMatcher, c as variantMatcher } from './preset-mini.bd4c0c0c.mjs';
4
4
 
5
5
  const variantAria = {
6
6
  name: "aria",
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const core = require('@unocss/core');
4
- const colors = require('./preset-mini.5002aa63.cjs');
4
+ const colors = require('./preset-mini.e54ce13d.cjs');
5
5
 
6
6
  const variantMatcher = (name, handler) => {
7
7
  const re = new RegExp(`^${core.escapeRegExp(name)}[:-]`);
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- const decoration = require('./preset-mini.bb68e31e.cjs');
4
- const colors = require('./preset-mini.5002aa63.cjs');
3
+ const decoration = require('./preset-mini.8953ff1a.cjs');
4
+ const colors = require('./preset-mini.e54ce13d.cjs');
5
5
  const core = require('@unocss/core');
6
6
 
7
7
  const opacity = [
@@ -138,8 +138,8 @@ function getSizeValue(minmax, hw, theme, prop) {
138
138
  return colors.handler.bracket.cssvar.global.auto.fraction.rem(prop);
139
139
  }
140
140
  const sizes = [
141
- [/^(min-|max-)?([wh])-?(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: getSizeValue(m, w, theme, s) })],
142
- [/^(min-|max-)?(block|inline)-(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: getSizeValue(m, w, theme, s) }), {
141
+ [/^(?:size-)?(min-|max-)?([wh])-?(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: getSizeValue(m, w, theme, s) })],
142
+ [/^(?:size-)?(min-|max-)?(block|inline)-(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: getSizeValue(m, w, theme, s) }), {
143
143
  autocomplete: [
144
144
  "(w|h)-$width|height|maxWidth|maxHeight|minWidth|minHeight|inlineSize|blockSize|maxInlineSize|maxBlockSize|minInlineSize|minBlockSize",
145
145
  "(block|inline)-$width|height|maxWidth|maxHeight|minWidth|minHeight|inlineSize|blockSize|maxInlineSize|maxBlockSize|minInlineSize|minBlockSize",
@@ -147,8 +147,8 @@ const sizes = [
147
147
  "(max|min)-(w|h|block|inline)-$width|height|maxWidth|maxHeight|minWidth|minHeight|inlineSize|blockSize|maxInlineSize|maxBlockSize|minInlineSize|minBlockSize"
148
148
  ]
149
149
  }],
150
- [/^(min-|max-)?(h)-screen-(.+)$/, ([, m, w, s], context) => ({ [getPropName(m, w)]: colors.resolveVerticalBreakpoints(context)?.[s] })],
151
- [/^(min-|max-)?(w)-screen-(.+)$/, ([, m, w, s], context) => ({ [getPropName(m, w)]: colors.resolveBreakpoints(context)?.[s] }), {
150
+ [/^(?:size-)?(min-|max-)?(h)-screen-(.+)$/, ([, m, w, s], context) => ({ [getPropName(m, w)]: colors.resolveVerticalBreakpoints(context)?.[s] })],
151
+ [/^(?:size-)?(min-|max-)?(w)-screen-(.+)$/, ([, m, w, s], context) => ({ [getPropName(m, w)]: colors.resolveBreakpoints(context)?.[s] }), {
152
152
  autocomplete: [
153
153
  "(w|h)-screen",
154
154
  "(min|max)-(w|h)-screen",
@@ -171,7 +171,7 @@ function getAspectRatio(prop) {
171
171
  return colors.handler.bracket.cssvar.global.auto.number(prop);
172
172
  }
173
173
  const aspectRatio = [
174
- [/^aspect-(?:ratio-)?(.+)$/, ([, d]) => ({ "aspect-ratio": getAspectRatio(d) }), { autocomplete: ["aspect-(square|video|ratio)", "aspect-ratio-(square|video)"] }]
174
+ [/^(?:size-)?aspect-(?:ratio-)?(.+)$/, ([, d]) => ({ "aspect-ratio": getAspectRatio(d) }), { autocomplete: ["aspect-(square|video|ratio)", "aspect-ratio-(square|video)"] }]
175
175
  ];
176
176
 
177
177
  const paddings = [
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  const colors = require('./preset-mini.30606736.cjs');
4
- const decoration = require('./preset-mini.bb68e31e.cjs');
5
- require('./preset-mini.5002aa63.cjs');
4
+ const decoration = require('./preset-mini.8953ff1a.cjs');
5
+ require('./preset-mini.e54ce13d.cjs');
6
6
  require('@unocss/core');
7
7
 
8
8
  const fontFamily = {
@@ -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.71a71f59.mjs';
2
- import { h as handler, c as colorResolver, n as numberWithUnitRE, r as resolveVerticalBreakpoints, l as resolveBreakpoints, o as directionSize } from './preset-mini.97298de6.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.a6daaf18.mjs';
2
+ import { h as handler, c as colorResolver, n as numberWithUnitRE, r as resolveVerticalBreakpoints, l as resolveBreakpoints, o as directionSize } from './preset-mini.ca595ab5.mjs';
3
3
  import { warnOnce } from '@unocss/core';
4
4
 
5
5
  const opacity = [
@@ -136,8 +136,8 @@ function getSizeValue(minmax, hw, theme, prop) {
136
136
  return handler.bracket.cssvar.global.auto.fraction.rem(prop);
137
137
  }
138
138
  const sizes = [
139
- [/^(min-|max-)?([wh])-?(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: getSizeValue(m, w, theme, s) })],
140
- [/^(min-|max-)?(block|inline)-(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: getSizeValue(m, w, theme, s) }), {
139
+ [/^(?:size-)?(min-|max-)?([wh])-?(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: getSizeValue(m, w, theme, s) })],
140
+ [/^(?:size-)?(min-|max-)?(block|inline)-(.+)$/, ([, m, w, s], { theme }) => ({ [getPropName(m, w)]: getSizeValue(m, w, theme, s) }), {
141
141
  autocomplete: [
142
142
  "(w|h)-$width|height|maxWidth|maxHeight|minWidth|minHeight|inlineSize|blockSize|maxInlineSize|maxBlockSize|minInlineSize|minBlockSize",
143
143
  "(block|inline)-$width|height|maxWidth|maxHeight|minWidth|minHeight|inlineSize|blockSize|maxInlineSize|maxBlockSize|minInlineSize|minBlockSize",
@@ -145,8 +145,8 @@ const sizes = [
145
145
  "(max|min)-(w|h|block|inline)-$width|height|maxWidth|maxHeight|minWidth|minHeight|inlineSize|blockSize|maxInlineSize|maxBlockSize|minInlineSize|minBlockSize"
146
146
  ]
147
147
  }],
148
- [/^(min-|max-)?(h)-screen-(.+)$/, ([, m, w, s], context) => ({ [getPropName(m, w)]: resolveVerticalBreakpoints(context)?.[s] })],
149
- [/^(min-|max-)?(w)-screen-(.+)$/, ([, m, w, s], context) => ({ [getPropName(m, w)]: resolveBreakpoints(context)?.[s] }), {
148
+ [/^(?:size-)?(min-|max-)?(h)-screen-(.+)$/, ([, m, w, s], context) => ({ [getPropName(m, w)]: resolveVerticalBreakpoints(context)?.[s] })],
149
+ [/^(?:size-)?(min-|max-)?(w)-screen-(.+)$/, ([, m, w, s], context) => ({ [getPropName(m, w)]: resolveBreakpoints(context)?.[s] }), {
150
150
  autocomplete: [
151
151
  "(w|h)-screen",
152
152
  "(min|max)-(w|h)-screen",
@@ -169,7 +169,7 @@ function getAspectRatio(prop) {
169
169
  return handler.bracket.cssvar.global.auto.number(prop);
170
170
  }
171
171
  const aspectRatio = [
172
- [/^aspect-(?:ratio-)?(.+)$/, ([, d]) => ({ "aspect-ratio": getAspectRatio(d) }), { autocomplete: ["aspect-(square|video|ratio)", "aspect-ratio-(square|video)"] }]
172
+ [/^(?:size-)?aspect-(?:ratio-)?(.+)$/, ([, d]) => ({ "aspect-ratio": getAspectRatio(d) }), { autocomplete: ["aspect-(square|video|ratio)", "aspect-ratio-(square|video)"] }]
173
173
  ];
174
174
 
175
175
  const paddings = [
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const colors = require('./preset-mini.5002aa63.cjs');
3
+ const colors = require('./preset-mini.e54ce13d.cjs');
4
4
  const core = require('@unocss/core');
5
5
 
6
6
  const verticalAlignAlias = {
@@ -199,6 +199,9 @@ const weightMap = {
199
199
  extrabold: "800",
200
200
  black: "900"
201
201
  };
202
+ function handleLineHeight(s, theme) {
203
+ return theme.lineHeight?.[s] || colors.handler.bracket.cssvar.global.rem(s);
204
+ }
202
205
  const fonts = [
203
206
  [
204
207
  /^font-(.+)$/,
@@ -208,12 +211,20 @@ const fonts = [
208
211
  [
209
212
  /^text-(.+)$/,
210
213
  ([, s = "base"], { theme }) => {
211
- const themed = core.toArray(theme.fontSize?.[s]);
212
- if (themed?.[0]) {
213
- const [size, height = "1"] = themed;
214
+ const [size, leading] = colors.splitShorthand(s, "length");
215
+ const sizePairs = core.toArray(theme.fontSize?.[size]);
216
+ const lineHeight = leading ? handleLineHeight(leading, theme) : void 0;
217
+ if (sizePairs?.[0]) {
218
+ const [fontSize, height] = sizePairs;
219
+ return {
220
+ "font-size": fontSize,
221
+ "line-height": lineHeight ?? height ?? "1"
222
+ };
223
+ }
224
+ if (lineHeight) {
214
225
  return {
215
- "font-size": size,
216
- "line-height": height
226
+ "font-size": colors.handler.bracketOfLength.rem(size),
227
+ "line-height": lineHeight
217
228
  };
218
229
  }
219
230
  return { "font-size": colors.handler.bracketOfLength.rem(s) };
@@ -233,7 +244,7 @@ const fonts = [
233
244
  ],
234
245
  [
235
246
  /^(?:font-)?(?:leading|lh)-(.+)$/,
236
- ([, s], { theme }) => ({ "line-height": theme.lineHeight?.[s] || colors.handler.bracket.cssvar.global.rem(s) }),
247
+ ([, s], { theme }) => ({ "line-height": handleLineHeight(s, theme) }),
237
248
  { autocomplete: "(leading|lh)-$lineHeight" }
238
249
  ],
239
250
  ["font-synthesis-weight", { "font-synthesis": "weight" }],
@@ -414,8 +425,8 @@ const floats = [
414
425
  ...colors.makeGlobalStaticRules("clear")
415
426
  ];
416
427
  const zIndexes = [
417
- [/^z([\d.]+)$/, ([, v]) => ({ "z-index": colors.handler.number(v) })],
418
- [/^z-(.+)$/, ([, v]) => ({ "z-index": colors.handler.bracket.cssvar.global.auto.number(v) }), { autocomplete: "z-<num>" }]
428
+ [/^(?:position-|pos-)?z([\d.]+)$/, ([, v]) => ({ "z-index": colors.handler.number(v) })],
429
+ [/^(?:position-|pos-)?z-(.+)$/, ([, v]) => ({ "z-index": colors.handler.bracket.cssvar.global.auto.number(v) }), { autocomplete: "z-<num>" }]
419
430
  ];
420
431
  const boxSizing = [
421
432
  ["box-border", { "box-sizing": "border-box" }],
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- const colors = require('./preset-mini.5002aa63.cjs');
3
+ const colors = require('./preset-mini.e54ce13d.cjs');
4
4
  const core = require('@unocss/core');
5
- const variants$1 = require('./preset-mini.19fa93be.cjs');
5
+ const variants$1 = require('./preset-mini.28b1d01c.cjs');
6
6
 
7
7
  const variantAria = {
8
8
  name: "aria",
@@ -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, i as colorableShadows, j as insetMap, k as positionMap, x as xyzMap } from './preset-mini.97298de6.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.ca595ab5.mjs';
2
2
  import { toArray } from '@unocss/core';
3
3
 
4
4
  const verticalAlignAlias = {
@@ -197,6 +197,9 @@ const weightMap = {
197
197
  extrabold: "800",
198
198
  black: "900"
199
199
  };
200
+ function handleLineHeight(s, theme) {
201
+ return theme.lineHeight?.[s] || handler.bracket.cssvar.global.rem(s);
202
+ }
200
203
  const fonts = [
201
204
  [
202
205
  /^font-(.+)$/,
@@ -206,12 +209,20 @@ const fonts = [
206
209
  [
207
210
  /^text-(.+)$/,
208
211
  ([, s = "base"], { theme }) => {
209
- const themed = toArray(theme.fontSize?.[s]);
210
- if (themed?.[0]) {
211
- const [size, height = "1"] = themed;
212
+ const [size, leading] = splitShorthand(s, "length");
213
+ const sizePairs = toArray(theme.fontSize?.[size]);
214
+ const lineHeight = leading ? handleLineHeight(leading, theme) : void 0;
215
+ if (sizePairs?.[0]) {
216
+ const [fontSize, height] = sizePairs;
217
+ return {
218
+ "font-size": fontSize,
219
+ "line-height": lineHeight ?? height ?? "1"
220
+ };
221
+ }
222
+ if (lineHeight) {
212
223
  return {
213
- "font-size": size,
214
- "line-height": height
224
+ "font-size": handler.bracketOfLength.rem(size),
225
+ "line-height": lineHeight
215
226
  };
216
227
  }
217
228
  return { "font-size": handler.bracketOfLength.rem(s) };
@@ -231,7 +242,7 @@ const fonts = [
231
242
  ],
232
243
  [
233
244
  /^(?:font-)?(?:leading|lh)-(.+)$/,
234
- ([, s], { theme }) => ({ "line-height": theme.lineHeight?.[s] || handler.bracket.cssvar.global.rem(s) }),
245
+ ([, s], { theme }) => ({ "line-height": handleLineHeight(s, theme) }),
235
246
  { autocomplete: "(leading|lh)-$lineHeight" }
236
247
  ],
237
248
  ["font-synthesis-weight", { "font-synthesis": "weight" }],
@@ -412,8 +423,8 @@ const floats = [
412
423
  ...makeGlobalStaticRules("clear")
413
424
  ];
414
425
  const zIndexes = [
415
- [/^z([\d.]+)$/, ([, v]) => ({ "z-index": handler.number(v) })],
416
- [/^z-(.+)$/, ([, v]) => ({ "z-index": handler.bracket.cssvar.global.auto.number(v) }), { autocomplete: "z-<num>" }]
426
+ [/^(?:position-|pos-)?z([\d.]+)$/, ([, v]) => ({ "z-index": handler.number(v) })],
427
+ [/^(?:position-|pos-)?z-(.+)$/, ([, v]) => ({ "z-index": handler.bracket.cssvar.global.auto.number(v) }), { autocomplete: "z-<num>" }]
417
428
  ];
418
429
  const boxSizing = [
419
430
  ["box-border", { "box-sizing": "border-box" }],
@@ -1,5 +1,5 @@
1
1
  import { escapeRegExp } from '@unocss/core';
2
- import { q as getBracket } from './preset-mini.97298de6.mjs';
2
+ import { q as getBracket } from './preset-mini.ca595ab5.mjs';
3
3
 
4
4
  const variantMatcher = (name, handler) => {
5
5
  const re = new RegExp(`^${escapeRegExp(name)}[:-]`);
@@ -98,7 +98,7 @@ const globalKeywords = [
98
98
  "unset"
99
99
  ];
100
100
 
101
- const numberWithUnitRE = /^(-?\d*(?:\.\d+)?)(px|pt|pc|%|r?em|ex|ch|ic|(?:[sld]?v|cq)(?:[whib]|min|max)|in|cm|mm|rpx)?$/i;
101
+ const numberWithUnitRE = /^(-?\d*(?:\.\d+)?)(px|pt|pc|%|r?(?:em|ex|lh|cap|ch|ic)|(?:[sld]?v|cq)(?:[whib]|min|max)|in|cm|mm|rpx)?$/i;
102
102
  const numberRE = /^(-?\d*(?:\.\d+)?)$/i;
103
103
  const unitOnlyRE = /^(px)$/i;
104
104
 
@@ -350,15 +350,18 @@ function getThemeColor(theme, colors) {
350
350
  }
351
351
  return obj;
352
352
  }
353
- function parseColor$1(body, theme) {
353
+ function splitShorthand(body, type) {
354
354
  const split = body.split(/(?:\/|:)/);
355
- let main, opacity;
356
- if (split[0] === "[color") {
357
- main = split.slice(0, 2).join(":");
358
- opacity = split[2];
359
- } else {
360
- [main, opacity] = split;
355
+ if (split[0] === `[${type}`) {
356
+ return [
357
+ split.slice(0, 2).join(":"),
358
+ split[2]
359
+ ];
361
360
  }
361
+ return split;
362
+ }
363
+ function parseColor$1(body, theme) {
364
+ const [main, opacity] = splitShorthand(body, "color");
362
365
  const colors = main.replace(/([a-z])([0-9])/g, "$1-$2").split(/-/g);
363
366
  const [name] = colors;
364
367
  if (!name)
@@ -727,4 +730,4 @@ function parseCssSpaceColorValues(componentString) {
727
730
  };
728
731
  }
729
732
 
730
- export { CONTROL_MINI_NO_NEGATIVE as C, hasParseableColor as a, cornerMap as b, colorResolver as c, directionMap as d, colorToString as e, colorOpacityToString as f, globalKeywords as g, handler as h, colorableShadows as i, insetMap as j, positionMap as k, resolveBreakpoints as l, makeGlobalStaticRules as m, numberWithUnitRE as n, directionSize as o, parseColor$1 as p, getBracket as q, resolveVerticalBreakpoints as r, getComponent as s, hex2rgba as t, parseCssColor as u, h as v, valueHandlers as w, xyzMap as x, getComponents as y };
733
+ export { CONTROL_MINI_NO_NEGATIVE as C, hasParseableColor as a, cornerMap as b, colorResolver as c, directionMap as d, colorToString as e, colorOpacityToString as f, globalKeywords as g, handler as h, colorableShadows as i, insetMap as j, positionMap as k, resolveBreakpoints as l, makeGlobalStaticRules as m, numberWithUnitRE as n, directionSize as o, parseColor$1 as p, getBracket as q, resolveVerticalBreakpoints as r, splitShorthand as s, getComponent as t, hex2rgba as u, parseCssColor as v, h as w, xyzMap as x, valueHandlers as y, getComponents as z };
@@ -100,7 +100,7 @@ const globalKeywords = [
100
100
  "unset"
101
101
  ];
102
102
 
103
- const numberWithUnitRE = /^(-?\d*(?:\.\d+)?)(px|pt|pc|%|r?em|ex|ch|ic|(?:[sld]?v|cq)(?:[whib]|min|max)|in|cm|mm|rpx)?$/i;
103
+ const numberWithUnitRE = /^(-?\d*(?:\.\d+)?)(px|pt|pc|%|r?(?:em|ex|lh|cap|ch|ic)|(?:[sld]?v|cq)(?:[whib]|min|max)|in|cm|mm|rpx)?$/i;
104
104
  const numberRE = /^(-?\d*(?:\.\d+)?)$/i;
105
105
  const unitOnlyRE = /^(px)$/i;
106
106
 
@@ -352,15 +352,18 @@ function getThemeColor(theme, colors) {
352
352
  }
353
353
  return obj;
354
354
  }
355
- function parseColor$1(body, theme) {
355
+ function splitShorthand(body, type) {
356
356
  const split = body.split(/(?:\/|:)/);
357
- let main, opacity;
358
- if (split[0] === "[color") {
359
- main = split.slice(0, 2).join(":");
360
- opacity = split[2];
361
- } else {
362
- [main, opacity] = split;
357
+ if (split[0] === `[${type}`) {
358
+ return [
359
+ split.slice(0, 2).join(":"),
360
+ split[2]
361
+ ];
363
362
  }
363
+ return split;
364
+ }
365
+ function parseColor$1(body, theme) {
366
+ const [main, opacity] = splitShorthand(body, "color");
364
367
  const colors = main.replace(/([a-z])([0-9])/g, "$1-$2").split(/-/g);
365
368
  const [name] = colors;
366
369
  if (!name)
@@ -753,5 +756,6 @@ exports.parseCssColor = parseCssColor;
753
756
  exports.positionMap = positionMap;
754
757
  exports.resolveBreakpoints = resolveBreakpoints;
755
758
  exports.resolveVerticalBreakpoints = resolveVerticalBreakpoints;
759
+ exports.splitShorthand = splitShorthand;
756
760
  exports.valueHandlers = valueHandlers;
757
761
  exports.xyzMap = xyzMap;
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.1ec77f6f.cjs');
7
- require('./shared/preset-mini.bb68e31e.cjs');
8
- require('./shared/preset-mini.5002aa63.cjs');
6
+ const _default = require('./shared/preset-mini.43dfafb9.cjs');
7
+ require('./shared/preset-mini.8953ff1a.cjs');
8
+ require('./shared/preset-mini.e54ce13d.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 { 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.9a963c89.mjs';
3
- import './shared/preset-mini.71a71f59.mjs';
4
- import './shared/preset-mini.97298de6.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.0a36abfc.mjs';
3
+ import './shared/preset-mini.a6daaf18.mjs';
4
+ import './shared/preset-mini.ca595ab5.mjs';
5
5
  import '@unocss/core';
@@ -9,6 +9,10 @@ declare const CONTROL_MINI_NO_NEGATIVE = "$$mini-no-negative";
9
9
  * @see {@link directionMap}
10
10
  */
11
11
  declare function directionSize(propertyPrefix: string): DynamicMatcher;
12
+ /**
13
+ * Split utility shorthand delimited by / or :
14
+ */
15
+ declare function splitShorthand(body: string, type: string): string[];
12
16
  /**
13
17
  * Parse color string into {@link ParsedColorValue} (if possible). Color value will first be matched to theme object before parsing.
14
18
  * See also color.tests.ts for more examples.
@@ -60,4 +64,4 @@ declare function getBracket(str: string, open: string, close: string): string[]
60
64
  declare function getComponent(str: string, open: string, close: string, separators: string | string[]): string[] | undefined;
61
65
  declare function getComponents(str: string, separators: string | string[], limit?: number): string[] | undefined;
62
66
 
63
- export { CONTROL_MINI_NO_NEGATIVE as C, colorableShadows as a, resolveVerticalBreakpoints as b, colorResolver as c, directionSize as d, getComponent as e, getComponents as f, getBracket as g, hasParseableColor as h, makeGlobalStaticRules as m, parseColor as p, resolveBreakpoints as r };
67
+ export { CONTROL_MINI_NO_NEGATIVE as C, colorableShadows as a, resolveVerticalBreakpoints as b, colorResolver as c, directionSize as d, getComponent as e, getComponents as f, getBracket as g, hasParseableColor as h, makeGlobalStaticRules as m, parseColor as p, resolveBreakpoints as r, splitShorthand as s };
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.5002aa63.cjs');
6
- const variants = require('./shared/preset-mini.19fa93be.cjs');
5
+ const colors = require('./shared/preset-mini.e54ce13d.cjs');
6
+ const variants = require('./shared/preset-mini.28b1d01c.cjs');
7
7
  require('@unocss/core');
8
8
 
9
9
 
@@ -31,6 +31,7 @@ exports.parseCssColor = colors.parseCssColor;
31
31
  exports.positionMap = colors.positionMap;
32
32
  exports.resolveBreakpoints = colors.resolveBreakpoints;
33
33
  exports.resolveVerticalBreakpoints = colors.resolveVerticalBreakpoints;
34
+ exports.splitShorthand = colors.splitShorthand;
34
35
  exports.valueHandlers = colors.valueHandlers;
35
36
  exports.xyzMap = colors.xyzMap;
36
37
  exports.variantGetBracket = variants.variantGetBracket;
package/dist/utils.d.ts CHANGED
@@ -1,6 +1,6 @@
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, g as getBracket, e as getComponent, f as getComponents, h as hasParseableColor, m as makeGlobalStaticRules, p as parseColor, r as resolveBreakpoints, b as resolveVerticalBreakpoints } from './utilities-51b38240.js';
3
+ export { C as CONTROL_MINI_NO_NEGATIVE, c as colorResolver, a as colorableShadows, d as directionSize, g as getBracket, e as getComponent, f as getComponents, h as hasParseableColor, m as makeGlobalStaticRules, p as parseColor, r as resolveBreakpoints, b as resolveVerticalBreakpoints, s as splitShorthand } from './utilities-d2f973f4.js';
4
4
  import './types-fa74508f.js';
5
5
 
6
6
  declare function hex2rgba(hex?: string): RGBAColorValue | undefined;
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, s as getComponent, y as getComponents, g as globalKeywords, v as h, h as handler, a as hasParseableColor, t as hex2rgba, j as insetMap, m as makeGlobalStaticRules, p as parseColor, u as parseCssColor, k as positionMap, l as resolveBreakpoints, r as resolveVerticalBreakpoints, w as valueHandlers, x as xyzMap } from './shared/preset-mini.97298de6.mjs';
2
- export { a as variantGetBracket, v as variantGetParameter, c as variantMatcher, b as variantParentMatcher } from './shared/preset-mini.33f541c6.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.ca595ab5.mjs';
2
+ export { a as variantGetBracket, v as variantGetParameter, c as variantMatcher, b as variantParentMatcher } from './shared/preset-mini.bd4c0c0c.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.2ad50fb9.cjs');
6
- require('./shared/preset-mini.5002aa63.cjs');
5
+ const _default = require('./shared/preset-mini.89cb41ec.cjs');
6
+ require('./shared/preset-mini.e54ce13d.cjs');
7
7
  require('@unocss/core');
8
- require('./shared/preset-mini.19fa93be.cjs');
8
+ require('./shared/preset-mini.28b1d01c.cjs');
9
9
 
10
10
 
11
11
 
@@ -3,7 +3,7 @@ import { T as Theme } from './types-fa74508f.js';
3
3
  import { PresetMiniOptions } from './index.js';
4
4
  import './colors-b217808a.js';
5
5
  import './default-344896b2.js';
6
- import './utilities-51b38240.js';
6
+ import './utilities-d2f973f4.js';
7
7
 
8
8
  declare const variantAria: VariantObject;
9
9
 
package/dist/variants.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { c as calcMaxWidthBySize, t as partClasses, a as variantAria, b as variantBreakpoints, j as variantColorsMediaOrClass, d as variantCombinators, e as variantContainerQuery, m as variantCssLayer, h as variantCustomMedia, f as variantDataAttribute, u as variantImportant, n as variantInternalLayer, k as variantLanguageDirections, w as variantNegative, g as variantPrint, r as variantPseudoClassFunctions, q as variantPseudoClassesAndElements, o as variantScope, l as variantSelector, i as variantSupports, s as variantTaggedPseudoClasses, p as variantVariables, v as variants } from './shared/preset-mini.2612e983.mjs';
2
- import './shared/preset-mini.97298de6.mjs';
1
+ export { c as calcMaxWidthBySize, t as partClasses, a as variantAria, b as variantBreakpoints, j as variantColorsMediaOrClass, d as variantCombinators, e as variantContainerQuery, m as variantCssLayer, h as variantCustomMedia, f as variantDataAttribute, u as variantImportant, n as variantInternalLayer, k as variantLanguageDirections, w as variantNegative, g as variantPrint, r as variantPseudoClassFunctions, q as variantPseudoClassesAndElements, o as variantScope, l as variantSelector, i as variantSupports, s as variantTaggedPseudoClasses, p as variantVariables, v as variants } from './shared/preset-mini.0d510914.mjs';
2
+ import './shared/preset-mini.ca595ab5.mjs';
3
3
  import '@unocss/core';
4
- import './shared/preset-mini.33f541c6.mjs';
4
+ import './shared/preset-mini.bd4c0c0c.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/preset-mini",
3
- "version": "0.48.2",
3
+ "version": "0.48.4",
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.48.2"
64
+ "@unocss/core": "0.48.4"
65
65
  },
66
66
  "scripts": {
67
67
  "build": "unbuild",