@unocss/preset-mini 0.22.5 → 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.
@@ -124,6 +124,13 @@ const boxShadow = {
124
124
  "inner": "inset 0 2px 4px 0 rgba(0,0,0,0.05)",
125
125
  "none": "0 0 #0000"
126
126
  };
127
+ const easing = {
128
+ "DEFAULT": "cubic-bezier(0.4, 0, 0.2, 1)",
129
+ "linear": "linear",
130
+ "in": "cubic-bezier(0.4, 0, 1, 1)",
131
+ "out": "cubic-bezier(0, 0, 0.2, 1)",
132
+ "in-out": "cubic-bezier(0.4, 0, 0.2, 1)"
133
+ };
127
134
 
128
135
  const blur = {
129
136
  "DEFAULT": "8px",
@@ -206,7 +213,8 @@ const theme = {
206
213
  textShadow,
207
214
  textStrokeWidth,
208
215
  blur,
209
- dropShadow
216
+ dropShadow,
217
+ easing
210
218
  };
211
219
 
212
220
  exports.baseSize = baseSize;
@@ -215,6 +223,7 @@ exports.borderRadius = borderRadius;
215
223
  exports.boxShadow = boxShadow;
216
224
  exports.breakpoints = breakpoints;
217
225
  exports.dropShadow = dropShadow;
226
+ exports.easing = easing;
218
227
  exports.fontFamily = fontFamily;
219
228
  exports.fontSize = fontSize;
220
229
  exports.height = height;
@@ -122,6 +122,13 @@ const boxShadow = {
122
122
  "inner": "inset 0 2px 4px 0 rgba(0,0,0,0.05)",
123
123
  "none": "0 0 #0000"
124
124
  };
125
+ const easing = {
126
+ "DEFAULT": "cubic-bezier(0.4, 0, 0.2, 1)",
127
+ "linear": "linear",
128
+ "in": "cubic-bezier(0.4, 0, 1, 1)",
129
+ "out": "cubic-bezier(0, 0, 0.2, 1)",
130
+ "in-out": "cubic-bezier(0.4, 0, 0.2, 1)"
131
+ };
125
132
 
126
133
  const blur = {
127
134
  "DEFAULT": "8px",
@@ -204,7 +211,8 @@ const theme = {
204
211
  textShadow,
205
212
  textStrokeWidth,
206
213
  blur,
207
- dropShadow
214
+ dropShadow,
215
+ easing
208
216
  };
209
217
 
210
- export { fontSize as a, blur as b, textIndent as c, dropShadow as d, textStrokeWidth as e, fontFamily as f, textShadow as g, letterSpacing as h, breakpoints as i, borderRadius as j, boxShadow as k, lineHeight as l, baseSize as m, width as n, maxWidth as o, height as p, maxHeight as q, theme as t, wordSpacing as w };
218
+ export { fontSize as a, blur as b, textIndent as c, dropShadow as d, textStrokeWidth as e, fontFamily as f, textShadow as g, letterSpacing as h, breakpoints as i, borderRadius as j, boxShadow as k, lineHeight as l, easing as m, baseSize as n, width as o, maxWidth as p, height as q, maxHeight as r, theme as t, wordSpacing as w };
@@ -19,9 +19,9 @@ const textAligns = [
19
19
  ];
20
20
 
21
21
  const outline = [
22
- [/^outline-(?:width-|size-)?(.+)$/, ([, d]) => ({ "outline-width": utilities.handler.bracket.cssvar.fraction.rem(d) })],
22
+ [/^outline-(?:width-|size-)?(.+)$/, ([, d]) => ({ "outline-width": utilities.handler.bracket.cssvar.px(d) })],
23
23
  [/^outline-(?:color-)?(.+)$/, utilities.colorResolver("outline-color", "outline-color")],
24
- [/^outline-offset-(.+)$/, ([, d]) => ({ "outline-offset": utilities.handler.bracket.cssvar.fraction.rem(d) })],
24
+ [/^outline-offset-(.+)$/, ([, d]) => ({ "outline-offset": utilities.handler.bracket.cssvar.px(d) })],
25
25
  ["outline", { "outline-style": "solid" }],
26
26
  [/^outline-(auto|dashed|dotted|double|hidden|solid|groove|ridge|inset|outset|inherit|initial|revert|unset)$/, ([, c]) => ({ "outline-style": c })],
27
27
  ["outline-none", { "outline": "2px solid transparent", "outline-offset": "2px" }]
@@ -168,19 +168,14 @@ const transitions = [
168
168
  if (p) {
169
169
  return {
170
170
  "transition-property": p,
171
- "transition-timing-function": "cubic-bezier(0.4,0,0.2,1)",
171
+ "transition-timing-function": "cubic-bezier(0.4, 0, 0.2, 1)",
172
172
  "transition-duration": `${duration}ms`
173
173
  };
174
174
  }
175
175
  }],
176
176
  [/^(?:transition-)?duration-(.+)$/, ([, d]) => ({ "transition-duration": utilities.handler.bracket.cssvar.time(d) })],
177
177
  [/^(?:transition-)?delay-(.+)$/, ([, d]) => ({ "transition-delay": utilities.handler.bracket.cssvar.time(d) })],
178
- [/^ease-(.+)$/, ([, d]) => ({ "transition-timing-function": utilities.handler.bracket.cssvar(d) })],
179
- ["ease", { "transition-timing-function": "cubic-bezier(0.4, 0, 0.2, 1)" }],
180
- ["ease-linear", { "transition-timing-function": "linear" }],
181
- ["ease-in", { "transition-timing-function": "cubic-bezier(0.4, 0, 1, 1)" }],
182
- ["ease-out", { "transition-timing-function": "cubic-bezier(0, 0, 0.2, 1)" }],
183
- ["ease-in-out", { "transition-timing-function": "cubic-bezier(0.4, 0, 0.2, 1)" }],
178
+ [/^(?:transition-)?ease(?:-(.+))?$/, ([, d], { theme }) => ({ "transition-timing-function": theme.easing?.[d || "DEFAULT"] ?? utilities.handler.bracket.cssvar(d) })],
184
179
  [/^(?:transition-)?property-(.+)$/, ([, v]) => ({ "transition-property": utilities.handler.global(v) || transitionProperty(v) })],
185
180
  ["transition-property-none", { "transition-property": "none" }],
186
181
  ["property-none", { "transition-property": "none" }],
@@ -806,10 +801,10 @@ const variablesAbbrMap = {
806
801
  ws: "white-space"
807
802
  };
808
803
  const cssVariables = [
809
- [/^(.+?)-\$(.+)$/, ([, name, varname]) => {
804
+ [/^(.+?)-(\$.+)$/, ([, name, varname]) => {
810
805
  const prop = variablesAbbrMap[name];
811
806
  if (prop)
812
- return { [prop]: `var(--${varname})` };
807
+ return { [prop]: utilities.handler.cssvar(varname) };
813
808
  }]
814
809
  ];
815
810
  const cssProperty = [
@@ -17,9 +17,9 @@ const textAligns = [
17
17
  ];
18
18
 
19
19
  const outline = [
20
- [/^outline-(?:width-|size-)?(.+)$/, ([, d]) => ({ "outline-width": handler.bracket.cssvar.fraction.rem(d) })],
20
+ [/^outline-(?:width-|size-)?(.+)$/, ([, d]) => ({ "outline-width": handler.bracket.cssvar.px(d) })],
21
21
  [/^outline-(?:color-)?(.+)$/, colorResolver("outline-color", "outline-color")],
22
- [/^outline-offset-(.+)$/, ([, d]) => ({ "outline-offset": handler.bracket.cssvar.fraction.rem(d) })],
22
+ [/^outline-offset-(.+)$/, ([, d]) => ({ "outline-offset": handler.bracket.cssvar.px(d) })],
23
23
  ["outline", { "outline-style": "solid" }],
24
24
  [/^outline-(auto|dashed|dotted|double|hidden|solid|groove|ridge|inset|outset|inherit|initial|revert|unset)$/, ([, c]) => ({ "outline-style": c })],
25
25
  ["outline-none", { "outline": "2px solid transparent", "outline-offset": "2px" }]
@@ -166,19 +166,14 @@ const transitions = [
166
166
  if (p) {
167
167
  return {
168
168
  "transition-property": p,
169
- "transition-timing-function": "cubic-bezier(0.4,0,0.2,1)",
169
+ "transition-timing-function": "cubic-bezier(0.4, 0, 0.2, 1)",
170
170
  "transition-duration": `${duration}ms`
171
171
  };
172
172
  }
173
173
  }],
174
174
  [/^(?:transition-)?duration-(.+)$/, ([, d]) => ({ "transition-duration": handler.bracket.cssvar.time(d) })],
175
175
  [/^(?:transition-)?delay-(.+)$/, ([, d]) => ({ "transition-delay": handler.bracket.cssvar.time(d) })],
176
- [/^ease-(.+)$/, ([, d]) => ({ "transition-timing-function": handler.bracket.cssvar(d) })],
177
- ["ease", { "transition-timing-function": "cubic-bezier(0.4, 0, 0.2, 1)" }],
178
- ["ease-linear", { "transition-timing-function": "linear" }],
179
- ["ease-in", { "transition-timing-function": "cubic-bezier(0.4, 0, 1, 1)" }],
180
- ["ease-out", { "transition-timing-function": "cubic-bezier(0, 0, 0.2, 1)" }],
181
- ["ease-in-out", { "transition-timing-function": "cubic-bezier(0.4, 0, 0.2, 1)" }],
176
+ [/^(?:transition-)?ease(?:-(.+))?$/, ([, d], { theme }) => ({ "transition-timing-function": theme.easing?.[d || "DEFAULT"] ?? handler.bracket.cssvar(d) })],
182
177
  [/^(?:transition-)?property-(.+)$/, ([, v]) => ({ "transition-property": handler.global(v) || transitionProperty(v) })],
183
178
  ["transition-property-none", { "transition-property": "none" }],
184
179
  ["property-none", { "transition-property": "none" }],
@@ -804,10 +799,10 @@ const variablesAbbrMap = {
804
799
  ws: "white-space"
805
800
  };
806
801
  const cssVariables = [
807
- [/^(.+?)-\$(.+)$/, ([, name, varname]) => {
802
+ [/^(.+?)-(\$.+)$/, ([, name, varname]) => {
808
803
  const prop = variablesAbbrMap[name];
809
804
  if (prop)
810
- return { [prop]: `var(--${varname})` };
805
+ return { [prop]: handler.cssvar(varname) };
811
806
  }]
812
807
  ];
813
808
  const cssProperty = [
@@ -212,8 +212,8 @@ function bracket(str) {
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);
@@ -296,7 +296,7 @@ const parseColor = (body, theme) => {
296
296
  colorData = getThemeColor(theme, colors.slice(0, -1));
297
297
  } else {
298
298
  colorData = getThemeColor(theme, colors);
299
- if (!colorData) {
299
+ if (!colorData && colors.length <= 2) {
300
300
  [, no = no] = colors;
301
301
  colorData = getThemeColor(theme, [name]);
302
302
  }
@@ -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"],
@@ -210,8 +210,8 @@ function bracket(str) {
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);
@@ -294,7 +294,7 @@ const parseColor = (body, theme) => {
294
294
  colorData = getThemeColor(theme, colors.slice(0, -1));
295
295
  } else {
296
296
  colorData = getThemeColor(theme, colors);
297
- if (!colorData) {
297
+ if (!colorData && colors.length <= 2) {
298
298
  [, no = no] = colors;
299
299
  colorData = getThemeColor(theme, [name]);
300
300
  }
@@ -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-29b01158';
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,5 +1,5 @@
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
4
  /**
5
5
  * Provide {@link DynamicMatcher} function returning spacing definition. See spacing rules.
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 colorResolver, d as directionSize, p as parseColor } from './utilities-29b01158';
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[]>;
@@ -1,9 +1,9 @@
1
1
  import { Variant, VariantFunction, VariantObject } from '@unocss/core';
2
- import { T as Theme } from './types-c14b808b';
2
+ import { T as Theme } from './types-154878eb';
3
3
  import { PresetMiniOptions } from './index';
4
- import './default-17948303';
5
- import './colors-338f482c';
6
- import './utilities-29b01158';
4
+ import './default-c46850c2';
5
+ import './colors-db01a23e';
6
+ import './utilities-8c324eff';
7
7
 
8
8
  declare const variantBreakpoints: Variant<Theme>;
9
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/preset-mini",
3
- "version": "0.22.5",
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.5"
64
+ "@unocss/core": "0.22.6"
65
65
  },
66
66
  "scripts": {
67
67
  "build": "unbuild",