@unocss/preset-mini 0.22.2 → 0.22.6

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.
@@ -206,14 +206,14 @@ function fraction(str) {
206
206
  }
207
207
  function bracket(str) {
208
208
  if (str && str[0] === "[" && str[str.length - 1] === "]") {
209
- return str.slice(1, -1).replace(/_/g, " ").replace(/calc\((.*)/g, (v) => {
209
+ return str.slice(1, -1).replace(/(url\(.*?\))/g, (v) => v.replace(/_/g, "\\_")).replace(/([^\\])_/g, "$1 ").replace(/calc\((.*)/g, (v) => {
210
210
  return v.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, "$1 $2 ");
211
211
  });
212
212
  }
213
213
  }
214
214
  function cssvar(str) {
215
- if (str.startsWith("$"))
216
- return `var(--${str.slice(1)})`;
215
+ if (str.match(/^\$\S/))
216
+ return `var(--${core.escapeSelector(str.slice(1))})`;
217
217
  }
218
218
  function time(str) {
219
219
  const match = str.match(/^(-?[0-9.]+)(s|ms)?$/i);
@@ -225,7 +225,7 @@ function time(str) {
225
225
  return unit ? `${round(num)}${unit}` : `${round(num)}ms`;
226
226
  }
227
227
  function degree(str) {
228
- const match = str.match(/^(-?[0-9.]+)(deg)?$/i);
228
+ const match = str.match(/^(-?[0-9.]+)(deg|rad|grad|turn)?$/i);
229
229
  if (!match)
230
230
  return;
231
231
  const [, n, unit] = match;
@@ -265,11 +265,8 @@ const valueHandlers = {
265
265
  const handler = core.createValueHandler(valueHandlers);
266
266
  const h = handler;
267
267
 
268
- function capitalize(str) {
269
- return str.charAt(0).toUpperCase() + str.slice(1);
270
- }
271
268
  const directionSize = (propertyPrefix) => ([_, direction, size]) => {
272
- const v = handler.bracket.auto.rem.fraction.cssvar(size);
269
+ const v = handler.bracket.cssvar.auto.fraction.rem(size);
273
270
  if (v !== void 0)
274
271
  return directionMap[direction].map((i) => [`${propertyPrefix}${i}`, v]);
275
272
  };
@@ -299,7 +296,7 @@ const parseColor = (body, theme) => {
299
296
  colorData = getThemeColor(theme, colors.slice(0, -1));
300
297
  } else {
301
298
  colorData = getThemeColor(theme, colors);
302
- if (!colorData) {
299
+ if (!colorData && colors.length <= 2) {
303
300
  [, no = no] = colors;
304
301
  colorData = getThemeColor(theme, [name]);
305
302
  }
@@ -353,7 +350,6 @@ const colorResolver = (property, varName) => ([, body], { theme }) => {
353
350
  }
354
351
  };
355
352
 
356
- exports.capitalize = capitalize;
357
353
  exports.colorResolver = colorResolver;
358
354
  exports.cornerMap = cornerMap;
359
355
  exports.directionMap = directionMap;
@@ -1,4 +1,4 @@
1
- import { createValueHandler, hex2rgba } from '@unocss/core';
1
+ import { escapeSelector, createValueHandler, hex2rgba } from '@unocss/core';
2
2
 
3
3
  const directionMap = {
4
4
  "l": ["-left"],
@@ -204,14 +204,14 @@ function fraction(str) {
204
204
  }
205
205
  function bracket(str) {
206
206
  if (str && str[0] === "[" && str[str.length - 1] === "]") {
207
- return str.slice(1, -1).replace(/_/g, " ").replace(/calc\((.*)/g, (v) => {
207
+ return str.slice(1, -1).replace(/(url\(.*?\))/g, (v) => v.replace(/_/g, "\\_")).replace(/([^\\])_/g, "$1 ").replace(/calc\((.*)/g, (v) => {
208
208
  return v.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, "$1 $2 ");
209
209
  });
210
210
  }
211
211
  }
212
212
  function cssvar(str) {
213
- if (str.startsWith("$"))
214
- return `var(--${str.slice(1)})`;
213
+ if (str.match(/^\$\S/))
214
+ return `var(--${escapeSelector(str.slice(1))})`;
215
215
  }
216
216
  function time(str) {
217
217
  const match = str.match(/^(-?[0-9.]+)(s|ms)?$/i);
@@ -223,7 +223,7 @@ function time(str) {
223
223
  return unit ? `${round(num)}${unit}` : `${round(num)}ms`;
224
224
  }
225
225
  function degree(str) {
226
- const match = str.match(/^(-?[0-9.]+)(deg)?$/i);
226
+ const match = str.match(/^(-?[0-9.]+)(deg|rad|grad|turn)?$/i);
227
227
  if (!match)
228
228
  return;
229
229
  const [, n, unit] = match;
@@ -263,11 +263,8 @@ const valueHandlers = {
263
263
  const handler = createValueHandler(valueHandlers);
264
264
  const h = handler;
265
265
 
266
- function capitalize(str) {
267
- return str.charAt(0).toUpperCase() + str.slice(1);
268
- }
269
266
  const directionSize = (propertyPrefix) => ([_, direction, size]) => {
270
- const v = handler.bracket.auto.rem.fraction.cssvar(size);
267
+ const v = handler.bracket.cssvar.auto.fraction.rem(size);
271
268
  if (v !== void 0)
272
269
  return directionMap[direction].map((i) => [`${propertyPrefix}${i}`, v]);
273
270
  };
@@ -297,7 +294,7 @@ const parseColor = (body, theme) => {
297
294
  colorData = getThemeColor(theme, colors.slice(0, -1));
298
295
  } else {
299
296
  colorData = getThemeColor(theme, colors);
300
- if (!colorData) {
297
+ if (!colorData && colors.length <= 2) {
301
298
  [, no = no] = colors;
302
299
  colorData = getThemeColor(theme, [name]);
303
300
  }
@@ -351,4 +348,4 @@ const colorResolver = (property, varName) => ([, body], { theme }) => {
351
348
  }
352
349
  };
353
350
 
354
- export { cornerMap as a, directionSize as b, colorResolver as c, directionMap as d, positionMap as e, h as f, capitalize as g, handler as h, insetMap as i, parseColor as p, valueHandlers as v, xyzMap as x };
351
+ export { cornerMap as a, directionSize as b, colorResolver as c, directionMap as d, positionMap as e, h as f, handler as h, insetMap as i, parseColor as p, valueHandlers as v, xyzMap as x };
@@ -1,4 +1,4 @@
1
- import { T as Theme } from './types-c14b808b';
1
+ import { T as Theme } from './types-154878eb';
2
2
 
3
3
  declare const colors: Theme['colors'];
4
4
 
package/dist/colors.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { c as colors } from './colors-338f482c';
2
- import './types-c14b808b';
1
+ export { c as colors } from './colors-db01a23e';
2
+ import './types-154878eb';
@@ -1,4 +1,4 @@
1
- import { T as Theme } from './types-c14b808b';
1
+ import { T as Theme } from './types-154878eb';
2
2
 
3
3
  declare const theme: Theme;
4
4
 
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { PresetOptions, Preset } from '@unocss/core';
2
- import { T as Theme } from './types-c14b808b';
3
- export { T as Theme, a as ThemeAnimation } from './types-c14b808b';
4
- export { t as theme } from './default-17948303';
5
- export { c as colors } from './colors-338f482c';
6
- export { p as parseColor } from './utilities-13c33ba5';
2
+ import { T as Theme } from './types-154878eb';
3
+ export { T as Theme, a as ThemeAnimation } from './types-154878eb';
4
+ export { t as theme } from './default-c46850c2';
5
+ export { c as colors } from './colors-db01a23e';
6
+ export { p as parseColor } from './utilities-8c324eff';
7
7
 
8
8
  interface PresetMiniOptions extends PresetOptions {
9
9
  /**
package/dist/rules.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Rule } from '@unocss/core';
2
- import { T as Theme } from './types-c14b808b';
2
+ import { T as Theme } from './types-154878eb';
3
3
 
4
4
  declare const verticalAligns: Rule[];
5
5
  declare const textAligns: Rule[];
@@ -84,7 +84,7 @@ declare const svgUtilities: Rule[];
84
84
 
85
85
  declare const transforms: Rule[];
86
86
 
87
- declare const transitions: Rule[];
87
+ declare const transitions: Rule<Theme>[];
88
88
 
89
89
  declare const fonts: Rule<Theme>[];
90
90
  declare const tabSizes: Rule<Theme>[];
package/dist/theme.cjs CHANGED
@@ -14,6 +14,7 @@ exports.borderRadius = _default.borderRadius;
14
14
  exports.boxShadow = _default.boxShadow;
15
15
  exports.breakpoints = _default.breakpoints;
16
16
  exports.dropShadow = _default.dropShadow;
17
+ exports.easing = _default.easing;
17
18
  exports.fontFamily = _default.fontFamily;
18
19
  exports.fontSize = _default.fontSize;
19
20
  exports.height = _default.height;
package/dist/theme.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export { c as colors } from './colors-338f482c';
2
- export { t as theme } from './default-17948303';
3
- import { T as Theme } from './types-c14b808b';
4
- export { T as Theme, a as ThemeAnimation } from './types-c14b808b';
1
+ export { c as colors } from './colors-db01a23e';
2
+ export { t as theme } from './default-c46850c2';
3
+ import { T as Theme } from './types-154878eb';
4
+ export { T as Theme, a as ThemeAnimation } from './types-154878eb';
5
5
 
6
6
  declare const blur: {
7
7
  DEFAULT: string;
@@ -64,6 +64,13 @@ declare const boxShadow: {
64
64
  inner: string;
65
65
  none: string;
66
66
  };
67
+ declare const easing: {
68
+ DEFAULT: string;
69
+ linear: string;
70
+ in: string;
71
+ out: string;
72
+ 'in-out': string;
73
+ };
67
74
 
68
75
  declare const baseSize: {
69
76
  xs: string;
@@ -144,4 +151,4 @@ declare const maxHeight: {
144
151
  none: string;
145
152
  };
146
153
 
147
- export { baseSize, blur, borderRadius, boxShadow, breakpoints, dropShadow, fontFamily, fontSize, height, letterSpacing, lineHeight, maxHeight, maxWidth, textIndent, textShadow, textStrokeWidth, width, wordSpacing };
154
+ export { baseSize, blur, borderRadius, boxShadow, breakpoints, dropShadow, easing, fontFamily, fontSize, height, letterSpacing, lineHeight, maxHeight, maxWidth, textIndent, textShadow, textStrokeWidth, width, wordSpacing };
package/dist/theme.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  export { c as colors } from './chunks/colors.mjs';
2
- export { m as baseSize, b as blur, j as borderRadius, k as boxShadow, i as breakpoints, d as dropShadow, f as fontFamily, a as fontSize, p as height, h as letterSpacing, l as lineHeight, q as maxHeight, o as maxWidth, c as textIndent, g as textShadow, e as textStrokeWidth, t as theme, n as width, w as wordSpacing } from './chunks/default.mjs';
2
+ export { n as baseSize, b as blur, j as borderRadius, k as boxShadow, i as breakpoints, d as dropShadow, m as easing, f as fontFamily, a as fontSize, q as height, h as letterSpacing, l as lineHeight, r as maxHeight, p as maxWidth, c as textIndent, g as textShadow, e as textStrokeWidth, t as theme, o as width, w as wordSpacing } from './chunks/default.mjs';
@@ -31,6 +31,7 @@ interface Theme {
31
31
  textStrokeWidth?: Record<string, string>;
32
32
  blur?: Record<string, string>;
33
33
  dropShadow?: Record<string, string | string[]>;
34
+ easing?: Record<string, string>;
34
35
  animation?: ThemeAnimation;
35
36
  }
36
37
 
@@ -1,7 +1,6 @@
1
1
  import { DynamicMatcher, ParsedColorValue } from '@unocss/core';
2
- import { T as Theme } from './types-c14b808b';
2
+ import { T as Theme } from './types-154878eb';
3
3
 
4
- declare function capitalize<T extends string>(str: T): Capitalize<T>;
5
4
  /**
6
5
  * Provide {@link DynamicMatcher} function returning spacing definition. See spacing rules.
7
6
  *
@@ -53,4 +52,4 @@ declare const parseColor: (body: string, theme: Theme) => ParsedColorValue | und
53
52
  */
54
53
  declare const colorResolver: (property: string, varName: string) => DynamicMatcher;
55
54
 
56
- export { colorResolver as a, capitalize as c, directionSize as d, parseColor as p };
55
+ export { colorResolver as c, directionSize as d, parseColor as p };
package/dist/utils.cjs CHANGED
@@ -8,7 +8,6 @@ require('@unocss/core');
8
8
 
9
9
 
10
10
 
11
- exports.capitalize = utilities.capitalize;
12
11
  exports.colorResolver = utilities.colorResolver;
13
12
  exports.cornerMap = utilities.cornerMap;
14
13
  exports.directionMap = utilities.directionMap;
package/dist/utils.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as _unocss_core from '@unocss/core';
2
2
  import { VariantHandler } from '@unocss/core';
3
- export { c as capitalize, a as colorResolver, d as directionSize, p as parseColor } from './utilities-13c33ba5';
4
- import './types-c14b808b';
3
+ export { c as colorResolver, d as directionSize, p as parseColor } from './utilities-8c324eff';
4
+ import './types-154878eb';
5
5
 
6
6
  declare const directionMap: Record<string, string[]>;
7
7
  declare const insetMap: Record<string, string[]>;
package/dist/utils.mjs CHANGED
@@ -1,3 +1,3 @@
1
- export { g as capitalize, c as colorResolver, a as cornerMap, d as directionMap, b as directionSize, f as h, h as handler, i as insetMap, p as parseColor, e as positionMap, v as valueHandlers, x as xyzMap } from './chunks/utilities.mjs';
1
+ export { c as colorResolver, a as cornerMap, d as directionMap, b as directionSize, f as h, h as handler, i as insetMap, p as parseColor, e as positionMap, v as valueHandlers, x as xyzMap } from './chunks/utilities.mjs';
2
2
  export { v as variantMatcher, a as variantParentMatcher } from './chunks/variants.mjs';
3
3
  import '@unocss/core';
package/dist/variants.cjs CHANGED
@@ -8,7 +8,6 @@ require('@unocss/core');
8
8
 
9
9
 
10
10
 
11
- exports.CONTROL_BYPASS_PSEUDO_CLASS = _default.CONTROL_BYPASS_PSEUDO_CLASS;
12
11
  exports.partClasses = _default.partClasses;
13
12
  exports.variantBreakpoints = _default.variantBreakpoints;
14
13
  exports.variantColorsMediaOrClass = _default.variantColorsMediaOrClass;
@@ -1,35 +1,31 @@
1
- import * as _unocss_core from '@unocss/core';
2
1
  import { Variant, VariantFunction, VariantObject } from '@unocss/core';
3
- import { T as Theme } from './types-c14b808b';
2
+ import { T as Theme } from './types-154878eb';
4
3
  import { PresetMiniOptions } from './index';
5
- import './default-17948303';
6
- import './colors-338f482c';
7
- import './utilities-13c33ba5';
4
+ import './default-c46850c2';
5
+ import './colors-db01a23e';
6
+ import './utilities-8c324eff';
8
7
 
9
8
  declare const variantBreakpoints: Variant<Theme>;
10
9
 
11
10
  declare const variantCombinators: Variant[];
12
11
 
13
- declare const variantColorsMediaOrClass: (options?: PresetMiniOptions) => VariantFunction[];
12
+ declare const variantMotions: VariantFunction[];
13
+ declare const variantOrientations: VariantFunction[];
14
+ declare const variantPrint: VariantFunction;
14
15
 
15
- declare const variantLanguageDirections: Variant[];
16
+ declare const variantColorsMediaOrClass: (options?: PresetMiniOptions) => VariantFunction[];
16
17
 
17
18
  declare const variants: (options: PresetMiniOptions) => Variant<Theme>[];
18
19
 
20
+ declare const variantLanguageDirections: Variant[];
21
+
19
22
  declare const variantImportant: Variant;
20
23
  declare const variantNegative: Variant;
21
24
 
22
- declare const variantMotions: Variant[];
23
-
24
- declare const variantOrientations: Variant[];
25
-
26
- declare const variantPrint: (input: string) => _unocss_core.VariantHandler | undefined;
27
-
28
- declare const CONTROL_BYPASS_PSEUDO_CLASS = "$$no-pseudo";
29
25
  declare const variantPseudoElements: VariantFunction;
30
26
  declare const variantPseudoClasses: VariantObject;
31
27
  declare const variantPseudoClassFunctions: VariantObject;
32
28
  declare const variantTaggedPseudoClasses: (options?: PresetMiniOptions) => VariantObject[];
33
29
  declare const partClasses: VariantObject;
34
30
 
35
- export { CONTROL_BYPASS_PSEUDO_CLASS, partClasses, variantBreakpoints, variantColorsMediaOrClass, variantCombinators, variantImportant, variantLanguageDirections, variantMotions, variantNegative, variantOrientations, variantPrint, variantPseudoClassFunctions, variantPseudoClasses, variantPseudoElements, variantTaggedPseudoClasses, variants };
31
+ export { partClasses, variantBreakpoints, variantColorsMediaOrClass, variantCombinators, variantImportant, variantLanguageDirections, variantMotions, variantNegative, variantOrientations, variantPrint, variantPseudoClassFunctions, variantPseudoClasses, variantPseudoElements, variantTaggedPseudoClasses, variants };
package/dist/variants.mjs CHANGED
@@ -1,3 +1,3 @@
1
- export { C as CONTROL_BYPASS_PSEUDO_CLASS, p as partClasses, a as variantBreakpoints, c as variantColorsMediaOrClass, b as variantCombinators, e as variantImportant, d as variantLanguageDirections, g as variantMotions, f as variantNegative, h as variantOrientations, i as variantPrint, l as variantPseudoClassFunctions, k as variantPseudoClasses, j as variantPseudoElements, m as variantTaggedPseudoClasses, v as variants } from './chunks/default3.mjs';
1
+ export { p as partClasses, a as variantBreakpoints, f as variantColorsMediaOrClass, b as variantCombinators, h as variantImportant, g as variantLanguageDirections, c as variantMotions, i as variantNegative, d as variantOrientations, e as variantPrint, l as variantPseudoClassFunctions, k as variantPseudoClasses, j as variantPseudoElements, m as variantTaggedPseudoClasses, v as variants } from './chunks/default3.mjs';
2
2
  import './chunks/variants.mjs';
3
3
  import '@unocss/core';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/preset-mini",
3
- "version": "0.22.2",
3
+ "version": "0.22.6",
4
4
  "description": "The minimal preset for UnoCSS",
5
5
  "keywords": [
6
6
  "unocss",
@@ -61,7 +61,7 @@
61
61
  "*.css"
62
62
  ],
63
63
  "dependencies": {
64
- "@unocss/core": "0.22.2"
64
+ "@unocss/core": "0.22.6"
65
65
  },
66
66
  "scripts": {
67
67
  "build": "unbuild",